Download Solutions to exam 1 1. Construct the truth table for the following

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts
no text concepts found
Transcript
Solutions to exam 1
1. Construct the truth table for the following proposition:
(p → q) → (¬p ↔ ¬r)
Solution:
p
T
T
T
T
F
F
F
F
q
T
T
F
F
T
T
F
F
r
T
F
T
F
T
F
T
F
p → q ¬p ¬r ¬p ↔ ¬r (p → q) → (¬p ↔ ¬r)
T
F F
T
T
T
F T
F
F
F
F F
T
T
F
F T
F
T
T
T F
F
F
T
T T
T
T
T
T F
F
F
T
T T
T
T
2. Express the negation of the statement so that all negation symbols
immediately precedes predicates.
∀y∃x∃z(T (x, y, z) ∨ Q(x, y))
Solution:
¬(∀y∃x∃z(T (x, y, z) ∨ Q(x, y))) ≡ ∃y∀x∀z(¬T (x, y, z) ∧ ¬Q(x, y)
3. Show without using truth tables that the following logical equivalences
hold:
(a)
¬((p → q) → r) ≡ (¬p ∨ q) ∧ ¬r
Solution:
¬((p → q) → r) ≡
≡
≡
≡
1
¬(¬(p → q) ∨ r)
¬(¬(¬p ∨ q) ∨ r)
¬((p ∧ ¬q) ∨ r)
(¬p ∨ q) ∧ ¬r)
(b)
¬(a → (¬(c → d) ∧ (a → (d ∨ ¬c)))) ≡ a
Solution: First note that ¬(c → d) ≡ ¬(¬c ∨ d) ≡ c ∧ ¬d and
a → (d ∨ ¬c) ≡ ¬a ∨ d ∨ ¬c. Thus
≡
≡
≡
≡
≡
≡
≡
≡
≡
¬(a → (¬(c → d) ∧ (a → (d ∨ ¬c))))
¬(a → (c ∧ ¬d) ∧ (¬a ∨ d ∨ ¬c))
¬(¬a ∨ ((c ∧ ¬d) ∧ (¬a ∨ d ∨ ¬c))
a ∧ [¬(c ∧ ¬d) ∨ ¬(¬a ∨ d ∨ ¬c)]
a ∧ [(¬c ∨ d) ∨ (a ∧ ¬d ∧ c)]
a ∧ [(¬c ∨ d ∨ a) ∧ (c ∨ d¬d) ∧ (¬c ∨ d ∨ c)]
a ∧ [(¬c ∨ d ∨ a) ∧ T ∧ T ]
a ∧ (¬c ∨ d ∨ a)
(a ∧ ¬c) ∨ (a ∧ d) ∨ a
a
4. Translate the following english sentences into logical expressions. Use
the following predicates:
W(x): x is a whole number, i.e. 1, 2, 3, . . .
N(x): x is a natural number, i.e. 0, 1, 2, 3, . . .
Q(x): x is a rational number
R(x): x is a real number
G(x, y): x is greater than y
(a) Every natural number greater than 0 is a whole number.
Solution:
∀x(N (x) ∧ G(x, 0)) → W (x))
(b) Some real numbers are rational numbers, but some aren’t.
Solution:
∃x(R(x) ∧ Q(x)) ∧ ∃y(R(y) ∧ ¬Q(y))
2
(c) For every pair of natural numbers there is a rational number between them.
Solution:
∀x∀y∃z(N (x)∧N (y)) → Q(z)∧[(G(z, x)∧G(y, z))∨(G(z, y)∧G(x, z))]
5. Show that the argument form with premises
(a) p ∨ q,
(b) ¬q,
(c) ¬p ∨ r,
(d) s → ¬r,
and conclusion ¬s is valid.
Identify which rules of inference you used.
Solution:
(a) p ∨ q (premise)
(b) ¬q (premise)
(c) ¬p ∨ r (premise)
(d) s → ¬r (premise)
(e) p (by (a) and (b) and disjunctive syllogism)
(f) r (by (e) and (c) and disjunctive syllogism)
(g) ¬s (by (d) and (f) and modus tollens)
(g) is the conclusion we want.
6. Use a direct proof to show that the product of two odd integers is an
odd integer.
Solution: Let m = 2k + 1 and n = 2j + 1 be two odd integers. Then
mn = (2k + 1)(2j + 1)
= 4kj + 2k + 2j + 1
= 2(2kj + k + j) + 1
which is odd.
3
7. Prove that bn/2c · dn/2e = bn2 /4c for all integers n.
Solution: Case 1: Assume n is an even integer, that is, there exists
an integer k such that n = 2k. Then
bn/2c · dn/2e =
=
=
=
b2k/2c · d2k/2e
bkc · dke
k·k
k2
and
bn2 /4c = bk 2 c = k 2
Case 2: Assume n is an odd integer, that is, there exists an integer k
such that n = 2k + 1. Then
bn/2c = b(2k + 1)/2c = k
and
dn/2e = d(2k + 1)/2e = k + 1
and so
bn/2c · dn/2e = k · (k + 1) = k 2 + k.
At the same time,
n2 /4 =
4k 2 + 4k + 1
= k 2 + k + 1/4,
4
so that
bn2 /4c = bk 2 + k + 1/4c = k 2 + k
8. Let A be the set {u, v, w, x} and B be the set {1}.
(a) Find A × B.
Solution:
A × B = {(u, 1), (v, 1), (w, 1), (x, 1)}
(b) Find the power set of A.
Solution: {∅, {u}, {v}, {w}, {x},
{u, v}, {u, w}, {u, x}, {v, w}, {v, x},
{w, x}, {u, v, w}, {u, v, x}, {u, w, x},
{v, w, x}, {u, v, w, x}}
4
9. Let Ai = {2, . . . , 2i}.
(a) Write down A1 , A2 , and A3 .
Solution: A1 = {2}, A2 = {2, 4}, A3 = {2, 4, 6},
(b) Find
∞
[
Ai
i=1
and prove your claim.
Solution:
S∞
i=1 Ai = {2, 4, 6, . . .} = {x | x is a positive even integer}. Since
all members of all the Ai sets are even positive integers, the union
may only contain even positive integers. On the other hand, it
contains all of them, since if we pick any positive even integer k,
then k ∈ Ak , so k is in the union.
(c) Find
∞
\
Ai
i=1
and prove your claim.
Solution:
Since A1 = {2}, A2 = {2, 4}, . . . it is obvious that all sets contain
2. On the other hand, the intersection cannot contain any element
which is not contained in A1 .
10. (a) Let f : Z → Z be the function f (x) = 3x − 1. Determine whether
f is onto (surjective). Prove your claim.
Solution: It is not onto, since there is no integer x for which
3x − 1 = 1.
(b) Let f : R → R be the function f (x) = 3x − 1. Determine whether
f is a one-to-one correspondence (bijection). Prove your claim.
Solution: It is a injective (one-to-one), since if 3x − 1 = 3y − 1
then x = y. It is onto since for any real number y there exists a
. So the
real number x such that 3x − 1 = y. This number is y+1
3
function is bijective.
(Note that Z denotes the set of integers, and R the set of real numbers.)
5
11. Translate this quantification into English and determine its truth value.
The domain for x and the domain for y is the set of integers.
√
∀x∃y(y = x)
Solution: The square
√ root of any integer is an integer. This is clearly
false: for example, 5 is not an integer.
6
Related documents