Boolean Algebra

Boolean Algebra is the language of True and False. Think of it like a light switch: only up or down. Computers use AND (both must be on), OR (either can be on), and NOT (the opposite). There are no maybes or sort-ofs. By using these simple gates, we build incredibly smart machines like phones and robots. Even the most complex things are made of simple choices.

The most complex things are built from simple yes-or-no choices. AND, OR, NOT: three gates to build a universe. In 1854 George Boole published An Investigation of the Laws of Thought and showed that logic can be done like algebra with just two values, true and false, or 1 and 0. AND gives 1 only when both inputs are 1. OR gives 1 when at least one is. NOT flips. De Morgan's laws connect them: not (A and B) is the same as (not A) or (not B). Eighty years later, in 1937, the young Claude Shannon noticed in his master's thesis that electrical switches in series behave like AND and in parallel like OR, and that logic could therefore be built from circuits. Now watch arithmetic appear. Add two bits. The sum bit is 1 when exactly one input is 1, called exclusive or, and the carry bit is 1 only when both are, which is AND. So 1 plus 1 gives sum 0 and carry 1, which reads 10, the number 2. Chain these together and you get a machine that adds any numbers. Even one gate is enough: in 1913 Henry Sheffer showed that NAND alone, not-and, can build all the others. A few gates, wired together, add, remember and decide.

A Boolean algebra is a set with operations meet, join and complement obeying the usual laws; the subsets of any set form one, so Boole's algebra and the algebra of sets are the same. For n inputs there are 2 to the 2 to the n Boolean functions, so 16 for two inputs, and every one can be written using AND, OR and NOT. Deciding whether a Boolean formula can be made true, the satisfiability problem, was proved by Stephen Cook in 1971 to be NP-complete, the first problem so shown, and whether it can be solved quickly is the open P versus NP question. The counterpoint is that two-valued logic describes the switches, not the world, which is why fuzzy logic and probability extend it for partial truth. Boole himself thought he was describing the laws of thought, a claim that is now seen as optimistic. This links to the consciousness door, where the question is whether thinking is computation.

SOUND: The click-clack of a mechanical keyboard.

SMELL: The ozone smell of a computer or electric spark.

TASTE: A hot pepper vs. a cold ice cube: the ultimate opposite.

TOUCH: Pressing a button: it is either pushed or it is not.

SIGHT: Black text on a bright white screen.

BODY: Knowing if your eyes are open or closed.

Music: ready now (acoustic) by Amistat

Music: The Planner's Dream Goes Wrong by The Jam

Boolean Logic in ProgrammingGeorge Boole

Part of Logic & Proof — MATHEMATICS — Education Revelation

View all Logic & Proof topicsExplore MATHEMATICS
🔢 MATHEMATICS → Logic & Proof
{0,1}

Boolean Algebra

The Language of True and False

Boolean Algebra is the language of True and False. Think of it like a light switch: only up or down. Computers use AND (both must be on), OR (either can be on), and NOT (the opposite). There are no maybes or sort-ofs. By using these simple gates, we build incredibly smart machines like phones and robots. Even the most complex things are made of simple choices.