Statements: negation, conjunction and disjunction
A statement is a declarative sentence that is true or false; a question, a command or a personal opinion (“this colour is nice”) is not a statement. Statements are named p, q, r, and the truth values are written T (true) and F (false). The negation ¬p (“not p”) is false when p is true and true when p is false. The conjunction p ∧ q (“p and q”) is true only when both statements are true; the disjunction p ∨ q (“p or q”) is true when at least one is true and false only when both are false. If a statement depends on a variable x, the set of x that make it true is its truth set: if P is the truth set of p, then ¬p has P′, p ∧ q has P ∩ Q and p ∨ q has P ∪ Q.
| p | q | ¬p | p ∧ q | p ∨ q |
|---|---|---|---|---|
| T | T | F | T | T |
| T | F | F | F | T |
| F | T | T | F | T |
| F | F | T | F | F |
An app gives two ways to reset a password: it is enough that the e-mail OR the phone number is correct. To log in, the user name AND the password must both be correct. So a right name with a wrong password is refused, while a reset works even if only one detail is right.
Programmers write conditions with “and”, “or” and “not”, electronics engineers design logic circuits, and lawyers read the difference between “and” and “or” in a contract exactly.
Find three rules from school life (for example “a mark is given if the homework is done AND the notebook is brought”). For each rule write the four cases in a table (both true, only the first true, only the second true, neither true) and decide when the rule is met.
“True or false?” game: the teacher states two statements (for example “8 is even” and “8 is prime”); students call out T or F for the statement formed with “and”, “or”, “not”. Whoever errs sits out.