Propositional Logic for Beginners: Truth Tables, Validity and Proofs
Learn the five logical connectives, build truth tables, test arguments for validity with counterexamples and write a short formal proof line by line.

Propositional Logic for Beginners: Truth Tables, Validity and Proofs
Propositional logic is the grammar of reasoning. It strips an argument down to statements that are either true or false, joined by a handful of connectives, and then asks a precise question: does the conclusion really follow? Students meet it in discrete mathematics, philosophy and computer science, and the core skills are the same everywhere: reading connectives, building truth tables, judging validity and writing formal proofs.
The five connectives
Let p and q stand for statements such as "it is raining" and "the match is cancelled".
- Not, written ¬p: true exactly when p is false.
- And, written p ∧ q: true only when both parts are true.
- Or, written p ∨ q: true when at least one part is true. This is inclusive, so both being true still counts.
- If-then, written p → q: false in only one case, when p is true and q is false.
- If and only if, written p ↔ q: true when p and q have the same truth value.
The conditional causes the most trouble. When p is false, p → q is automatically true; a promise "if you pass, I will buy you lunch" is not broken by someone who failed.
Building a truth table
With n letters there are 2^n rows, because each letter can be true or false. Two letters need 4 rows, three need 8, four need 16. List them systematically: the first column alternates in blocks of half the rows, the next in blocks of a quarter, and so on, so no combination is missed.
Add a column for each sub-formula, working from the inside out. A formula that is true in every row is a tautology; one that is false in every row is a contradiction.
A quick exercise: build columns for p → q, ¬p ∨ q and ¬q → ¬p. All three columns come out identical, which shows that a conditional, its "or" form and its contrapositive are logically equivalent. The converse, q → p, does not match.
Validity and counterexamples
An argument is valid when there is no row in which every premise is true and the conclusion is false. To test one:
- Build the truth table for all the premises and the conclusion.
- Mark the critical rows, where every premise is true.
- If the conclusion is true in all of them, the argument is valid. If any critical row has a false conclusion, that row is a counterexample.
Consider "if p then q; not p; therefore not q". This is called denying the antecedent. In the row where p is false and q is true, both premises hold but the conclusion ¬q is false. One counterexample is enough: the argument is invalid.
Worked example: a formal proof
Premises:
- p → q
- ¬q
- p ∨ r
- r → s
Conclusion to reach: s.
- ¬p, by modus tollens from lines 1 and 2. If p led to q and q is false, p must be false.
- r, by disjunctive syllogism from lines 3 and 5. One of p or r is true, and it is not p.
- s, by modus ponens from lines 4 and 6.
Each new line cites a rule and the earlier lines it uses. As a cross-check, a 16-row truth table for p, q, r and s has exactly one row where all four premises are true: p false, q false, r true, s true. In that row s is true, so the argument is valid, as the proof claimed.
Rules worth knowing by name
- Modus ponens: from p → q and p, infer q.
- Modus tollens: from p → q and ¬q, infer ¬p.
- Hypothetical syllogism: from p → q and q → r, infer p → r.
- Disjunctive syllogism: from p ∨ q and ¬p, infer q.
- Conjunction, simplification and addition handle building and splitting "and" and "or" statements.
- Replacement rules such as De Morgan's laws, ¬(p ∧ q) ≡ ¬p ∨ ¬q, let you rewrite a line in an equivalent form.
Common mistakes
- Affirming the consequent: from p → q and q, concluding p. It looks like modus ponens but is invalid.
- Treating "or" as exclusive.
- Confusing a valid argument with a true conclusion. Validity is about the link between premises and conclusion, not about whether the premises are actually true.
- Citing the wrong lines, or applying a rule to part of a line when the rule needs the whole line.
- Writing too few truth-table rows.
Checking your answer
For a proof, the strongest check is a truth table: if it shows the argument is invalid, no correct proof can exist and a step must be wrong. For a counterexample, plug the truth values back into each premise and the conclusion separately. For an equivalence, compare the two final columns row by row.
Doing it with the tool
The logic propositions and proof checker has four tabs. The truth table tab evaluates any formula and labels it a tautology, contradiction or neither. The validity tab highlights the critical rows and shows a counterexample when one exists. The equivalence tab compares two formulas row by row. The proof checker lets you enter the four premises above and add lines 5 to 7 with their rules and cited lines, marking each line as correct or not and announcing when the conclusion is reached.
Limits
Only propositional logic is covered, so quantifiers such as "for all" and "there exists" are not handled. Replacement steps are accepted whenever the new line is equivalent, which is more lenient than courses that demand the exact named law. Truth tables with many letters become slow. It is a study aid for practice and checking, not a marking scheme.


