Propositional Logic and Truth Tables
What You’ll Learn
Section titled “What You’ll Learn”In this lesson you’ll learn what counts as a proposition, the three basic logical connectives (negation, conjunction, disjunction), the symbols mathematicians use for them, and how to build a truth table that settles any question about a compound statement.
This is the lesson where the symbols start. Here’s the whole set up front, so you can glance back at it any time:
The Concept
Section titled “The Concept”A proposition is a statement that is either true or false, but not both.
These are propositions:
- “7 is a prime number.” (true)
- “Paris is the capital of Italy.” (false)
- "" (false)
These are not propositions:
- “What time is it?” (a question)
- “Close the door.” (a command)
- "" (depends on , so it has no fixed truth value)
- “This sentence is false.” (paradox, can’t be either)
We name propositions with letters: , , . Each one has a truth value, either T (true) or F (false).
There are three basic ways to combine them, and each one has a physical form as a circuit component:
Negation: NOT
Section titled “Negation: NOT”The negation of is written and read “not .” It flips the truth value.
| T | F |
| F | T |
If is “it is raining,” then is “it is not raining.”
Conjunction: AND
Section titled “Conjunction: AND”The conjunction of and is written and read ” and .” It is true only when both parts are true.
| T | T | T |
| T | F | F |
| F | T | F |
| F | F | F |
A useful memory hook: AND is demanding. One failure ruins it.
Disjunction: OR
Section titled “Disjunction: OR”The disjunction of and is written and read ” or .” It is true when at least one part is true.
| T | T | T |
| T | F | T |
| F | T | T |
| F | F | F |
Important: this is inclusive or. If both are true, the whole thing is still true. Everyday English often means “one or the other but not both” (“soup or salad”), but mathematical OR always includes the both case. When you specifically want to exclude the both case you use exclusive or, written , which is true when exactly one part is true.
Building a truth table
Section titled “Building a truth table”A truth table lists every possible combination of truth values for the basic propositions, then works outward to the compound statement.
With distinct propositions there are rows. One proposition gives 2 rows, two give 4, three give 8, four give 16.
The standard procedure:
- Write a column for each basic proposition and fill in all combinations.
- Add a column for each intermediate piece, working from the inside of the expression outward.
- Combine the intermediate columns to get the final answer.
A note on notation
Section titled “A note on notation”You will see these symbols written several ways depending on the field:
| Meaning | Math notation | Programming | Circuit / engineering |
|---|---|---|---|
| NOT | !p | ||
| AND | p && q | ||
| OR | p || q |
They mean exactly the same things. If you’ve written an if statement, you already know propositional logic.
Precedence
Section titled “Precedence”Just like arithmetic has an order of operations, so does logic. From highest to lowest:
So means , not . Use parentheses whenever there’s any doubt, and there’s usually doubt.
Worked Examples
Section titled “Worked Examples”Example 1: Build a truth table for .
Two propositions, so 4 rows. Work inside out: first , then OR it with .
| T | T | F | T |
| T | F | F | F |
| F | T | T | T |
| F | F | T | T |
Row 2 is the only false row. Notice that this table is going to look very familiar when we get to conditional statements.
Example 2: Build a truth table for .
Three propositions, so 8 rows.
| T | T | T | T | F | T |
| T | T | F | T | T | T |
| T | F | T | F | F | F |
| T | F | F | F | T | T |
| F | T | T | F | F | F |
| F | T | F | F | T | T |
| F | F | T | F | F | F |
| F | F | F | F | T | T |
The statement is false in exactly 3 of 8 cases: whenever is true and is not.
Example 3: Translate into symbols.
Let = “the server is online,” = “the database is reachable,” = “maintenance mode is on.”
Translate: “The server is online and the database is reachable, but maintenance mode is not on.”
Solution. The word “but” is just AND with attitude. It carries no different logical meaning.
Example 4: Tautology and contradiction.
A tautology is a statement that is true in every row. A contradiction is false in every row.
Check :
| T | F | T |
| F | T | T |
Always true, so it’s a tautology. This one is called the law of the excluded middle.
Now check :
| T | F | F |
| F | T | F |
Always false, so it’s a contradiction. Good, because “it is raining and it is not raining” should never be true.
Real-World Applications
Section titled “Real-World Applications”Every conditional in every program you’ve ever run is propositional logic. When you write:
if (isLoggedIn && !isBanned) { showDashboard(); }you’ve written . And when a bug turns out to be “this condition is wrong in one specific case,” a truth table finds it in about ninety seconds.
Digital circuits are built out of physical AND, OR, and NOT gates, and chip designers use truth tables to specify exactly what a circuit should do before building it. Database queries with WHERE active = true AND deleted = false are the same logic again.
Outside of computing, insurance policies, tax rules, and eligibility requirements (“you qualify if you are over 65 or have a documented disability, and you are not currently enrolled elsewhere”) are compound propositions. Writing them as symbols is often the fastest way to figure out whether you actually qualify.
Retrying will remove your ✅ checkmark until you pass again.