HOME WORK - 2-Solution
HOME WORK - 2-Solution
1. Let P (x) = “x is a prime” and Q(x) = “x is divisible by 4” defined over the universe of integers.
Answers:
(c) The product of two prime numbers is not prime: ∀ x ∀ y ((P (x) ∧ P (y)) → ¬P (x · y)).
(ii)
(b) You can satisfy some people all of the time, and all of the people some of the time, but you cannot satisfy all of
the people all of the time. CANSATISFY(p,t) means you can satisfy person p at time t.
(ii)
1
3. For each of the following decide if it is a CNF, a DNF, neither, or both.
Answers:
(a) ¬p ∧ q: both
(i) Recall from class that each predicate can be written as both a CNF and a DNF. Decide which one is more efficient
(requires fewer connectives) for this Boolean expression and rewrite it in the more efficient form. If both require the
same number of connectives, rewrite it as either.
(ii) Is this a tautology? A contradiction?
Answers:
There are more T’s in the tables than F’s. Therefore, it is more efficient to represent the statement as a CNF: ¬p ∨ ¬q.
(b) (q → p) → (p → q).
p q q→p p→q (q → p) → (p → q)
F F T T T
F T F T T
T F T F F
T T T T T
There are more T’s in the tables than F’s. Therefore, it is more efficient to represent the statement as a CNF: ¬p ∨ q.
2
5. For each statement, indicate in which of these domains the statement is true:
(i) integers,
(ii) rationals,
(iii) real numbers,
(iv) prime numbers,
(v) {0, 1, 2}.
Answers:
(a) ∀ z ∀ x ∀ y (x 6= y ∧ y 6= z ∧ x 6= z) → (z 6= x · y).
(iv) Does hold for prime numbers. If x, y, z are all different primes, then z cannot be equal to x · y by definition.
(v) Does hold for {0, 1, 2}. If x, y, z are all different, then either z or x · y is 0, but not both.
(b) ∀ z z 6= 0 → (∀ x ∃ y z = xy )
(i) Does not hold for integers. Counterexample: z = 2, x = 3. Then there is no integer y such that z = xy .
(ii) Does not hold for rationals. Counterexample: z = 1, x = 0. Then there is no rational y such that z = xy .
(iii) Does not hold for real numbers. Counterexample: z = 1, x = 0. Then there is no real number y such that z = xy .
(iv) Does not hold for prime numbers. Counterexample: z = 2, x = 3. Then there is no prime number y such that
z = xy .
(v) Does not hold for {0, 1, 2}. Counterexample: z = 1, x = 0. Then there is no number y ∈ {0, 1, 2} such that z = xy .
6. Use inference rules to show the following Boolean expression is always true (a tautology).
Answer:
[(p ∧ ¬(¬p ∨ q)) ∨ (p ∧ q)] → p ≡ [(p ∧ (¬¬p ∧ ¬q)) ∨ (p ∧ q)] → p (De Morgan’s law)
≡ [(p ∧ (p ∧ ¬q)) ∨ (p ∧ q)] → p (Double negation)
≡ [((p ∧ p) ∧ ¬q) ∨ (p ∧ q)] → p (Associative law)
≡ [(p ∧ ¬q) ∨ (p ∧ q)] → p (Idempotent law)
≡ [p ∧ (¬q ∨ q)] → p (Distributive law)
≡ [p ∧ T ] → p (Complement law)
≡p→p (Identity law)
≡ ¬p ∨ p (Conditional identity)
≡T (Complement law)