Omni Calculator logo

What Is Boolean algebra?

Boolean algebra is a branch of mathematics that deals with true/false values and the rules for manipulating them. It is the foundation of digital logic, programming, and computer science.

Hence, grasping what Boolean algebra is and getting familiar with its basic rules is crucial if you want to advance in these fields. Read on to discover:

  • What are Boolean operators and expressions?
  • What are the basic rules of Boolean algebra?
  • What is a tautology and how to detect it?

To understand what Boolean algebra is, we need to discuss its basic building blocks: Boolean variables, operators, and expressions.

Boolean variables

Boolean variables can assume these two values: TRUE (T) or FALSE (F). Although these values are sometimes denoted by 1 and 0, it is vital you remember they do not work as in standard arithmetic!

Boolean operators

Variables can be connected with three basic operators:

  • AND: Returns TRUE when both inputs are true;
  • OR: Returns TRUE when at least one input is true; and
  • NOT (¬): Inverts the input (TRUE becomes FALSE and vice versa).

Boolean expressions

A Boolean expression is a combination of Boolean variables connected by Boolean operators.

Understanding the rules of Boolean algebra is key to simplifying Boolean expressions and designing efficient logic circuits.

Ready to dive deeper into what Boolean algebra is? The fundamental laws of logic are the backbone of logical reasoning. The first two laws tell us what happens when we combine a statement with a given truth value.

Identity laws

  • A AND T = A
  • A OR F = A

Null laws

  • A AND F = F
  • A OR T = T

Next, we have the classical law of excluded middle and the law of non-contradiction: every statement must be either true or false, and it cannot be both true and false at the same time.

Complement laws

  • A AND ¬A = 0
  • A OR ¬A = 1

Finally, the commutative, associative, and idempotent laws tell us what happens when we reorder, regroup, or repeat variables:

Commutative laws:

  • A AND B = B AND A
  • A OR B = B OR A

Associative laws:

  • (A AND B) AND C = A AND (B AND C)
  • (A OR B) OR C = A OR (B OR C)

Idempotent laws:

  • A AND A = A
  • A OR A = A

Distributive laws and De Morgan’s laws allow us to understand how operators interact more deeply. Having mastered them, you will be able to rewrite any complicated Boolean expression into an equivalent simpler form.

Distributive laws

  • A AND (B OR C) = (A AND B) OR (A AND C)
  • A OR (B AND C) = (A OR B) AND (A OR C)

You can compare this law to how multiplication distributes over addition in arithmetic.

De Morgan’s laws

It is about how negations interact with AND and OR:

  • ¬(A AND B) = ¬A OR ¬B
  • ¬(A OR B) = ¬A AND ¬B

In Boolean logic, a tautology is a Boolean expression that is always true, no matter what values its variables take. For example, let’s examine the following expression:

(A AND B) OR (A AND ¬B) OR (¬A)

It looks complicated, doesn’t it? Let’s start by breaking it down. The first part

(A AND B) OR (A AND ¬B)

can be factored as follows:

A AND (B OR ¬B)

Since B OR ¬B is always TRUE, we obtain:

A AND TRUE = A

This simplifies our expression to:

A OR ¬A

which is always TRUE, meaning the original expression is indeed a tautology!

In the truth table, we can recognize tautologies by checking whether the final column is always TRUE, regardless of the values of A and B. For our expression:

A

B

¬A

(A AND B) OR (A AND ¬B) OR ¬A

T

T

F

T

T

F

F

T

F

T

T

T

F

F

T

T

Check out our article on how to make a truth table​ to learn more about Boolean tables.

Boolean logic and set operations are closely related, as each Boolean operator has a counterpart in set theory:

Boolean logic

Set operation

A AND B

Intersection

A OR B

Union

NOT A

Complement

A XOR B

Symmetric difference

To learn more, read about the connections of Boolean logic and Venn diagrams.

🔎 If you need a refresher on basic set operations, check out Omni’s union and intersection calculator.

Boolean operators are logical connectors that combine Boolean values. The basic ones are AND, OR, and NOT, and there are also variations like XOR and NAND. These operators form the building blocks of logical expressions.

A Boolean in programming is a data type that represents true or false values. It controls program flow using statements such as if and while. Understanding Booleans is key to building reliable algorithms.

A Boolean function is a function that takes Boolean variables as inputs and produces a Boolean output.

This article was written by Anna Szczepanek and reviewed by Steven Wooding.