Exercise 1: Logical connectives and truth tables
A proposition is a statement that is either true (1) or false (0), never both. Connectives are defined solely by their truth tables: the table, not your intuition about everyday language, tells you what an expression is worth.
| 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 0 | 1 | 0 | 1 | 1 |
| 0 | 0 | 0 | 0 | 1 |
- a) Build the complete truth table of .
- b) On which row, and on that row alone, is the implication false? Translate that row into plain English with the example: “if the file exists, then the read succeeds”.
- c) Build the table of the exclusive or , then that of . What do you conclude?
- d) How many rows does the truth table of five propositions have? How many distinct Boolean functions of two variables are there?
Show the solution
Answers
- a) is and is : true on the single row ,
- b) The row , : the promise is broken only if the file exists and the read fails
- c) Both columns are : and are the same function
- d) rows and Boolean functions of two variables
inverts the column of , then apply AND, which equals 1 only when both columns equal 1. Rows in the order : is and is . The expression is therefore true only on the row , . That is exactly the row where is false, and it is no coincidence: is the negation of .
A single row: and . An implication is false only when the premise is true and the conclusion is false. In the example, the promise “if the file exists, then the read succeeds” is broken only when the file really does exist and the read fails anyway. If the file does not exist, the promise is never tested, and we declare it kept: the last two rows equal 1. This is the point students resist the longest, because the “if” of everyday language carries an idea of cause that the logical does not have.
equals 1 when the two values differ: on the four rows. equals 1 when they are equal, that is , so its negation is . The two columns are identical: and are the same Boolean function. Two expressions are equivalent exactly when their tables agree row by row, and this is the only proof of equivalence that requires no trick.
With propositions, each proposition takes 2 values independently of the others: the table has rows, so rows for five propositions. To count the functions of two variables, notice that a function is entirely determined by the column of outputs it produces, that is 4 cells to fill with 0 or 1: there are Boolean functions of two variables. They all have a name: AND, OR, XOR, NAND, NOR, the implication, the two constants, and so on. Classic pitfall: answering 4 by confusing the number of rows with the number of functions.
Tick the exercises you have done or want to review: a free account, no password, keeps your ticks and your right answers from one visit to the next, tells you which chapter to tackle next and lets you ask for the exercise you are missing. Create your space, an email is enough.