Math 240: Discrete Structures I McGill University, Fall 2016 Due 4:30pm Thursday 29 September 2016. Hand in to the mailbox at Burnside 1005. Solutions to homework assignment 1: Propositional Logic Discussing the assignment with other students is allowed (and encouraged!) but you should hand in your own write-up. Only one name per assignment. Please cite the sources you used, including the books and websites you consulted, and the names of the people you collaborated with or who helped you. Late assignments are not accepted. Only your best five out of six homework assignments count. Problem 1 (Truth tables). Use truth tables to decide whether each of the following [10 points] sentences is a tautology, a contradiction, or a contigency. a) (P ⇒ Q) ≡ (¬P ∨ Q) b) (P ⇔ Q) ≡ (P ∧ Q) ∨ (¬P ∧ ¬Q) c) ¬(X ⇒ Y ) ⇒ (Y ⇒ X) d) (¬P ∧ ¬Q) ⇒ (R ⇒ Q) e) Q ∧ (P ⇔ ¬P ∧ Q) Solution. P T a) T F F Q T F T F ¬P F F T T P ⇒Q T F T T P T b) T F F Q T F T F ¬P F F T T ¬Q F T F T ¬P ∨ Q T F T T P ⇔Q T F F T (P ⇒ Q) ≡ (¬P ∨ Q) T Tautology. T T T P ∧Q T F F F ¬P ∧ ¬Q F F F T 1 (P ∧ Q) ∨ (¬P ∧ ¬Q) T F F T (P ⇔ Q) ≡ (P ∧ Q) ∨ (¬P ∧ ¬Q) T Tautology. T T T X T c) T F F Y T F T F X⇒Y T F T T P T T T d) T F F F F Q T T F F T T F F R T F T F T F T F P T e) T F F Q T F T F ¬P F F T T ¬P F F F F T T T T ¬(X ⇒ Y ) F T F F ¬Q F F T T F F T T ¬P ∧ Q F F T F Y ⇒X T T F T ¬P ∧ ¬Q F F F F F F T T ¬(X ⇒ Y ) ⇒ (Y ⇒ X) T Tautology. T T T R⇒Q T T F T T T F T P ⇔ ¬P ∧ Q F F F T (¬P ∧ ¬Q) ⇒ (R ⇒ Q) T T T Contingency. T T T F T Q ∧ (P ⇔ ¬P ∧ Q) F Contradiction. F F F Problem 2 (Rules of logic). Use the rules of logic given in class to prove the equivalences [6 points] listed below. In order to apply the rules we learned, you may rewrite P ⇒ Q as ¬P ∨ Q, and P ⇔ Q as (P ∧ Q) ∨ (¬P ∧ ¬Q). You justified these equivalences in Problem 1. The rules of logic given in class can be found at http://www.math.mcgill.ca/~edecorte/math240/logicrules.pdf a) (X ⇒ Y ) ∨ (X ⇒ Z) ≡ (X ⇒ (Y ∨ Z)) b) (P ⇔ Q) ≡ ((P ⇒ Q) ∧ (¬P ⇒ ¬Q)) c) ¬(P ⇔ Q) ≡ ((P ∧ ¬Q) ∨ (¬P ∧ Q)) 2 Solution. a) (X ⇒ Y ) ∨ (X ⇒ Z) ≡ (¬X ∨ Y ) ∨ (¬X ∨ Z) ≡ ¬X ∨ Y ∨ Z ≡ X ⇒ (Y ∨ Z) b) P ⇔Q ≡ (P ∧ Q) ∨ (¬P ∧ ¬Q) ≡ (P ∨ (¬P ∧ ¬Q)) ∧ (Q ∨ (¬P ∧ ¬Q)) ≡ (P ∨ ¬P ) ∧ (P ∨ ¬Q) ∧ (Q ∨ ¬P ) ∧ (Q ∨ ¬Q) ≡ (P ∨ ¬Q) ∧ (Q ∨ ¬P ) ≡ (¬¬P ∨ ¬Q) ∧ (Q ∨ ¬P ) ≡ (P ⇒ Q) ∧ (¬P ⇒ ¬Q) c) We’ll reuse some of the work from part b). From the third-to-last line in the solution for b) we get ¬(P ⇔ Q) ≡ ¬((P ∨ ¬Q) ∧ (Q ∨ ¬P )) ≡ ¬(P ∨ ¬Q) ∨ ¬(Q ∨ ¬P ) ≡ (¬P ∧ Q) ∨ (¬Q ∧ P ), by two applications of DeMorgan’s law. Problem 3 (Symbolization). Write the following English sentences in logic symbols, [8 points] using the atoms provided. a) I only leave my door open when I’m in my office. [D: I leave my door open; M: I’m in my office] b) Neither Peter nor Jake has his driver’s licence. [P: Peter has his driver’s licence; J: Jake has his driver’s licence] c) Alice is not drinking beer underage. [B: Alice is drinking beer; Q: Alice is at least 18] (Note: legal drinking age is 18.) 3 d) 2 + 2 = 4, even if my heart would break. [A: 2 + 2 = 4; B: my heart would break] Solution. a) b) c) d) D⇒M ¬P ∧ ¬J B⇒Q A Problem 4 (Converse and contrapositive). For each of the following implications, write [6 points] both the converse and the contrapositive in English. a) If Susan is a sophomore, then she needs to take Math 240. b) The only way to succeed is to keep trying. c) You can only graduate if you have paid your library fines. Solution. a) Converse: If Susan needs to take Math 240, then she is a sophomore. Contrapositive: If Susan does not need to take Math 240, then she is not a sophomore. b) Converse: If you keep trying, then you will succeed. Contrapositive: If you don’t keep trying, then you won’t succeed. c) Converse: If you have paid your library fines, then you can graduate. Contrapositive: If you have not paid your library fines, then you cannot graduate. Problem 5 (Venn diagrams). Draw Venn diagrams to show that A \ B is not necessarily [4 points] the same as B \ A. Solution. A B A A \ B (left) and B \ A (right) 4 B Problem 6 (Knights and knaves). The island of knights and knaves has just two kinds [6 points] of inhabitants; knights who only make true statements, and knaves who only make false ones. On the island of knights and knaves, you encounter three inhabitants, A, B, and C. A says, “If I’m a knight then at least one of us is a knave.” Can we determine the nature of A? (I.e. whether he is a knight or a knave.) Justify your answer either with truth tables, or the rules of logic, or a combination of both. Solution. Let’s start by defining three atoms so that we can symbolize what the inhabitants say. P : A is a knight. Q : B is a knight. R : C is a knight. Using these atoms, one can symbolize “One of us is a knave,” by ¬P ∨ ¬Q ∨ ¬R. So what A has said can be symbolized as P ⇒ (¬P ∨ ¬Q ∨ ¬R). A priori we don’t know whether what A said is true, since we don’t know whether he is a knight or a knave. What we do know is that anything A says is true if and only if he is a knight. Therefore, we know the sentence P ⇔ (P ⇒ (¬P ∨ ¬Q ∨ ¬R)) (1) is true. Some truth assignments to the atoms P, Q, R will make this sentence true, and some will make it false. We want to find out which ones make it true. One way to do this is with the rules of logic: P ⇔ (P ⇒ (¬P ∨ ¬Q ∨ ¬R)) ≡ (P ∧ (P ⇒ (¬P ∨ ¬Q ∨ ¬R))) ∨ (¬P ∧ ¬(P ⇒ (¬P ∨ ¬Q ∨ ¬R))) ≡ (P ∧ (P ⇒ (¬P ∨ ¬Q ∨ ¬R))) ∨ (¬P ∧ (P ∧ ¬(¬P ∨ ¬Q ∨ ¬R))) The second clause in the disjunction contains ¬P and P as conjuncts, so we see right away that it is false. Therefore, by domination, the last sentence is equivalent to its first clause, which is in turn equivalent to P ∧ (¬P ∨ (¬P ∨ ¬Q ∨ ¬R)) ≡ P ∧ (¬P ∨ ¬Q ∨ ¬R) Applying distributivity, complementarity, and domination shows the last sentence is equivalent to simply P ∧ (¬Q ∨ ¬R). 5 (2) This tells us that P must be true in order for (1) to be true. So A is a knight. [From (2), we can also see that at least one of B and C must be a knave.] Problem 7 (Thinking). Let us introduce a new logical connective ↓, which we define [10 points] with the following truth table. P T T F F P ↓Q F F F T Q T F T F Argue that any statement in propositional logic (written with the connectives ∧, ∨, ¬, ⇒, ⇔, which we’ve already met), may be rewritten as a logically equivalent sentence with no connectives except ↓. For instance, X ⇒ (¬X ∨ Y ) may be rewritten ((X ↓ X) ↓ Y ) ↓ ((X ↓ X) ↓ Y ). Solution. It suffices to show that each of the five connectives we’ve met can be rewritten in terms of ↓ only. Since we already know how to rewrite ⇒ and ⇔ in terms of ¬, ∨, and ∧, we’ll just deal with ¬, ∨, and ∧. One can show with a truth table that P ↓ Q is equivalent to ¬(P ∨ Q). From this equivalence we see immediately that P ↓ P ≡ ¬P . That takes care of ¬. For ∨, just notice that P ∨ Q ≡ ¬(¬(P ∨ Q)) ≡ ¬(P ↓ Q). Now we reuse the work we already did for ¬: ¬(P ↓ Q) ≡ (P ↓ Q) ↓ (P ↓ Q). For ∧, notice that by double negation and DeMorgan, we have P ∧ Q ≡ ¬¬P ∧ ¬¬Q ≡ ¬(¬P ∨ ¬Q) ≡ (¬P ) ↓ (¬Q). Again reusing the work we did for ¬, we see that this is equivalent to (P ↓ P ) ↓ (Q ↓ Q). Here’s a summary: ¬P ≡ P ↓ P P ∨ Q ≡ (P ↓ Q) ↓ (P ↓ Q) P ∧ Q ≡ (P ↓ P ) ↓ (Q ↓ Q). 6
© Copyright 2026 Paperzz