How it works
A truth table lists every way the inputs can be, and the answer for each one.
Each switch is off or on, so each extra switch doubles the number of rows.
An AND lamp lights only when both switches are on. An OR lamp lights when either one is on.
Checking every row is how you catch a bug that likes to hide.