CHAPTER 3 REASONING AND PROOF. TRUTH TABLES. 3.1 Using the tables of truth Logical variables – they take the value TRUE (T) or FALSE (F) Basic logical operations: NOT (for example, NOT A): true if Ais false, and false if A is true AND (for example, A AND B): true if both A, B are true, and false otherwise OR (for example, A OR B): true if at least one of A, B is true, and false otherwise. We also call it ”inclusive or” XOR (for example, A XOR B): true only when A is different from B, that is A is true and B false, or A is false and B is true. This is called ”exclusive or”. Truth tables: For any logical formula with a number n of variables A, B, C, ..., we can always list all possible combinations (which are 2n ), and, for each such row, give the truth value of our formula. The above basic logical operations have the following truth tables. A T F NOT A F T A T T F F B T F T F A AND B T F F F A T T F F B T F T F A OR B T T T F A T T F F B T F T F A XOR B F T T F When we encounter two complicated logical formulas, one way to find out whether they are equivalent (which means they always give the same answer) is to write their complete truth tables and compare them. If the tables coincide, then the formulas are equivalent (and of course, if they are equivalent, their tables must coincide). We can thus use these formulas to solve problems from the homework with knights and knaves. 1. You are in a maze on the island of Knights and Knaves. There are two doors: you know that one leads to freedom and one leads to certain doom. There are two guards nearby, and you happen to know that one is a knight and one is a knave, but you don’t know who is who. They allow you to ask one of them a single question before you choose a door – what do you ask ? 1 The question cannot be direct, so we have to construct one. One can just use truth tables to find a truth assignment to the variables that makes the desired statement true. There are ways of forcing a constant liar to tell the truth. One of it is to ask him to tell a lie about a lie he already said. Let us investigate in detail: ”What would the other person say, if I asked him where this door leads?” ”Is there a knight standing at the freedom door?” Can we reformulate those questions for another variant of this problem in which we only have one person to ask? 2. On the island of Knights and Knaves you come to a fork in the road. You know that one of the roads leads to the capital, but you do not know which one. However, there is a man at the crossroads. Can you find out which road leads to the capital by asking him one question that can be answered by ”yes” or ”no” ? 3.2 Logic Laws We can combine logic operations, creating more complicated expressions when we try to negate compound statements. Can you negate these compound statements: ”I have a dog and a cat.”, ”I enjoy walking, or kayaking.” Remember negation does not mean opposite, ”hot v. cold”. A logical negation is : ”hot v. not hot”. 1. Prove using truth tables that NOT (A AND B) is the same as ( NOT A) OR ( NOT B) Another set of statements more difficult to negate are conditional statement. To negate them means to negate their relationship. For example, negate this statements: ”All Long Islanders know how to swim.”, ”Sometimes, when the weather is too warm, a hurricane can reach up to New York.” One more logical operation is ” → ”(reads ”implies”), or ”if A then B”, described by the following truth table: A T T F F B T F T F A→B T F T T 1. A mom tells the son ”if you do not do the dishes, you will not go to the movie”. Is it the same as ”If you do the dishes, you go to the movie” ? Find the real equivalent statement. Hint: Think of an implication being true as testing if a set is included in another (in a Venn diagram). ”if you do not do the dishes, you will not go to the movie”, means that if you take a case in which you do not do the dishes you are surely not going to the movie. So, the set containing the cases in which you go to the movie is contained in the one of doing the dishes. So the true equivalent phrase is : if you go to the movie, you surely did the dishes. Doing to the dishes is a necessary, but not sufficient condition. 2. Carl, an inhabitant of the island of knights and knaves tells you ” if Sue is a knave, then this road leads to the capital.” Later you learn that Carl is a knave. What does it tell you about the road? 3. Prove that A → B is the same as ( NOT B) → ( NOT A) 2 3.3 Homework: 1. Check whether A → B and B → A are equivalent, by writing the truth table for each of them. 2. Recall that A XOR B is true if exactly one of A, B is true, and false otherwise. Can you write an equivalent formula for XOR using only AND , OR , and NOT 3. Check if the formulas A AND(B OR C) and (A AND B) OR C (hint: there will be 8 rows in the truth table) are equivalent(i.e., their truth tables are identical ) 4. The waiter in a restaurant tells you: ”our fixed price dinner includes soup and appetizer or salad.” Denote by A=your dinner will include soup B=your dinner will include appetizer C=your dinner will include salad What would be the correct way to write his statement using letters A, B, C and logical operations AND, OR? 5. A palindrome is a natural number which reads the same forward and backward, like 1221 or 12321. How many 4-digit palindromes are there? 6. At a dance contest, each boy danced with exactly five girls and each girl danced with exactly 4 boys. Eight boys were registered to dance. How many girls competed? 7. In an office 90 switches are connected in such a way that each switch is connected to 7 computers. How many connections were necessary? 8.∗ One more Lewis Carol’s puzzle: All hummingbirds are richly colored. No large birds live on honey. Birds that do not live on honey are dull in color. Therefore · · · . 9.∗ On the island next to he island of knights and knaves there are 3 kinds of people: knights, who always tell the truth, knaves, who always lie and normal people, who sometimes lie and sometimes tell the truth . On that island, you meet 3 people, A, B, and C. One of them is a knight, one a knave, and one normal (but not necessarily in that order). They make the following statements: A: I am normal B: That is true C: I am not normal What are A, B, and C? 10.∗ Jason enters six races: biking, canoeing, horseback riding, ice skating, running, and swimming. He places between first and fifth in each. Two places are consecutive only if the place numbers are consecutive. Jason’s places in canoeing and running are consecutive. His places in ice skating and swimming are consecutive. He places higher in biking than in horseback riding. He places higher in canoeing than in running. If Jason places higher in running than in biking and places higher in biking than in ice skating and swimming, which one of the following allows all six of his race rankings to be determined? (a) (b) (c) (d) (e) He He He He He places places places places places fourth in fourth in the same the same higher in horseback riding. ice skating. in both horseback riding and ice skating. in both horseback riding and swimming. horseback riding than in swimming. 3
© Copyright 2026 Paperzz