What Is Boolean Algebra?
What is Boolean algebra? Is it as complicated as it sounds? Why is it so important in the day-to-day functioning of the modern world? Keep on reading to find out!
Jason Marshall, PhD
Listen
What Is Boolean Algebra?
Today we’re going to talk about one of those topics in math that sounds incredibly hard but is actually pretty straightforward: Boolean algebra. Sounds painful, right? Well, as you’ll soon see, it isn’t. Plus, the simple ideas behind Boolean algebra are actually something you’re most likely already familiar with…you just don’t know it yet! And it turns out that these ideas are some of the most important bits of math that you use in your day-to-day life. So, how does Boolean algebra work? And when do you use it? Stay tuned because those are exactly the questions we’ll be talking about today..
How Do Computers Add?
If you’ve been following along for the past few weeks, you know that we’ve been on something of a quest. We started by talking about the basics of counting in binary, we then talked about some tricks that thinking in binary make possible, and last week we learned how to perform binary addition. What do these topics have in common? Obviously, they’re all about binary numbers. While binary numbers are certainly fun and interesting in their own right, they aren’t actually what we’ve been questing for. Instead, our goal is to understand the math that allows an inanimate object like a calculator to perform the rather intelligent task of adding two numbers—a feat which binary numbers play a key role in.
Similarly, while today’s topic—Boolean algebra—is perfectly interesting in its own right, keep in mind that our main goal is to ultimately understand the math that allows computers and calculators to do addition. And in order to do that, we need to first figure out what we can do with Boolean algebra.
What Is Boolean Algebra?
So, what is Boolean algebra? Well, for our purposes, we can think of Boolean algebra as a type of math that deals with bits instead of numbers. What does that mean? Well, as we’ve learned, a bit (which is shorthand for “binary digit”) can have a value of either 1 or 0. In Boolean algebra, a binary value of 1 is interpreted to mean “true” and a binary value of 0 means “false.” Which means that Boolean algebra can equivalently be thought of as a particular type of math that deals with true and false values—aka truth values—instead of numbers. What kind of things can we do to these truth values?
AND, OR, and NOT
In the typical math and algebra that we use on a daily basis, the basic arithmetic operations (addition, subtraction, multiplication, and division) are used to manipulate and combine numbers and symbols that represent numbers. Similarly, in the type of math we’re talking about today known as Boolean algebra, three basic operations are used to manipulate bits—which, remember, are the same thing as “true” and “false” values.
The first operation, NOT, is actually rather boring. It simply returns the opposite of the value that you give it. Since there are two possible values you can give (1 or 0), there are two possible outcomes of NOT:
-
NOT 0 = 1 (since 1 is the opposite of 0)
-
NOT 1 = 0 (since 0 is the opposite of 1)
The other two basic operations in Boolean algebra are more interesting. They both take two bits and give you back 0 or 1. The first operation, AND, only returns 1 if both input bits are equal to 1. Otherwise, AND returns 0. So the four possible input values and the values returned by AND are:
-
0 AND 0 = 0 (both input bits must be 1 to return 1)
-
1 AND 0 = 0 (…)
-
0 AND 1 = 0 (…)
-
1 AND 1 = 1 (since both input bits are 1)
The final operation, OR, returns 1 if either of the input bits (or both) is equal to 1. Otherwise, it returns 0. So the four possible input values and the values returned by OR are:
-
0 OR 0 = 0 (one or both input bits must be 1 to return 1)
-
1 OR 0 = 1 (since one or more of the input bits is 1)
-
0 OR 1 = 1 (…)
-
1 OR 1 = 1 (…)
I mentioned earlier that you were probably already (unknowingly) familiar with Boolean algebra. So do any of these operations look familiar? If not, I encourage you to go back and check out the Math Dude episodes on the union and intersection of sets and Venn diagrams. Afterwards, ask yourself if there’s a similarity between the union of sets and the OR operation in Boolean algebra. And what about the intersection of sets and the AND operation? Finally, see if you can figure out what the NOT operation might look like on a Venn diagram.
What’s Next?
Believe it or not, these three simple operations—NOT, AND, and OR—are actually all we need to know about Boolean algebra in order to understand how computers and calculators add numbers. I know the connection between this seemingly bizarre bit of math and your calculator probably isn’t obvious right now, but hang tight and I promise that everything will start coming together over the next few weeks.
Wrap Up
Okay, that’s all the math we have time for today. Remember to become a fan of the Math Dude on Facebook where you’ll find lots of great math posted throughout the week. If you’re on Twitter, please follow me there, too. Finally, please send your math questions my way via Facebook, Twitter, or email at mathdude@quickanddirtytips.comcreate new email.
Until next time, this is Jason Marshall with The Math Dude’s Quick and Dirty Tips to Make Math Easier. Thanks for reading, math fans!