AP CSP Topic 3.5 Guided Notes - Boolean Expressions
Big Idea 3: Algorithms and Programming · Topic 3.5 · Guided Notes (Student)
Boolean Expressions — Guided Notes
Fill these in during class or catch up here if you were absent. Print this page or work on paper — then check yourself with the CFUs on the Topic 3.5 page.
Print these notesAll CSP topics
Day 1: Asking the Computer Yes-or-No Questions
Today’s objectives
- Write expressions using the relational operators =, ≠, >, <, ≥, and ≤ to state a relationship between two values (LO AAP-2.E)
- Evaluate a comparison to a single Boolean value — true or false — knowing that ≥ and ≤ include the boundary while > and < do not (LO AAP-2.E)
Bell ringer
Your table gets a stack of ride-entry cards, each showing a guest's height in inches. The Gauntlet's rule today: a guest may ride if they are AT LEAST 48 inches tall. Sort every card into two piles — 'Can ride' and 'Cannot ride' — using nothing but that one height rule. Cards: 47, 48, 52, 40, 60, 48.
Write 2–4 sentences: What single yes/no question did you ask about each card, and what were the only two answers it could ever have? Where did the two 48 cards go, and why is 48 the case people argue about?
01. Boolean Values and Comparisons
Key Vocabulary (LO AAP-2.E)
| Term | Definition (write it) |
|---|---|
| Boolean value | |
| Relational operator | |
| Comparison | |
| Operand | |
| Condition |
A Comparison Answers a Yes-or-No Question
- A Boolean value can only ever be .
- Putting a relational operator between two operands always produces .
- The comparison a = b evaluates to false whenever .
A Comparison Produces a Boolean
height ≥ 48 asks a yes-or-no question; the answer is the Boolean true.
AP Pseudocode (what the exam tests)
height ← 50 tallEnough ← height ≥ 48 DISPLAY(tallEnough)
Python (the runnable version)
height = 50 tall_enough = height >= 48 print(tall_enough)
Output
true
Run and edit this yourself in the coding exercises for this topic.
Stop and think
- In one sentence, explain what type of value the comparison score > 90 produces, and list every value it could possibly evaluate to.
- A classmate says 'height ≥ 48 gives back the number 50 because height is 50.' Correct the wording precisely — what does the comparison actually hand back?
- Write one real yes-or-no question about a guest at the gate, then write the comparison that would answer it.
Answer in complete sentences. Then check yourself with the matching CFUs on the Topic 3.5 page.
02. The Six Relational Operators
Six Operators, One Boolean Answer
- The operators ≥ and ≤ differ from > and < because they .
- The English phrase 'at least 48' should be written as .
- The English phrase 'more than 48' should be written as .
Same Six, Two Notations
The pseudocode symbol on the left; the two-character Python version on the right.
AP Pseudocode (what the exam tests)
a = b a ≠ b a > b a < b a ≥ b a ≤ b
Python (the runnable version)
a == b a != b a > b a < b a >= b a <= b
Run and edit this yourself in the coding exercises for this topic.
Evaluate Each Comparison
Use the rider values height = 48 and age = 10. Evaluate each comparison to true or false. The boundary cases are the ones to slow down on.
Complete the empty cells.
| Comparison | Substitute the values | Evaluates to |
|---|---|---|
| height ≥ 48 | 48 ≥ 48 | |
| height > 48 | 48 > 48 | |
| age < 13 | 10 < 13 | true |
| height ≠ 40 | 48 ≠ 40 | true |
| age = 12 | 10 = 12 |
= Compares; ← Assigns
Assignment ←
Equality =
- On the exam reference sheet, the symbol that stores a value into a variable is .
- On the exam reference sheet, a single = between two operands is .
AP TIP: On the reference sheet, a single = is the equality TEST (it yields a Boolean); the left-arrow ← is what STORES a value. Read = as 'is equal to,' never as 'gets.'
Watch out — “At Least 48 Means height > 48”
Myth: The rule 'riders must be at least 48 inches tall' should be written as height > 48.
Explain why this is wrong:
Stop and think
- Write a comparison for each rule: (a) the wait is no more than 30 minutes, (b) the rider is older than 12, (c) the seat number is not 13.
- Using height = 60 and age = 15, evaluate each: height ≥ 48, age < 12, height ≠ 60. Show the substitution for each.
- A rule says 'you may ride if you are exactly 48 inches or taller.' Explain why height ≥ 48 is correct and height > 48 is wrong, using the 48-inch guest.
Answer in complete sentences. Then check yourself with the matching CFUs on the Topic 3.5 page.
Today in one box
- A Boolean value is either true or false — the only two possibilities
- A comparison built with a relational operator evaluates to a Boolean value
- The six operators are =, ≠, >, <, ≥, and ≤; ≥ and ≤ include the boundary, > and < do not
- On the reference sheet a single = is the equality TEST; the arrow ← is assignment
Before next class: Before tomorrow, predict it: at the gate, tallEnough = true and hasTicket = false. A rider boards only when tallEnough AND hasTicket. Do they board? Write your answer and your reasoning.
Day 2: Combining Yes-or-No Answers
Today’s objectives
- Write expressions using the logical operators NOT, AND, and OR to combine or flip Boolean values (LO AAP-2.F)
- Evaluate NOT, AND, and OR expressions to a single Boolean value, treating OR as inclusive (LO AAP-2.F)
Bell ringer
The Gauntlet now has two rules to board: you must be tall enough AND you must hold a ticket. For each guest, both facts are already known. Guest A: tallEnough = true, hasTicket = true. Guest B: tallEnough = true, hasTicket = false. Guest C: tallEnough = false, hasTicket = false. Decide who boards.
Write 2–4 sentences: For 'tall enough AND has ticket,' exactly how many of the two must be true for a guest to board? Then a new express lane opens to anyone who is a VIP OR holds a fast pass — how is that 'OR' different from the 'AND' about how many must be true?
01. NOT — Flipping a Boolean
Key Vocabulary (LO AAP-2.F)
| Term | Definition (write it) |
|---|---|
| Logical operator | |
| NOT | |
| AND | |
| OR | |
| Operand |
NOT Reverses One Boolean
- NOT condition evaluates to true exactly when .
- The operand handed to any logical operator must be .
- Applying NOT to a Boolean always .
Flip the Ride's State
rideOpen is false, so NOT rideOpen evaluates to true — the gate should stay shut.
AP Pseudocode (what the exam tests)
rideOpen ← false gateShut ← NOT rideOpen DISPLAY(gateShut)
Python (the runnable version)
ride_open = False gate_shut = not ride_open print(gate_shut)
Output
true
Run and edit this yourself in the coding exercises for this topic.
The NOT Truth Outcomes
NOT reverses whatever Boolean it is given. There are only two possible inputs — complete the result for each.
Complete the empty cells.
| condition | NOT condition |
|---|---|
| true | |
| false |
Stop and think
- isRaining holds false. What does NOT isRaining evaluate to, and why?
- A classmate says 'NOT changes rideOpen from true to false permanently.' Correct the wording — what does NOT actually do to the variable it is given?
- Yesterday you wrote height ≥ 48. Write an expression that is true exactly when a rider is NOT tall enough, and evaluate it for height = 45.
Answer in complete sentences. Then check yourself with the matching CFUs on the Topic 3.5 page.
02. AND and OR — Combining Conditions
AND Needs Both; OR Needs at Least One
- condition1 AND condition2 is true only when .
- condition1 OR condition2 is false only when .
- Because OR is inclusive, it still evaluates to true even when .
The Boarding Rule and the Express Lane
board needs BOTH; skipLine needs EITHER. One line evaluates each to a Boolean.
AP Pseudocode (what the exam tests)
board ← tallEnough AND hasTicket skipLine ← isVIP OR hasFastPass DISPLAY(board)
Python (the runnable version)
board = tall_enough and has_ticket skip_line = is_vip or has_fast_pass print(board)
Output
true
Run and edit this yourself in the coding exercises for this topic.
The AND and OR Truth Table
Two operands, A and B, give four possible combinations. Fill in the missing results — remember AND needs both true and OR needs at least one.
Complete the empty cells.
| A | B | A AND B | A OR B |
|---|---|---|---|
| true | true | true | |
| true | false | true | |
| false | true | false | |
| false | false | false |
AND vs OR
AND — the strict gate
OR — the generous gate
- An AND expression collapses to false the moment .
- An OR expression jumps to true the moment .
AP TIP: AND is hardest to satisfy (needs every operand true); OR is easiest (needs one). Only both-false makes OR false; only all-true makes AND true.
Watch out — “OR Is False When Both Are True”
Myth: condition1 OR condition2 means exactly one of them is true; if BOTH are true, OR evaluates to false.
Explain why this is wrong:
Stop and think
- Evaluate with tallEnough = true, hasTicket = true: tallEnough AND hasTicket. Then change hasTicket to false and evaluate again. What changed and why?
- Evaluate isVIP OR hasFastPass when isVIP = true and hasFastPass = true. State the result and explain why 'both true' does not make OR false.
- Write one expression that is true only when a rider is tall enough AND holds a ticket AND the ride is open. Then evaluate it for tallEnough = true, hasTicket = true, rideOpen = false.
Show every step. Then check yourself with the matching CFUs on the Topic 3.5 page.
Common AP Traps
Three ways Topic 3.5 loses points on the exam — one minute now, real points in May.
≥ and ≤ include the boundary — in your own words:
OR is inclusive — in your own words:
= compares, ← assigns — in your own words:
Boolean Expressions, in One Slide
- A Boolean value is true or false; a comparison with =, ≠, >, <, ≥, or ≤ evaluates to one, and ≥/≤ include the boundary that >/< exclude.
- NOT reverses a single Boolean: NOT condition is true exactly when condition is false.
- AND is true only when both operands are true; OR is true when at least one is true.
- OR is INCLUSIVE — both true still makes OR true; a logical operator's operands are themselves Booleans.
Exit check — I can…
- ☐ write an expression using a relational operator for a stated relationship, choosing ≥/≤ versus >/< correctly (LO AAP-2.E)
- ☐ evaluate a comparison to a single Boolean value, true or false (LO AAP-2.E)
- ☐ write expressions using NOT, AND, and OR to flip or combine Boolean values (LO AAP-2.F)
- ☐ evaluate NOT, AND, and OR expressions, treating OR as inclusive (LO AAP-2.F)
Get in Touch
Whether you're a student, parent, or teacher — I'd love to hear from you.
Just want free AP CS resources?
Enter your email below and check the subscribe box — no message needed. Students get daily practice questions and study tips. Teachers get curriculum resources and teaching strategies.
Message Sent!
Thanks for reaching out. I'll get back to you within 24 hours.
Prefer email? Reach me directly at [email protected]