Assignment 1 Sol
Assignment 1 Sol
COMP 1805
A SSIGNMENT 1
(d) This statement is not a implication but a conjunction (where but is used in the place of and). So our propositions are p is I like shing and q is I like hunting, so our compound proposition is p q. We use De Morgans law to gure out the negation of this statement: (p q) p q p q
Which we read as I do not like shing or I like hunting. 3. (3 marks) Let a be the proposition It is summer, b be the proposition I go to the cottage, and c the proposition I study Discrete Math. Express the following compound propositional statements as English sentences. (a) b a Solution (1 mark): I will go to the cottage if and only if it is summer. (b) a (b c) Solution (1 mark): If it is summer then I will go to the cottage and study Discrete Math1 (c) (b c) a Solution (1 mark): I will not go to the cottage or I will not study Discrete Math, and it is summer. Alternately using De Morgans law you could say It is not the case that I will go to the cottage and study discrete math, and it is summer. (This is (b c) a. 4. (2 marks) Determine whether or not the associative law holds for (exclusive or). Marks: 2 marks. They can show this by other methods other than a truth table. Solution: We use a truth table to demonstrate that the associative law applies for exclusive or. a T T T T F F F F b T T F F T T F F c T F T F T F T F (a b) c T F F T F T T F a (b c) T F F T F T T F
Therefore, since the truth values in the columns for (a b) c and a (b c) are identical for all combinations of the input variables, the associative law applies for exclusive or. 5. (5 marks) Translate the following English statements into propositional logic. Dene the propositions you will use. Your base propositions should not be negative or compound propositions themselves. Use brakcets when necessary to make the order of evaluation clear. (a) If I study Discrete Math and Linear Algebra then I will get good grades. Solution (1 mark): p: I study Discrete Math q: I study Linear Algebra r: I will get good grades Statement is (p q) r.
1 What
fun!
COMP 1805
A SSIGNMENT 1
(b) The sky is blue or the earth is round. Solution (1 mark): b: The sky is blue. r: The earth is round. Statement is b r. (c) It is Monday and I am not at work. Solution (1 mark): m: It is Monday. w: I am at work. Statement is m w. (d) I will live to be 100 years old iff I excercise every day and I eat well. Solution (1 mark): p: I will live to be 100 years old. q: I exercise every day. r: I eat well. Statement is p (q r). (e) I miss the bus if I sleep in. Solution (1 mark): p: I miss the bus. q: I sleep in. Statement is q p. 6. (2 marks) Consider the implication If the stock market is up then I will invest my money. For each of the following cases state if this implication is true, and why. (a) The market is down and I do not invest my money. Solution (1/2 mark): True, market is down so the hypothesis of our implication is False and therefore the implication is true regardless of what the value of the conclusion is. (b) The market is up and I do not invest my money. Solution (1/2 mark): False, market is up so the hypothesis of our implication is True and therefore the conclusion must be true in order that the implication be true. However, in this case the conclusion is false since I did not invest. (c) The market is down and I invest my money. Solution (1/2 mark): True, market is down so the hypothesis of our implication is False and therefore the implication is true regardless of what the value of the conclusion is. (d) The market is up and I invest my money. Solution (1/2 mark): True, the hypothesis and conclusion are both true, so the implication is true. 7. (10 marks) Determine if the following are tautologies, contradictions or contingencies. Use a truth table or logical equivalences as indicated. (a) (a b) (a b) (use a truth table). Solution (2 marks): This is a tautology.
COMP 1805
A SSIGNMENT 1 a T T F F b T F T F ab T F F F ab T T T F (a b) (a b) T T T T
(b) (a b) (a b) (use logical equivalences ). Solution (2 marks): The expression is a contradiction. (a b) (a b) (a b) (a b) (a b) (a b) F De Morgans Law Double Negation Law Negation Law
Therefore, the expression is logically equivalent to F and is thus a contradiction. (c) (c b) (c b) (use logical equivalences ). Solution (2 marks): The expression is a contradiction. (c b) (c b) (b c) (c b) (b c) (b c) (b c) (b c) F Contrapositive Commutative Implication Equivalence Negation Law
Therefore, the expression is logically equivalent to F and is thus a contradiction (d) (a b) ((a b) (a b)) (use a truth table) Solution (2 marks): This is a contingency. Let X = a b, Y = a b and Z = (a b). The statement is thus X (Y Z). a T T F F b T F T F a F F T T b F T F T X F T T T Y T T T F Z F F T F Y Z F F T F X (Y Z) T F T F
(e) Use logical equivalences to show that the rule of inference, modus ponens is a tautology. The rule is expressed as: [p (p q)] q. Solution (2 marks): There may be shorter ways to arrive at this, but the following works: [p (p q)] q [p (p q)] q [p (p q)] q [p (p q)] q [p (p q)] q [p (p q)] q [(p p) (p q)] q [T (p q)] q (p q) q p (q q) p T T Implication Equivalence De Morgans Implication Equivalence De Morgans Double Negation Distributive Law Negation Law Identity Law Associative Law Negation Law Domination
COMP 1805
A SSIGNMENT 1
8. 2 marks Translate the following statements into English where W (x) is x has wings, F (x) is x can y, and Q(x) is x quacks, and the domain is all animals. (a) x(W (x) F (x)). Solution (1 mark): There exists an animal with wings that cannot y. (b) x [(W (x) Q(x)) F (x)]. Solution (1 mark): All animals that have wings and quack can y. 9. 2 marks Give the negation of the following statement. The negation symbols should proceed the predicates. xyz [A(x, y) (B(x, y) C(x, y))] Solution (1 mark): xyz [A(x, y) (B(x, y) C(x, y))] xyz [A(x, y) (B(x, y) C(x, y))] xyz [A(x, y) B(x, y) C(x, y)] xyz [A(x, y) B(x, y) C(x, y)]
10. 6 marks Let H(x) be x plays hockey, S(x) be x can skate, D(x) be x can dance and E(x) be x earns money. The universe of discourse is all humans. State the following logically. (a) Everyone that can skate and dance earns money. Solution (2 marks): x(S(x) D(x) E(x)) (b) At most two people can play hockey and dance. Solution (2 marks): (xyz((H(x) D(x)) (H(y) D(y)) (H(z) D(z)) (x = y) (y = z) (x = z)). By applying DeMorgans Law, we see that this is equivalent to all the following statements: i. x(yz((H(x) D(x)) (H(y) D(y)) (H(z) D(z)) (x = y) (y = z) (x = z))). ii. xy(z((H(x) D(x)) (H(y) D(y)) (H(z) D(z)) (x = y) (y = z) (x = z))). iii. xyz((H(x) D(x)) (H(y) D(y)) (H(z) D(z)) (x = y) (y = z) (x = z))). (c) Not everyone who plays hockey earns money. Solution (2 marks): (x(H(x) E(x))). By DeMorgans, we see that this is also equivalent to x(H(x) E(x))