COMP 232: Assignment 2 40165495 - Gabrielle Lemieux Winter 2021 - Feb 26, 2021 Question 1 : (a) Not equivalent p = True; q = False; r = False p⊕q⊕r p ⊕ q ≡ True (i) p ⊕ q ⊕ r ≡ True p↔q↔r p ↔ q ≡ False (ii) p ↔ q ↔ r ≡ False (i) and (ii) aren’t equivalent. (b) Equivalent ∃(P (x) → Q(x)) ≡ ∃x(¬P (x) ∨ Q(x)) ≡ ∃x(¬P (x)) ∨ ∃xQ(x) ≡ ¬(∃xP (x)) ∨ ∃xQ(x) ∃xP (x) → ∃xQ(x) 1 Question 2 : (a) This statement would be true when there is an x for which (x = y + 3) is true for every y. However, there is no x value for which (x = y + 3) is true every y value within the domain. Therefore, this statement is false. (b) This statement would be true when (x = y + 3) → (y > 0) is true for every pair (x, y). In the case of the conditional, if the second premise is true, the entire statement will be true every time. Since, the premise (y > 0) is always true within the domain, this statement is true; for pair (x, y), the statement P (x, y) is true. (c) This statement would be true when there is an x for which (x = y + 3) → (y < 0) is true for every y. When a conditional is present, if the second premise is declared false, no matter the truth value of the first premise, the whole statement is false. Furthermore, (y < 0), will always be false within the domain. So, we can conclude that the statement is false. 2 Question 3: For (a) through (f): - Capital(x, y): x is capital the of y - Visit(x, y): x has visited y - S(x): x is a student (a) ∀x∃y(Capital(y, x) ∧ ∀z(Capital(z, x) → (y = z))) (b) Capital(M ontreal, Canada) (c) V isit(Jean, M ontreal) ∧ V isit(Jean, Ottawa) (d) ∀(x)(S(x) → V isit(x, M ontreal)) (e) ∃(x)(V isit(x, y) ∧ V isit(x, z) ∧ y 6= M ontreal ∧ z 6= M ontreal ∧ y 6= z) (f) ∀(x)¬∃(y)(S(x) → V (x, y)) For (g) through (h): - F(x, y): x and y are students who are friends - C(x, y): x is a student and they’re country of origin is y (g) ∃(x)∃(y)¬∃(z)(F (x, y) ∧ F (x, z) ∧ F (y, z)) (h) ∃(x)∃(y)∃(z)∃(c)(C(z, c) ∧ (F (x, z) ∨ F (y, z))) 3 Question 4: (a) P (1, 3) ∨ P (2, 3) ∨ P (3, 3) (b) ¬(P (2, 1) ∧ P (2, 2) ∧ P (2, 3)) (c) [P (1, 1)∨P (1, 2)∨P (1, 3)]∧[P (2, 1)∨P (2, 2)∨P (2, 3)]∧[P (3, 1)∨P (3, 2)∨ P (3, 3)] (d) ¬[P (1, 1) ∨ P (1, 2) ∨ P (1, 3)] ∧ ¬[P (2, 1) ∨ P (2, 2) ∨ P (2, 3)] ∧ ¬[P (3, 1) ∨ P (3, 2) ∨ P (3, 3)] 4 Question 5: (a) Valid 1. p → r Premise 1 2. q → s Premise 2 3. ¬r ∧ q Premise 3 4. ¬r (3) Simplification 5. q (3) Simplification 6. s (2) and (5) Modus ponens 7. s ∨ r (6) Addition (b) Invalid 1. p → (q → r) Premise 1 2. r → (p → q) Premise 2 3. q Premise 3 When all the premises are true, the outcome ¬ r, is false. (c) Valid 1. (p → (q → (p ∧ q))) Premise 1 2. ¬p ∨ (q → (p ∧ q)) (1) Material Implication 3. ¬p ∨ ¬q ∨ (p) (2) Material Implication 4. ¬p(p) ∨ (p) (3) De Morgan Law 5. (p ∧ q) ∨ ¬(p ∧ q) (4) Commutativity 6. ¬(¬(p ∧ q)) ∨ (¬p ∨ ¬q) (5) Double Negation and Material Implication 7. ¬(¬(p ∧ q)) ∨ (p → ¬q) (6) Material Implication 8. ¬(p ∧ q) → (p → ¬q) (7) Material Implication 5 (d) Valid - P(x): x knows how to program - C(x): x does well in Computer Science - G(x): x has a job guaranteed Domain: Everyone in this class P (x) → C(x) C(x) → G(x) P (x) → G(x) Follows Hypothetical Syllogism 6