Skip to main content
  1. Posts/

The Surprising Difference Between Human 'Or' and Computer Logic

·166 words·1 min

Did you know? The “or” we casually use in daily life means something different to computers.

For example, when someone asks you, “Do you want an apple or an orange?”

Our possible responses are usually limited to:

  1. Apple
  2. Orange

But for computers, “or” means “choose one or both unless there’s no choice”.

Using the example above, a computer’s possible answers would be:

  1. Apple
  2. Orange
  3. Both, please!

Expressed in a truth table, it looks like this:

ABA OR B
000
101
011
111

So, what’s the computer equivalent of our everyday “or”?

The answer is: XOR (eXclusive OR - for when you want to be fancy at parties)

ABA XOR B
000
101
011
110
Lester
Author
Lester
A software engineer; Learn from the fundamentals; During the gold rush its a good time to be in the pick and shovel business.