Overview

Boolean algebra is the branch of algebra where variables and constants have exactly two values: true and false, usually denoted as 1 and 0 respectively.

Why is it Important?

  • Used in programming for conditionals and loops
  • Forms the basis for digital circuits in computer hardware
  • Powers search engine queries and filters

Key Concepts

Operators and Precedence

The core operators (AND, OR, NOT, XOR) and their order of precedence in Boolean Algebra are identical to those used in Bit-String Flicking.

View Operators and Precedence in Bit-String Flicking →

XNOR Operation

The XNOR of two values is true whenever the values are the same. It is the NOT of the XOR function.

Uses the ⊙ operator: x ⊙ y = x ⊕ y

Can be built from basic operators: x ⊙ y = xy + xy

XNOR (⊙)

xyx ⊙ y
001
010
100
111

Boolean Laws and Properties

Commutative Law

Similar to the commutative property in regular algebra - the order of operands does not matter for a single operation.

x + y = y + x

x · y = y · x

Associative Law

Regrouping of the terms in an expression doesn't change the value.

(x + y) + z = x + (y + z)

x · (y · z) = (x · y) · z

Idempotent Law

A term OR itself or AND itself is equal to that term.

x + x = x

x · x = x

Annihilator Law

A term that is OR'ed with 1 is 1; a term AND'ed with 0 is 0.

x + 1 = 1

x · 0 = 0

Identity Law

A term OR'ed with 0 or AND'ed with 1 will equal that term.

x + 0 = x

x · 1 = x

Complement Law

A term OR'ed with its opposite equals 1; AND'ed with its opposite equals 0.

x + x = 1

x · x = 0

Absorptive Law

Expressions can be simplified by absorbing like terms.

x + xy = x

x + xy = x + y

x(x + y) = x

Distributive Law

Similar to the distributive property in regular algebra - distributing an operation over a set of operands yields the same result.

x · (y + z) = xy + xz

(x + y) · (p + q) = xp + xq + yp + yq

(x + y)(x + z) = x + yz

DeMorgan's Law

An OR (AND) expression that is negated equals the AND (OR), with each term negated.

x + y = x · y

x · y = x + y

Double Negation

A term that is inverted twice is equal to the original term.

x = x

XOR and XNOR Relationship

x ⊙ y = x ⊕ y = x ⊕ y = x ⊕ y

Examples

Example: Simplify AB + AB + AB

Apply the laws one step at a time:

  1. Factor A out of the first two terms (distributive law):

    A(B + B) + AB

  2. B + B = 1 (complement law), and A · 1 = A (identity law):

    A + AB

  3. x + xy = x + y (absorptive law):

    A + B

Simplified expression: A + B

Example: Counting true rows with a truth table

How many ordered pairs (A, B) make AB + AB true? Build the truth table and count the rows whose result is 1.

ABABABResult
00000
01011
10101
11000

Two ordered pairs, (0,1) and (1,0), make the expression true. (This expression is A ⊕ B.)

Practice Problems

Type complements with an apostrophe (for example, A' for A) if you need them in an answer.

Problem 1 Junior

Simplify the following Boolean expression:

A(AB + B) + B(A + B)

Problem 2 Junior

How many ordered pairs make the following Boolean expression TRUE?

AB + B(A + C) + AC

Problem 3 Intermediate

Simplify the following Boolean expression:

(A + B)(A + B) + AB

Problem 4 Intermediate

How many ordered triples make the following Boolean expression FALSE?

A(B + C) + B(A + C) + ABC

Problem 5 Senior

Simplify the following Boolean expression:

(A + B)(AB)(A + B)(AB)