Boolean Algebra
Not this and that
The Setup
You ever been that person no one wants to see and everyone wants to leave?
YO MAMA.
You ever been that person no one wanted to leave and everyone wanted to stay?
YO MAMA.
Two jokes. Same structure. Same punchline. Only difference? Every bit flipped. Rejection became love. But the logic underneath is identical. Two inputs. One evaluation. Binary output—you either laugh or you don't.
That's Boolean algebra. The math of true and false. And it runs every computer, every circuit, every digital device, and every argument you've ever had.
George Boole: The Quiet Revolutionary
1847. George Boole, a self-taught English mathematician, publishes "The Mathematical Analysis of Logic." His big idea: logical reasoning can be reduced to algebra. True and false behave like 1 and 0. Logical AND behaves like multiplication. Logical OR behaves like addition. Logic IS math.
Nobody cared. Not at first. It took almost a century for Claude Shannon—an electrical engineer at MIT in the 1930s—to realize that Boole's algebra perfectly describes electrical circuits. Switch on = 1. Switch off = 0. Switches in series = AND. Switches in parallel = OR.
Every computer on Earth runs on the math a self-taught guy invented in 1847 because he thought logic was algebra. He was right. It just took the world 90 years to build the hardware that proved it.
True, False, That's It
Boolean algebra has two values. That's the whole number system.
TRUE = 1
FALSE = 0
No maybes. No sometimes. No 0.5. In Boolean algebra, every proposition evaluates to exactly one of these two values. Is it raining? 1 or 0. Is x greater than 5? 1 or 0. Did yo mama leave? 1 or 0.
This seems limiting. How can you describe a complex world with just two values? The same way you describe every number in a computer with just two values. You combine them. A single bit is 1 or 0. Eight bits make a byte—256 possible combinations. A billion bits make… well, a billion bits make your phone.
The Three Gates: AND, OR, NOT
All of Boolean algebra—every operation, every circuit, every logical argument—is built from three operations.
AND — Both inputs must be true for the output to be true.
"Is it raining AND is it cold?" Only true if BOTH are true. If it's raining but warm? False. If it's cold but dry? False. Both conditions required.
Yo mama version: "Yo mama so slow AND so old…" If she's fast, joke fails. If she's young, joke fails. Both gates have to open for the punchline to land.
Math: 1 AND 1 = 1. Everything else = 0.
OR — At least one input must be true.
"Is it raining OR is it cold?" True if either one is true. True if both are true. Only false if NEITHER is true.
Yo mama version: "Yo mama so ugly OR so mean, either way nobody's coming to dinner." Only one condition needed.
Math: 0 OR 0 = 0. Everything else = 1.
NOT — Flips the value.
True becomes false. False becomes true. It's the inverter. The negation.
"It's NOT raining" is true when it's dry, false when it's wet.
Math: NOT 1 = 0. NOT 0 = 1.
That's it. Three operations. AND, OR, NOT. From these three, you can build every logical operation, every circuit, every computer. They're the atoms of digital logic.
Truth Tables: The Map
A truth table lists every possible combination of inputs and shows you the output. It's the complete map—no uncertainty, no probability, just every path and where it leads.
AND truth table:
A=0, B=0 → 0
A=0, B=1 → 0
A=1, B=0 → 0
A=1, B=1 → 1
Four rows. That's ALL possible inputs for two Boolean variables. And the table tells you exactly what AND does to each combination. No guessing. No probability. Certainty.
This is the opposite of the last chapter. Statistics deals with uncertainty—paths you don't fully know. Boolean algebra deals with certainty—paths that are completely determined. The universe needs both.
XOR: The Exclusive
There's a fourth gate that comes up a lot: XOR, exclusive or. It means "one or the other, but not both."
Regular OR: "Do you want cake or pie?" "Yes" (both is fine).
XOR: "Do you want cake or pie?" "Pick ONE."
XOR truth table:
A=0, B=0 → 0 (neither? no)
A=0, B=1 → 1 (just B? yes)
A=1, B=0 → 1 (just A? yes)
A=1, B=1 → 0 (both? too many, no)
XOR outputs 1 when the inputs are different. It's the "is something different here?" detector. Computers use XOR constantly—for encryption, error checking, and comparison operations. If you XOR two identical things, you get 0. If you XOR two different things, you get 1. Simple difference detection.
De Morgan's Laws: Flipping the Whole System
Augustus De Morgan figured out two rules that let you transform between AND and OR using NOT. These laws are the backbone of circuit simplification and logical reasoning.
NOT (A AND B) = (NOT A) OR (NOT B)
NOT (A OR B) = (NOT A) AND (NOT B)
In English: "It's not the case that BOTH are true" is the same as "at least one is false." And "it's not the case that EITHER is true" is the same as "both are false."
These sound obvious when you read them slowly. But they're incredibly powerful for simplifying complex logic. Any time you have a mess of ANDs and ORs and NOTs tangled together, De Morgan's laws let you untangle them. Every circuit designer uses these. Every programmer uses these. Every lawyer constructing an argument uses these, whether they know it or not.
The One-Bit Flip
Remember the two yo mama jokes from the beginning? Same structure, same punchline, completely different meaning?
That's polarity. In Boolean terms, every bit was NOTted. "No one wants to see" became "no one wanted to leave." "Everyone wants to leave" became "everyone wanted to stay." The logical structure is identical. The gate wiring is the same. But every input got flipped, and the output transformed from cruelty to love.
One bit. That's all it takes to change the meaning of an entire logical system. The difference between destruction and creation, rejection and acceptance, hate and love—in Boolean terms—is a NOT gate applied to the input.
Boolean algebra doesn't care what you put through the gates. It processes 1s and 0s without judgment. The structure is pure. But what you CHOOSE to represent as 1 and what you choose to represent as 0—that's on you. The same circuit that sorts spam email could sort people if you let it. The logic is identical. The values you assign determine whether it's useful or evil.
That's the power and the danger of Boolean algebra. It works perfectly. It has no opinion. And every digital system you interact with—every algorithm that recommends, filters, selects, rejects—is made of these gates. AND, OR, NOT. True, false. 1, 0.
Not this and that. Just this. Or that. The simplest math there is. And it runs the world.