Check two rules against every input pair
Quick review (2 minutes)
A resident reads two proposed rules for deciding whether there is no parcel at either door.
Compare the two final rule answers on the same row. If every row matches, the rules are equivalent. If any row differs, record that input pair as a counterexample.
Write the four input pairs in order. Leave the result and comparison cells blank.
In the first row, find
A OR B. Flip that result and record it underNOT (A OR B).In the same row, flip
Ato getNOT Aand flipBto getNOT B. UseORon those two values to fill(NOT A) OR (NOT B).Compare the answers under
NOT (A OR B)and(NOT A) OR (NOT B). Mark the rowmatchormismatch.Repeat the calculation and comparison for the remaining rows. Finish the fourth row even if you have already found a counterexample.
Two matches can look like proof that the rules are equivalent. If you check only false/false and true/true, you miss the mixed rows, where one input is true and the other is false. Each mixed row makes the rules disagree.
1 In plain words
A resident reads two proposed rules for deciding whether there is no parcel at either door. The first says, “Both doors are empty.” The second says, “At least one door is empty.” Picture a parcel at the front door and an empty side door. The first rule says no and the second says yes.
Let A stand for “a parcel is present at the front door” and B for “a parcel is present at the side door.” An input is a value you start with. Each input here is Boolean, meaning its value is either true or false. Write true for a door with a parcel and false for an empty door. Write A first in each pair, then B.
Keep two moves beside your table. Inclusive OR gives true when one or both of the values it joins are true. It gives false when both are false. NOT flips one value. It turns true into false and false into true.
Parentheses group parts of a rule. On paper, work out each group before using its result. Read NOT (A OR B) as “flip the answer to A OR B.” Read (NOT A) OR (NOT B) as “flip each input, then join the flipped values with OR.”
Treat each row as a snapshot. Assume you know both door states and they stay fixed while you work. The table records presence only, so it leaves out parcel counts, uncertain observations and changes over time.
On paper, start with the A and B columns filled and the other cells blank. From top to bottom, the pairs are false/false, false/true, true/false, true/true. The slash separates the two values. Stop when you have written and compared the two rule answers in the fourth row.
2 Picture it
For false/false, both rules give true. For false/true and true/false, Rule 1 gives false and Rule 2 gives true. Those two rows are marked. For true/true, both rules give false.
3 Why
Hold A at false and try both values of B. Then hold A at true and try both values of B again. Those four rows cover every allowed pair because each input has exactly two possible values.
Two rules are equivalent when they give the same answer on every allowed pair. A pair that makes their answers differ is a counterexample. One such pair settles the question because equivalence requires a match on every row.
4 The rule
Compare the two final rule answers on the same row.
If every row matches, the rules are equivalent. If any row differs, record that input pair as a counterexample.
5 How
- Write the four input pairs in order. Leave the result and comparison cells blank.
- In the first row, find
A OR B. Flip that result and record it underNOT (A OR B). - In the same row, flip
Ato getNOT Aand flipBto getNOT B. UseORon those two values to fill(NOT A) OR (NOT B). - Compare the answers under
NOT (A OR B)and(NOT A) OR (NOT B). Mark the rowmatchormismatch. - Repeat the calculation and comparison for the remaining rows. Finish the fourth row even if you have already found a counterexample.
6 Trace
| A | B | NOT (A OR B) | (NOT A) OR (NOT B) | Explanation |
|---|---|---|---|---|
| false | false | true | true | Both doors are empty. Both rules give true. |
| false | true | false | true | One parcel makes A OR B true. One empty door makes the OR of the flipped inputs true. |
| true | false | false | true | The same disagreement occurs with the parcel at the other door. |
| true | true | false | false | Neither door is empty. The number of empty doors across the rows is 2, 1, 1, 0. |
7 The trap
Two matches can look like proof that the rules are equivalent. If you check only false/false and true/true, you miss the mixed rows, where one input is true and the other is false. Each mixed row makes the rules disagree.
Quick checks
Quick check 1 of 2
A resident checks false/false and true/true. The rule answers match both times. Which pairs still need checking, and what does each rule give on those pairs?
Show the steps and the answer
The unchecked pairs are false/true and true/false. Each gives false for NOT (A OR B) and true for (NOT A) OR (NOT B).
Why: Each remaining pair has one door with a parcel and one empty door. The first rule needs two empty doors. One empty door satisfies the second rule.
Source: Python Software Foundation, Built-in Types, Boolean Operations (Python 3.13)
Quick check 2 of 2
A classroom checks for a marker in each of two cups. A means a marker is present in the red cup and B means a marker is present in the blue cup. With A true and B false, what do NOT (A OR B) and (NOT A) OR (NOT B) give?
Show the steps and the answer
NOT (A OR B) gives false. (NOT A) OR (NOT B) gives true.
Why: A OR B is true, so flipping it gives false. NOT A is false and NOT B is true, so joining them with OR gives true.
Source: Python Software Foundation, Built-in Types, Boolean Operations (Python 3.13)
Sources
- Built-in Types, Boolean Operations (Python 3.13). Python Software Foundation. Python Software Foundation License Version 2. Read 26 Nov 2026.