Compound Boolean Statements
Learn to build compound statements from simple ones with AND, OR and NOT, translate between words and symbols, and find their truth value.
Definition
| In words | Symbols | True when |
|---|---|---|
| It is raining and it is cold. | both parts are true | |
| It is raining or it is cold. | at least one part is true | |
| It is not raining. | is false | |
| It is raining but it is not cold. | is true and is false | |
| It is neither raining nor cold. | both parts are false |
- 1.Give each simple statement its value: 1 or 0.
- 2.Work out the parts in brackets and every NOT.
- 3.Combine the results with AND or OR.
| 0 | 0 | 0 | 0 | 1 |
| 0 | 1 | 0 | 1 | 1 |
| 1 | 0 | 0 | 1 | 0 |
| 1 | 1 | 1 | 1 | 0 |
| 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |
Try it now
Worked Examples
Let : "The shop is open" and : "I have money". Write each sentence in symbols: (a) The shop is open and I have money. (b) The shop is not open or I have money. (c) The shop is open but I have no money. (d) The shop is not open and I have no money.
Sentence (a)
The word *and* joins two parts that are both claimed to be true →
Sentence (b)
*not* belongs only to the first part, *or* joins the two parts →
Sentence (c)
*but* means AND, and *I have no money* is the negation of →
Sentence (d)
Both parts are negated and joined with *and* →
Answer: (a) , (b) , (c) , (d) . Sentence (d) can also be said with neither ... nor: neither is the shop open nor do I have money.
Common Mistakes
Thinking that " or " is false when both parts are true
Why it's wrong: In everyday speech *or* often means one or the other, but not both. In logic OR is inclusive: .
Correct: is false only when both parts are false. For one but not both there is a separate operator, XOR (exclusive OR).
Negating "I like tea and coffee" as "I like neither tea nor coffee"
Why it's wrong: *Neither ... nor* is true only when both parts are false (1 case). The negation of an AND statement must be true whenever at least one part is false (3 cases).
Correct: Say "It is not true that I like both tea and coffee": at least one of them I do not like. The general rule (De Morgan's laws) comes in the lesson Boolean Algebra.
Reading as if it were
Why it's wrong: Without brackets NOT applies only to the statement right after it. For and : , but .
Correct: Check what the NOT touches. Write brackets when NOT should apply to the whole compound statement.
Not recognizing *but* as AND
Why it's wrong: "The test was hard but I passed" sounds like a contrast, yet both parts are claimed to be true.
Correct: Translate *but*, *although* and *both ... and* as AND: (hard test AND passed).
Interactive Visual
Truth Table
| P | Q | P ∧ Q |
|---|---|---|
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
1= True0= False
Truth Table
| P | Q | R | P ∨ Q | ¬R | (P ∨ Q) ∧ ¬R |
|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | 1 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |
1= True0= False
Interactive Sandbox
Expression Calculator
Try these:
History
No calculations yet
Practice Problems
18 problemsLet : "The dog is hungry" and : "The dog is tired". Which symbols mean "The dog is hungry and tired"?
Why It Matters
- Online shops and search engines: a filter like "shoes AND size 38 AND NOT red" combines three conditions
- Programming: conditions such as (logged in AND NOT blocked) OR admin decide what an app does next
- Rules and signs: "Children under 12 enter free if they come with an adult" is met or not depending on two facts
- Arguments and debates: knowing exactly when OR and NOT are true helps you spot sentences that sound alike but mean different things
- Digital circuits: every chip is built from AND, OR and NOT, the same operators you use here
Real World Applications
Online Shop Filters
Shops and search engines combine conditions with AND, OR and NOT to decide which items you see.
Example:
The filter (black OR blue) AND NOT used shows only new items, in either of the two colors.
A filter shows a jacket if , where : the jacket is blue, : it is on sale, : it costs less than 50 dollars. A jacket is blue, is on sale and costs 65 dollars.
Does the filter show this jacket?
Step 1: Write the mathematical expression
With 1 and 0, AND works like multiplication. Write the last step as a product:
Game Rules in Code
Video games and apps check compound conditions many times per second to decide what happens next.
Example:
A door opens if (key AND NOT alarm). With the key and no alarm: , so the door opens.
A player levels up if , where : the score is at least 100, : the time is over, : the player has a bonus key.
In how many of the 8 cases does the player level up?
Step 1: Write the mathematical expression
Write the count as the cases with true minus the cases that fail:
Rules and Signs
Rules on signs, tickets and contracts are compound statements, and it often matters exactly when a rule is NOT met.
Example:
"Free parking on Sundays or after 8 pm" holds on a Sunday at noon, on a Monday at 9 pm, and also on a Sunday at 9 pm.
A museum sign says: children enter free if they are under 12 and come with an adult. Let : the child is under 12, : the child comes with an adult.
In how many of the 4 cases is the free entry rule NOT met?
Step 1: Write the mathematical expression
Write the count as all cases minus the cases where the rule is met:
Key Takeaways
- 1A compound statement joins simple statements with AND (), OR () and NOT ()
- 2*and* and *but* translate to AND, *or* to OR, *not* and *it is not true that* to NOT
- 3AND is true only when both parts are true; OR is false only when both parts are false
- 4To find the truth value, give each part 1 or 0, work out the brackets and every NOT, then combine
- 5Brackets decide what NOT applies to: is not the same as
- 6With 3 simple statements there are cases, and the negation of an AND statement is true whenever at least one part is false
Frequently Asked Questions
Glossary
- Simple statement
- A single sentence that is either true or false, such as " is prime"
- Compound statement
- A statement built from simple statements with AND, OR and NOT, such as
- Truth value
- Whether a statement is true (1) or false (0)
- Conjunction (AND)
- , true only when both parts are true
- Disjunction (OR)
- , true when at least one part is true
- Negation (NOT)
- , true exactly when is false
Formula Card
AND (conjunction)
True (1) only when both $P$ and $Q$ are true
OR (disjunction)
False (0) only when both $P$ and $Q$ are false
NOT (negation)
Flips the value: $\neg 1 = 0$ and $\neg 0 = 1$
Number of cases
$n$ simple statements give $2^n$ cases: 4 for two, 8 for three