How this instrument works
Logical OR takes two statements that are each true or false and returns true unless both are false — three of the four rows in its truth table come out true, and only 0 OR 0 fails. Written with 1 for true and 0 for false, plain addition almost captures this: 1+0=1, 0+1=1, 0+0=0 all land correctly. The one row that breaks is 1+1, which sums to 2, a value with no meaning inside the {0,1} world. The fix is a single correction term, AB, subtracted to pull that one overcounted row back down: A OR B = A + B − AB.
That correction is not a special trick invented for logic gates; it is inclusion-exclusion, the same principle that gives the size of a union of two overlapping sets as |X| + |Y| − |X ∩ Y|. Picture A and B as two circles in a Venn diagram: adding their areas counts the lens-shaped overlap twice, so the overlap gets subtracted back out once. For 0/1 inputs the product AB is exactly that overlap — it equals 1 only in the one case where both circles are 'occupied' at once — so the identity is inclusion-exclusion wearing Boolean notation.
Stack a third term onto the identity and a genuinely surprising pattern appears: A OR B OR C is not A+B+C minus one correction, but A+B+C−AB−AC−BC+ABC, with the triple product added back in. Each pairwise subtraction removes the all-three-true case once too often, so it has to be restored — the same alternating add-subtract-add rhythm that inclusion-exclusion uses for three overlapping sets. Two inputs need one correction; three need four terms in total.
- Enter your first true/false value in the A (0 or 1) field — 1 stands for true, 0 for false.
- Enter the second value in the B (0 or 1) field the same way.
- Read A OR B: it shows 1 the instant either input is 1, and drops to 0 only when both inputs are 0.
- Set both A (0 or 1) and B (0 or 1) to 1 to see the one row plain addition gets wrong — the result holds at 1, not 2.
Worked example — one true, one false
Set A (0 or 1) to 1 and B (0 or 1) to 0 — one proposition holds, the other does not. A OR B computes 1 + 0 − (1×0) = 1 + 0 − 0 = 1, matching plain intuition: OR only needs one side to carry the truth, and here A alone does the work while the correction term AB vanishes because the two inputs never overlap.
Swap the roles instead — A (0 or 1) at 0, B (0 or 1) at 1 — and the arithmetic is symmetric: 0 + 1 − 0 = 1 again, since OR does not care which input supplies the true value, only that one of them does. Set both to 0 and every term in A + B − AB is 0, giving the single row where this connective fails. Set both to 1 and the subtraction finally does its job, holding 1 + 1 − 1 at 1 instead of letting it overshoot to 2.
Questions
How is A + B − AB the same thing as logical OR?
It reproduces the OR truth table exactly: 1+1−1=1, 1+0−0=1, 0+1−0=1, and 0+0−0=0 match every row with no exceptions. Plain addition alone would return 2 for the true-true case, a value with no meaning as true or false — subtracting AB removes exactly that double-counted overlap, the same correction inclusion-exclusion makes when two regions share ground.
How does this differ from the AND identity, A times B?
AND multiplies (A×B) and needs both inputs equal to 1 before the product survives at all. OR adds the two inputs and then subtracts their overlap (A+B−AB), because plain addition overshoots the moment both are true. The two identities sit on opposite ends of the same truth table: AND keeps only the row where both hold, OR keeps every row except the one where neither does.
Is logical OR the same as the everyday word 'or'?
Not quite. English 'or' is often exclusive — 'coffee or tea' usually rules out ordering both. Logical OR is inclusive: A OR B is true if A holds, if B holds, or if both hold together, so 1 OR 1 equals 1, not 0. That single row is the detail that trips people up when they translate an everyday sentence into a truth table for the first time.
What changes with three inputs instead of two?
The identity grows an extra term. For three 0/1 inputs, A OR B OR C equals A+B+C−AB−AC−BC+ABC, adding the triple product back in because the three pairwise subtractions remove the all-true case one time too many. It is the same alternating add-subtract-add pattern inclusion-exclusion uses for the size of a union of three overlapping sets.
What mistake do people make with A + B − AB?
Dropping the subtraction and reading a plain sum — entering 1 for both A and B and expecting 2 instead of the correct 1. The −AB term exists specifically to cap that one row, keeping the output inside the {0,1} range that a valid logical OR result requires, no matter how large the raw sum gets.
Does the formula still work outside 0 and 1?
No. Feed it 2 and 3 and A+B−AB returns 2+3−6=−1, a number with no standing as true or false. The identity is a faithful stand-in for logical OR only while both inputs stay confined to {0,1}; this sheet keeps the fields restricted to that range so the arithmetic and the logic never drift apart.