Mathematics & Logic · Logic & proof

Truth tables and the logic of and, or, not

Logic builds complicated statements from simple ones joined by and, or and not. Learn to test any of them with a truth table, spot two that say the same thing, and see how Boole turned reasoning into algebra.

4 short lessons · about 16 minutes · 8 sources · updated November 2026

What you will learn

  • Identify a statement as a sentence that's true or false, and say how not and and set the truth of compounds
  • Tell inclusive or from exclusive or, and say which one logic uses by default
  • Lay out the rows of a truth table, one for each combination, and say why the count doubles
  • Fill in a truth table column by column and read off when a compound statement is true

Lesson 1 of 4 · 4 min

True or false, and the two meanings of or

Before you readA menu says each main course comes with soup or salad. You're served both. In formal logic, is "you got soup or salad" true?

Correct.Not quite. The answer is Yes, it's true.

It's true. In logic, or allows both unless you say otherwise. The lesson shows why logic picks that reading.

"The kettle is on" is either true or false. "Put the kettle on" is neither, because it's a request. Logic only works with the first kind, a statement, a sentence that makes a claim that's true or false.

Logicians then join statements into bigger ones. The simplest tool is not. It flips a statement's value, so if "the kettle is on" is true, "the kettle is not on" is false.

The next tool is and. "The kettle is on and the oven is on" is true only when both parts are true. If either part fails, the whole thing fails. Say the oven is off. Then the and-statement is false, however hot the kettle is.

Check yourself"Paris is in France and Rome is in Spain." Is this statement true or false?

Correct.Not quite. The answer is False, because one part is false.

An and-statement needs every part true. Rome isn't in Spain, so the whole statement is false, even though the Paris part is true.

Or is trickier, because English uses it two ways. "Soup or salad" on a menu usually means one, not both. That's called exclusive or.

Logic's default is inclusive or. "You'll get cake or ice cream" is true if you get cake, ice cream or both. It's false only when you get neither. Logicians pick this reading because it's the one that matches "at least one".

Ordinary speech often slides between the two. "Mary is either a singer or a poet" hints at only one, yet "either a singer or a poet or both" sounds fine. When the difference matters, logic says "but not both" out loud.

Try to recallWhen is the logical statement "it will rain or it will snow" false, and how would you change it to rule out both?

With logic's inclusive or, it's false only if it neither rains nor snows. Rain, snow or both all make it true. To rule out both, you add "but not both", which makes it an exclusive or.

A statement is a claim that's true or false. Not flips it, and is true only when every part is, and logic's or is true when at least one part is, both included.

Lessons in this topic

  1. True or false, and the two meanings of or

    Learn what counts as a statement in logic, how not and and decide its truth, and why logic reads or differently from a restaurant menu.

    Essentials · 4 min

  2. Truth tables list every case so you don't miss one

    Learn how to lay out every combination of true and false, and read off exactly when a compound statement holds.

    Essentials · 4 min

  3. When two statements say the same thing

    Use truth tables to show that two different-looking statements are equivalent, and meet statements that can never be false.

    Deeper · 4 min

  4. How George Boole turned reasoning into algebra

    See how Boole wrote and as multiplication with only 0 and 1, and why his or had to be rebuilt before it became the algebra used today.

    Deeper · 4 min

Three quick stories from this topic

Invented twice in 1921

Truth tables were published twice in 1921, by two logicians working separately

Ludwig Wittgenstein set them out in his Tractatus, and Emil Post proposed the same method independently that year. Unpublished manuscripts suggest Charles Sanders Peirce had drawn one decades earlier.

A new meaning

In the same 1921 book Wittgenstein used the word tautology for a statement true in every row of its table.

Why it caught on

A truth table turns checking a statement into a finite routine. List every case, fill in the columns and read the answer.

A billion-row table

A truth table for just 30 simple statements needs more than a billion rows

Each simple statement is either true or false, so every one you add doubles the rows. Thirty doublings give 1,073,741,824 combinations, and a full test has to check each one.

Doubling fast

Two statements need 4 rows and three need 8. By ten you're at 1,024.

Always finite

However large, the table has an end, so checking every row always finishes. It can just take a very long time.

Boole's odd law

George Boole's logic rests on a rule ordinary algebra breaks, that x times x equals x

Boole let x stand for a class, such as cats, and x times y for things in both. Cats that are cats are just cats. Among numbers only 0 and 1 obey that rule, so his algebra used those two values alone.

A shoemaker's son

Boole largely taught himself mathematics in Lincoln and published his algebra of logic in 1847 and 1854.

And as times

With only 0 and 1, multiplying works like and. One times one is 1, and any 0 makes the result 0.

Sources

  • Why examples are not a proof

    Watch a formula produce 40 primes in a row and then fail, then learn to prove a claim for every case by direct argument, by induction and by the contrapositive.

    4 lessons · 17 min

  • If-then statements and the mistake of reversing them

    Learn the one way an if-then statement can be false, why reversing it makes a different claim, and what you commit to when you deny one.

    4 lessons · 20 min

  • Sets and Venn diagrams

    A set is a collection with a clear rule for what belongs. Learn union, intersection and complement, draw them as overlapping circles, and use them to count survey answers and build search queries.

    4 lessons · 16 min

  • Percentages and why the base matters

    See why a 20% fall takes a 25% rise to undo, why 5% to 10% is both five points and a doubling, and why you can't average two percentages.

    4 lessons · 21 min

  • Linear versus exponential growth

    Linear growth adds the same amount at each step and exponential growth multiplies by the same factor. See why they look alike at first, how decay and compound interest follow the same rule, and where the number e comes from.

    4 lessons · 20 min

  • What a function is, and why it can't always run backward

    A function is a rule that gives each input exactly one output. See why two inputs can share an output, where a formula stops applying, and why working back from an output can fail.

    4 lessons · 17 min

All mathematics & logic topics · Take the quiz