Truth table
Type a proposition and get its truth table column by column, from the inside out, as you would on paper. It tells you whether it is a tautology, a contradiction or a contingency, puts two propositions side by side to see whether they are equivalent and, row by row, where they differ, and gives its disjunctive and conjunctive normal forms. It runs in your browser, on your phone too.
How to use it
- Start with «The alarm rule»: (p ∨ q) ∧ r, the rule of a home alarm, column by column.
- Go on with «Implication as a promise» (why p → q is T when p is F), «An 8-row tautology», «De Morgan, checked», «Converse and contrapositive» and «From the table to the formula».
- In «Your proposition» type your own with the symbol buttons or the keyboard:
->is →,<->is ↔,&is ∧,|is ∨,!is ¬ andxoris ⊕. If you type a second one, it compares them. - Press «Explain it slowly» at any step to see the rule on paper and the Python code that does the same.
What it works out
The 2ⁿ rows (up to 5 variables, 32 rows) in the usual order: the first variable alternates every 2ⁿ⁻¹ rows and starts with T. One column for each subformula, from the innermost to the last one, the classification from the last column, the rows where two propositions differ and the normal forms: the DNF with one minterm for each T row and the CNF with one maxterm for each F row.
The rules it follows
- The usual precedence: ¬ before ∧, ∧ before ∨ (and ⊕), ∨ before →, and → before ↔. → and ↔ associate to the right: p → q → r is p → (q → r). If in doubt, add brackets: the simulator shows the formula with the ones it has understood.
- Variables are lowercase letters; T and F (or 1 and 0) are the constants.
- A tautology has no CNF (there are no F rows) and a contradiction has no DNF (there are no T rows): it tells you so instead of making one up.
For the exam
The problems exam asks you to work out a truth table by hand: how many rows it has, in what order they go and each intermediate column before the last one. The challenge below asks for new last columns, classifications and equivalences every time, from topics 1 and 2.
