Propositional logic, predicates and quantifiers
Connectives, truth tables, laws of logical equivalence, and translating and negating statements with ∀/∃. The first midterm question almost always comes from here.
The language of discrete mathematics is logic. The symbols you learn this week will show up in every proof, every set question and every algorithm for the rest of the semester. The midterm questions on this topic are mechanical: build a truth table, show two statements are equivalent using the laws, translate an English sentence into symbols, negate a statement with quantifiers. There are few rules, but they have to be fully memorized.
Golden rules:
- is false only when is true and is false. All three other rows are true.
- Never change the table order. With 3 variables, : TTTTFFFF, : TTFFTTFF, : TFTFTFTF.
- Use a single law in each step and write its name. The instructor gives marks for the names.
- “All” takes an arrow, “some” takes an and. , .
- When negating, the quantifier flips: , then negate the inside.
Propositions and connectives
Proposition: a declarative sentence that is either true (T) or false (F). “7 is prime” is a proposition (true). "" is a proposition (false). “Close the door” and "" are not propositions: the first is a command, and in the second you cannot say true or false until is known.
You combine propositions with connectives:
| Symbol | Name | When is it true? |
|---|---|---|
| negation (not) | when is false | |
| conjunction (and) | when both are true | |
| disjunction (or, inclusive) | when at least one is true | |
| exclusive or (either … or …) | when exactly one is true | |
| conditional (if … then) | always, except | |
| biconditional (if and only if) | when both have the same value |
| T | T | T | T | F |
| T | F | F | F | T |
| F | T | T | F | T |
| F | F | T | T | F |
Why is the conditional defined this way?
works like a promise. The instructor says “If you hand in the homework, I will give you 10 points.” The instructor has lied in only one case: you handed it in () and did not get the points (). If you did not hand it in (), the instructor has not broken the promise whatever they do, so the statement stays true. This is called “vacuously true”.
PITFALL · If is false, is true. “From a false hypothesis anything follows.” The rows of the table where are automatically T. Knowing this cuts the work in half.
Translation patterns
These are the patterns the exam likes; all of them are expressed with :
| English | Symbol |
|---|---|
| if , then / if / whenever | |
| only if | |
| is sufficient for / is necessary for | |
| unless | (that is, ) |
| if and only if / iff |
“Only if” is the most confused pattern. “You can enter the exam only if you have an ID” = if you entered the exam, you definitely have an ID: “entered” “has ID”. Having an ID does not guarantee entering.
Converse, inverse, contrapositive
For there are three relatives:
- converse:
- inverse:
- contrapositive:
Only the contrapositive is equivalent to the original. The converse and the inverse are equivalent to each other, but not to the original. “If it rains, the ground gets wet” is true. The converse “if the ground is wet, it has rained” can be false (someone spilled water). The contrapositive “if the ground is dry, it has not rained” carries the same information as the original.
Building a truth table
Template:
- Count the variables: with variables there are rows.
- Fill the columns in the standard order (golden rule 2 above).
- Break the expression down from the inside out, with a helper column for each part.
- Look at the last column: all T means tautology, all F means contradiction, mixed means contingency.
Example.
| result | ||||||
|---|---|---|---|---|---|---|
| T | T | T | F | F | T | T |
| T | T | F | T | T | T | T |
| T | F | T | F | F | T | T |
| T | F | F | T | T | F | F |
| F | T | T | F | F | T | T |
| F | T | F | T | F | T | T |
| F | F | T | F | F | T | T |
| F | F | F | T | F | F | T |
The last column has one F and the rest T: contingency. Quick check: the arrow is F only when “left T, right F”. The rows where the left side is T () are only rows 2 and 4; among them, only row 4 has the right side F.
Logical equivalence
and are equivalent if they take the same value in every row: . In other words, is a tautology. You can show it in two ways: a truth table or a chain of laws.
| Law | Formula |
|---|---|
| Conditional | |
| De Morgan | , |
| Double negation | |
| Distributive | , |
| Negation | , |
| Identity | , |
| Domination | , |
| Idempotent | , |
| Commutative, associative | , |
| Absorption | , |
| Biconditional |
Chain strategy: first turn the arrows into with the conditional law, then push the in front of parentheses inward with De Morgan, delete the , and finally distribute and simplify.
Example 1. Show that .
(p → q) ∨ (p → r)
≡ (¬p ∨ q) ∨ (¬p ∨ r) conditional law (twice)
≡ (¬p ∨ ¬p) ∨ (q ∨ r) commutative and associative laws
≡ ¬p ∨ (q ∨ r) idempotent law
≡ p → (q ∨ r) conditional law ∎
Example 2. Show that .
¬(p ∨ ¬q) ∨ (¬p ∧ ¬q)
≡ (¬p ∧ ¬¬q) ∨ (¬p ∧ ¬q) De Morgan's law
≡ (¬p ∧ q) ∨ (¬p ∧ ¬q) double negation law
≡ ¬p ∧ (q ∨ ¬q) distributive law (common ¬p factored out)
≡ ¬p ∧ T negation law
≡ ¬p identity law ∎
TIP · Don’t build a table to show NOT equivalent. Find a single row where the two sides differ. The sentence “For the left side is T and the right side is F” earns full marks.
Predicates and quantifiers
"" is not a proposition, because is not known. This is called a predicate: . Once you give a value it becomes a proposition: is true, is false. The set of values can take is called the domain (domain of discourse). Without a domain, the truth of a quantified statement cannot be determined.
| Statement | Meaning | When is it true? | When is it false? |
|---|---|---|---|
| for every | if every element of the domain satisfies it | if there is a single counterexample | |
| for at least one | if there is a single example | if no element satisfies it |
Over a finite domain, quantifiers are big “and”s and “or”s. If the domain is , then and . That is why negating a quantifier is exactly De Morgan:
If “Everyone passed” is false, it means “there is someone who did not pass”. It does not mean “nobody passed”.
Effect of the domain: is true over the reals () and false over the integers. Quantifiers bind before all connectives except : means .
Translation: arrow or and?
The domain is all people, : ” is an athlete”, : ” is a student”.
| Sentence | Correct | Wrong (why) |
|---|---|---|
| All athletes are students. | : says “everyone is an athlete and a student” | |
| Some athletes are students. | : becomes automatically true because of someone who is not an athlete | |
| No athlete is a student. | ||
| Not all athletes are students. |
The trap in the second row comes from the vacuous truth of the conditional: a single person in the domain who is not an athlete makes true, and the sentence says nothing.
Worked example: negation
“Every student who studies passes.” : studies, : passes.
∀x (S(x) → P(x)) original
¬∀x (S(x) → P(x)) negate
≡ ∃x ¬(S(x) → P(x)) the quantifier flips
≡ ∃x (S(x) ∧ ¬P(x)) ¬(a → b) ≡ a ∧ ¬b
In English: “There is a student who studies but does not pass.” Don’t leave the negation as “Not every student who studies passes”; the question usually asks for “no negation in front of a quantifier”.
Common mistakes
| Wrong idea | The truth |
|---|---|
| If is false, is false | It is true. The arrow is false only for |
| ” only if ” = | |
| ” unless ” = | |
| The converse is equivalent to the original | Only the contrapositive is equivalent |
| ; and swap | |
| ; the quantifier flips too | |
| “Some A are B” = | |
| “All A are B” = | |
| I tried a few examples, so is true | cannot be proved by examples; but a single counterexample breaks it |
| Answering without looking at the domain | The same statement can be true in and false in |
Test yourself
Exam-style questions. Solve them on paper first, then reveal the answer.
Let be true, be false and be true. Find the truth value of .
Show answer
Left side: . Right side: . The arrow is false only for : .
Let : "you can use the gym", : "you are a student", : "you are staff". Write in symbols: "You can use the gym only if you are a student or staff."
Show answer
The pattern "p only if q" means : if you use the gym, you are definitely a student or staff. The conclusion is . Writing the reverse direction () is the classic mistake.
Write the converse and the contrapositive of: "If is divisible by 6, then is even." Which of the two is always equivalent to the original?
Show answer
: "6 divides n", : "n is even". The converse is (the direction flips). The contrapositive is (the direction flips and both parts are negated). Only the contrapositive is equivalent to the original. Here the converse is even false: is even but not divisible by 6.
Construct the truth table of . Is it a tautology, a contradiction or a contingency?
Show answer
The rows are TT, TF, FT, FF. : T, F, T, T. : T, T, F, T. Outer arrow: , , , . The last column is TTFT: it has both T and F, so it is a contingency.
In how many rows of its truth table is true?
Show answer
There are 8 rows. is T only when and differ: the rows TF* and FT* (4 rows). Among these, the ones where is also T are TFT (), FTT, FTF (). In row TFF, . Total: 3 rows.
Using the laws of logic (name each law), show that is a tautology.
Show answer
(conditional law) (double negation) (conditional law) (commutative + associative) (negation law) (domination law). One law per step, with its name.
Are and logically equivalent? Justify.
Show answer
A single row is enough to show they are not equivalent. When , is automatically T. On the other side ; if we choose then . The values differ, so they are not equivalent. (Check: the rows where they differ are FTF and FFF.)
Let be "", the domain being all integers. Find the truth values of and .
Show answer
. satisfies it, so is true (one example is enough). For a single counterexample is enough: for , , so it is false.
The domain is . Determine the truth values of (a) and (b) .
Show answer
(a) It is enough to look at the odd values (for even values the arrow is automatically T): , . All hold, so it is true.
(b) We need one even number whose square is greater than 15: , . True.
Let : " misses practice" and : " is benched", the domain being the players of a team. Express "Every player who misses practice is benched" in logic, then write its negation with no negation sign in front of a quantifier, and say it in English.
Show answer
The pattern "Every ... who ..." needs and an arrow: . Negation: , then . The result is .
Let : " is a student" and : " is lazy", the domain being all people. Express "No student is lazy" in two equivalent ways, one using and one using .
Show answer
"No student is lazy" = "there is no lazy student": . Pushing the negation inside gives . Both say the same thing.
Determine the truth value of when the domain is (a) all real numbers, (b) all integers.
Show answer
(a) Counterexample : is false. One example breaks .
(b) . Over the integers, if both factors are , and if both are ; the product is always . True. Same sentence, different domain, different answer.
Verification: All truth tables, equivalences and quantifier truth values were checked by brute force with node (all rows / finite domain and a scan over -1000..1000) (verify/MAT2033/01.mjs).