C26 · Topic 3.5 · 40 minutes · AAP-2.E, AAP-2.F
Combining conditions
By the end you can:
- Evaluate AND,OR and NOT.
- Translate a rule with multiple requirements.
- Construct an equivalent negated condition.
Before this lesson: topics 3.1, 3.3.
- Boolean
- A true/false value.
- Logical expression
- An expression combining Boolean values with operations such as AND,OR and NOT.
Understand
AND requires both parts true; OR requires at least one part true and includes the case where both are true. NOT reverses a Boolean value. Evaluate the component comparisons explicitly when debugging, because a passing result can conceal a wrong operator for other combinations.
A compound rule should match the intended set of inputs. Negating a conjunction changes AND to OR and negates each component:NOT(A AND B)is equivalent to(NOT A)OR(NOT B). Use a complete small truth table rather than relying on one example or on informal everyday meanings of “or”.
Worked example
Compare age≥14 AND places>0 with a faulty OR version.
- (13,2):false AND true is false, but OR gives true.
- (14,0):true AND false is false, but OR again gives true.
- (14,1):both give true, so that case alone cannot expose the defect.
Explore each concept
Choose a concept, change its inputs and follow the explanation. Each example models the stated rule or scenario; completing it is practice rather than evidence of mastery.
- All six relational operators
- AND, OR and NOT
- De Morgan equivalence and assignment
Change it · step through · explain
Change an input, predict what will happen, then advance one step. Read why the state changes, reset and experiment. This fixed teaching model does not save progress or award XP.
Ready · Make a prediction
- a (0–100)14Waiting
- b (0–100)14Waiting
- ExplorerelationsWaiting
Ready to explore: Relations, truth tables and NOT
Why: Change an input, predict the first effect, then advance one step.
Try this: Change one input or choose another listed case. Predict the effect, reset and compare the states and governing rule.
Step through and experiment
Change it · step through · explain
Change an input, predict what will happen, then advance one step. Read why the state changes, reset and experiment. This fixed teaching model does not save progress or award XP.
Ready · Make a prediction
- Input 114Waiting
- Input 20Waiting
Ready to experiment
Why: Predict the first change, then advance one step.
Try this: Compare ages 13 and 14 with places 0 and 1.
Check a misconception
Claim: OR means exactly one part is true.
Logical OR is inclusive: it is also true when both parts are true.
Guided practice
Write the ineligible condition equivalent to NOT(age≥14 AND places>0).
Work with a partner. Make a prediction, compare your reasoning, then identify the rule that supports your answer.
Independent transfer
A free ticket requires member true and unpaid false. Write the condition and give a failing counterexample to OR.
Exit check
Why should a test suite include cases with exactly one true component?
Write your reasoning before comparing with a classmate. If your teacher assigned this task, submit it through My classes to save your work and receive feedback.
Check yourself
Your practice so far
Check an answer to see its rationale.