What is a Boolean expression and how do you simplify one?

A Boolean expression is a logical statement that can only be evaluated as either true or false. Think of it like a strict bouncer at a club: you either have your ID and are over 18 (true, you get in), or you don't (false, you stay out). There is no maybe.

In computer science, these expressions form the foundation of decision-making in code, like 'if' statements, and the physical logic gates inside computer chips. Simplifying them means rewriting the expression so it uses fewer operations but produces the exact same true or false result, saving both computing time and hardware costs.

What makes up a Boolean expression?

Boolean expressions are built using variables (usually represented by letters like AA, BB, or XX) and logical operators. The three most common operators are AND (often written as \cdot or \wedge), OR (written as ++ or \vee), and NOT (written as eg eg, a prime AA', or a bar A\overline{A}). For example, an expression like ABA \cdot B means both AA and BB must be true for the whole expression to be true. It is just like ordering a meal: if you ask for a burger AND fries, you will be disappointed if you only get one of them.

Why do we simplify them?

Imagine writing a program that checks if a user is allowed to log in. You could write a long, confusing rule that checks a dozen different overlapping conditions. This long expression takes more time for the computer to process and is harder for other programmers to read. In hardware design, every AND or OR operation requires a physical piece of silicon called a logic gate. By simplifying a Boolean expression, engineers can build the same circuit using fewer gates, which makes the computer chip smaller, cheaper, and faster.

How to simplify using Boolean Algebra

Just like regular algebra, Boolean algebra has rules you can use to combine or cancel out terms. Some rules are obvious: A+0=AA + 0 = A (anything OR false is just itself) and A1=AA \cdot 1 = A (anything AND true is itself). Other rules are unique to logic, like the Idempotent Law: A+A=AA + A = A. You cannot have "two" true statements; true OR true is still just true. You simplify expressions by looking for common terms, factoring them out, and applying these rules step-by-step until the expression is as short as possible.

Where students slip up

The most common mistake students make is treating Boolean OR (the ++ symbol) exactly like regular addition. In regular math, 1+1=21 + 1 = 2. In Boolean algebra, 1+1=11 + 1 = 1 (true OR true is true). Another frequent trap is forgetting to apply NOT operators to everything inside a parenthesis. De Morgan's Laws state that eg(A+B) eg(A + B) is actually egAegB eg A \cdot eg B, not egA+egB eg A + eg B. You have to flip the operator when distributing a NOT.

Worked through

Simplify the Boolean expression A(A+B)A \cdot (A + B).

First, we distribute the AA into the parentheses, just like regular algebra: AA+ABA \cdot A + A \cdot B. Next, we use the Idempotent Law on the first term (AA=AA \cdot A = A). Now our expression is A+ABA + A \cdot B. We can factor out the AA, giving us A(1+B)A \cdot (1 + B). The Annulment Law tells us that anything OR true is true, so (1+B)(1 + B) becomes 11. Our expression is now A1A \cdot 1. Finally, the Identity Law tells us that A1=AA \cdot 1 = A. So, the entire expression simplifies to just AA.

Questions students ask

Ask about this topic

Where this comes from: Digital Design by M. Morris Mano · Khan Academy: Computers and the Internet unit · OpenStax Introductory Statistics (Probability and Logic)

See also