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.

Advanced25 minLesson

Definition

A simple statement is one sentence that is either true or false, such as "It is raining." A compound statement joins two or more simple statements with the logical operators AND (∧\land), OR (∨\lor) and NOT (¬\neg). Its truth value depends only on the truth values of its parts.
We write 1 for true and 0 for false. The interactive tables in this lesson use 1 and 0 as well.
From words to symbols. Let PP: "It is raining" and QQ: "It is cold".
In wordsSymbolsTrue when
It is raining and it is cold.P∧QP \land Qboth parts are true
It is raining or it is cold.P∨QP \lor Qat least one part is true
It is not raining.¬P\neg PPP is false
It is raining but it is not cold.P∧¬QP \land \neg QPP is true and QQ is false
It is neither raining nor cold.¬P∧¬Q\neg P \land \neg Qboth parts are false
Signal words: *and*, *but*, *both ... and* mean AND. *or* means OR, which is also true when both parts are true. *not*, *it is not true that* mean NOT.
Finding the truth value in 3 steps:
  1. 1.Give each simple statement its value: 1 or 0.
  2. 2.Work out the parts in brackets and every NOT.
  3. 3.Combine the results with AND or OR.
The four cases of two statements (starting with 0, like the interactive table; the lesson Truth Tables starts with T, and both orders list the same cases):
PPQQP∧QP \land QP∨QP \lor Q¬P\neg P
00001
01011
10010
11110
Three parts, eight cases. With a third statement RR there are 23=82^3 = 8 cases, and brackets show which parts belong together. For (P∨Q)∧¬R(P \lor Q) \land \neg R:
PPQQRRP∨QP \lor Q¬R\neg R(P∨Q)∧¬R(P \lor Q) \land \neg R
000010
001000
010111
011100
100111
101100
110111
111100
This compound statement is true in 3 of the 8 cases: when at least one of PP and QQ is true and RR is false. How to read a statement without brackets (the order of operations) is the topic of the lesson Boolean Expressions.

Try it now

Let PP: "The dog is hungry" and QQ: "The dog is tired". Which symbols mean "The dog is hungry and tired"?

Worked Examples

Let PP: "The shop is open" and QQ: "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.

1

Sentence (a)

The word *and* joins two parts that are both claimed to be true → P∧QP \land Q

2

Sentence (b)

*not* belongs only to the first part, *or* joins the two parts → ¬P∨Q\neg P \lor Q

3

Sentence (c)

*but* means AND, and *I have no money* is the negation of QQ → P∧¬QP \land \neg Q

4

Sentence (d)

Both parts are negated and joined with *and* → ¬P∧¬Q\neg P \land \neg Q

Common Mistakes

Thinking that "PP or QQ" 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: 1∨1=11 \lor 1 = 1.

Correct: P∨QP \lor Q 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 ¬P∧Q\neg P \land Q as if it were ¬(P∧Q)\neg(P \land Q)

Why it's wrong: Without brackets NOT applies only to the statement right after it. For P=0P = 0 and Q=0Q = 0: ¬P∧Q=1∧0=0\neg P \land Q = 1 \land 0 = 0, but ¬(P∧Q)=¬0=1\neg(P \land Q) = \neg 0 = 1.

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: H∧SH \land S (hard test AND passed).

Interactive Visual

Truth Table

P ∧ Q
PQP ∧ Q
000
010
100
111

1= True0= False

Truth Table

Expression(P ∨ Q) ∧ ¬R
PQRP ∨ Q¬R(P ∨ Q) ∧ ¬R
000010
001000
010111
011100
100111
101100
110111
111100

1= True0= False

Interactive Sandbox

Expression Calculator

Try these:

History

No calculations yet

Practice Problems

18 problems
Problem 1 of 18
Easy

Let PP: "The dog is hungry" and QQ: "The dog is tired". Which symbols mean "The dog is hungry and tired"?

Why It Matters

Almost every rule you meet is a compound statement:
  • 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
You already know AND, OR and NOT one at a time. In this lesson you combine them into longer statements and find their truth value with confidence.

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.

1Try It Yourself

A filter shows a jacket if (B∨S)∧C(B \lor S) \land C, where BB: the jacket is blue, SS: it is on sale, CC: 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: 1∧¬0=1∧1=11 \land \neg 0 = 1 \land 1 = 1, so the door opens.

2Try It Yourself

A player levels up if S∧(¬T∨K)S \land (\neg T \lor K), where SS: the score is at least 100, TT: the time is over, KK: 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 SS 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.

3Try It Yourself

A museum sign says: children enter free if they are under 12 and come with an adult. Let UU: the child is under 12, AA: 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 (∧\land), OR (∨\lor) and NOT (¬\neg)
  • 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: ¬(P∧Q)\neg(P \land Q) is not the same as ¬P∧Q\neg P \land Q
  • 6With 3 simple statements there are 23=82^3 = 8 cases, and the negation of an AND statement is true whenever at least one part is false

Frequently Asked Questions

Not always. The operator OR is always inclusive: it is also true when both parts are true. In everyday speech *either ... or* often hints at one but not both. When a sentence clearly means one but not both, write it as the exclusive OR (XOR): (P∨Q)∧¬(P∧Q)(P \lor Q) \land \neg(P \land Q). Otherwise read it as OR.
Not always. The operator OR is always inclusive: it is also true when both parts are true. In everyday speech *either ... or* often hints at one but not both. When a sentence clearly means one but not both, write it as the exclusive OR (XOR): (P∨Q)∧¬(P∧Q)(P \lor Q) \land \neg(P \land Q). Otherwise read it as OR.
With two parts and one operator, no. As soon as AND and OR appear together, or a NOT should apply to more than one statement, brackets make the meaning clear. The rules for reading a statement without brackets (NOT before AND before OR) come in the lesson Boolean Expressions.
Partly. With 1 and 0, AND works like multiplication (1×0=01 \times 0 = 0, 1×1=11 \times 1 = 1) and NOT PP equals 1−P1 - P. The calculator in this lesson does not know the words AND, OR and NOT, so use it for these products and for counting cases like 232^3.
A statement must be either true or false. A question like "Is it raining?" or an order like "Close the door!" has no truth value, so it cannot be one of the parts.

Glossary

Simple statement
A single sentence that is either true or false, such as "77 is prime"
Compound statement
A statement built from simple statements with AND, OR and NOT, such as P∧¬QP \land \neg Q
Truth value
Whether a statement is true (1) or false (0)
Conjunction (AND)
P∧QP \land Q, true only when both parts are true
Disjunction (OR)
P∨QP \lor Q, true when at least one part is true
Negation (NOT)
¬P\neg P, true exactly when PP is false

Formula Card

AND (conjunction)

P∧QP \land Q

True (1) only when both $P$ and $Q$ are true

OR (disjunction)

P∨QP \lor Q

False (0) only when both $P$ and $Q$ are false

NOT (negation)

¬P\neg P

Flips the value: $\neg 1 = 0$ and $\neg 0 = 1$

Number of cases

2n2^n

$n$ simple statements give $2^n$ cases: 4 for two, 8 for three

More in This Topic