Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools

Truth Table or Laws of Logic: Which Should I Use?

A truth table checks a formula row by row and always works, but it doubles in size with every new letter. The laws of logic rewrite a formula without any rows and scale to any size. Name the task first, then count the letters.

When to use this

You have a propositional formula and are not sure whether to tabulate it or transform it: "is ((P∨Q)∧¬P)→Q((P \lor Q) \land \neg P) \to Q a tautology", "show P→(Q→R)≡(P∧Q)→RP \to (Q \to R) \equiv (P \land Q) \to R", "write ¬(P→Q)∨R\neg(P \to Q) \lor R in CNF". Test: say what the answer looks like (a column, a yes or no, a new formula) and count the letters nn; a table has 2n2^n rows.
Truth tables and the laws, as two ways to verify an equivalence, are compared in the equivalences lesson.

Decision tree

values in every rowalways true or false?two formulas equal?3 or fewer4 or morea new formCNF or DNFshortest formdeny an if-thenWhat does the questionask for?Truth table →Tautology check →How many letters intotal?Compare columns →Chain of laws →Which form?Normal form →Simplify →Negate if-then →

The same tree, written out

  1. 1You need the value of a formula in every case, or the cases where it is true. Build a table: it lists all 2n2^n assignments, and with up to three letters it is quick. Use building a truth table; tables are introduced on the truth tables page.
  2. 2You must decide whether a formula is always true or always false. With up to three letters, check every row: use checking for a tautology or checking for a contradiction. With four or more, simplify with the laws until you reach ⊤\top or ⊥\bot. Both terms are defined in what is a tautology.
  3. 3You must decide whether two formulas with at most three letters in total are equivalent. Compare the columns: a table answers both yes and no, and a mismatched row is a ready counterexample. Use proving equivalence with a truth table, based on biconditionals and logical equivalence.
  4. 4You must prove an equivalence with four or more letters, or the question says to use the laws. Rewrite one side into the other with named laws, since a table would need 16 rows or more. Use proving an equivalence with the laws together with the laws reference.
  5. 5You must write a formula in conjunctive or disjunctive normal form. Use the laws for a short form, or read the canonical form off the truth table when there are few letters. Use converting to CNF or converting to DNF; both forms are explained with the normal forms converter.
  6. 6You must simplify a formula or write it in its shortest form. Use the laws in a fixed order: arrows, negations, distribution, collapse. Use simplifying a logical expression, then check the result with a table; the laws are listed in the laws reference.
  7. 7You must negate an if-then statement or say what would make it false. No table is needed: the negation of P→QP \to Q is always P∧¬QP \land \neg Q, by the negation of a conditional. Use negating a conditional; for the converse, inverse and contrapositive, use writing the related conditionals.