Negating compound conditions

Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.

Negating compound conditions

Name:
Date:
Class:

Quick Questions

Shade in the A or B circle for each question.

1. Which is equivalent to NOT (A AND B)?
A (NOT A) OR (NOT B)
B (NOT A) AND (NOT B)
2. Which is equivalent to NOT (A OR B)?
A (NOT A) AND (NOT B)
B (NOT A) OR (NOT B)
3. When you negate a compound condition using De Morgan's law, what happens to the AND or OR?
A It stays the same
B It is swapped (AND becomes OR, OR becomes AND)
4. A game lets you in if age >= 13 AND hasTicket = true. Which condition means the player is turned away?
A age < 13 OR hasTicket = false
B age < 13 AND hasTicket = false
5. Which condition is the negation of the range check x >= 1 AND x <= 10?
A x < 1 AND x > 10
B x < 1 OR x > 10

Match the Pairs

Draw a line connecting each item on the left to its match on the right.

Left columnRight column
1NOT (A AND B) = (NOT A) OR (NOT B) AThe OR was not swapped for AND when negating the condition.
2NOT (A OR B) = (NOT A) AND (NOT B) BNegating an OR: flip each part and swap OR for AND
3The opposite of the range check 'age >= 13 AND age <= 17' (a teen) is 'not a teen' CA=T, B=F: NOT (A AND B) = T and (NOT A) OR (NOT B) = T
4A truth table proves two conditions are equivalent when their output columns match on every row DThe AND was not swapped for OR. Negating each part is not enough on its own.
5NOT (A AND B) = (NOT A) AND (NOT B) ENegating an AND: flip each part and swap AND for OR
6NOT (score >= 50 OR score <= 90) = score < 50 OR score > 90 Fage < 13 OR age > 17

Definitions

NOT (A AND B) = (NOT A) OR (NOT B)

Fill in the Blanks

Complete each line of code by filling in the missing parts.

1.
NOT (A AND B) = (NOT A) __ (NOT B)
2.
NOT (A OR B) = (NOT A) ___ (NOT B)
3.
NOT (age >= 13 AND age <= 19) = age < 13 __ age > 19
4.
NOT (score >= 50 AND score <= 100) = score < 50 OR score _ 100
5.
A = true, B = false (NOT A) OR (NOT B) gives ____

Spot the Error

Shade in the letter of the line that contains an error.

Question 1
A A <- true
B B <- false
C swapped <- (NOT A) AND (NOT B)
D negated <- NOT (A AND B)
E print negated = swapped
Question 2
A // Neither: NOT (x OR y)
B if (NOT x) OR (NOT y) then
C print 'neither x nor y'
D end if
Question 3
A input n
B inside <- n >= 0 AND n <= 100
C outside <- NOT inside
D alt <- n < 0 AND n > 100
E print outside = alt
Question 4
A input a
B input b
C if a > 5 AND b >= 2 then
D print 'NOT (a>5 OR b<2)'
E end if
Question 5
A A=T, B=F: A AND B = true
B NOT (A AND B) = true
C (NOT A) OR (NOT B) = true
D Both true, so they are equal

Answer Key

Negating compound conditions
Section A: Quick Questions
Q1
A — (NOT A) OR (NOT B)
Q2
A — (NOT A) AND (NOT B)
Q3
B — It is swapped (AND becomes OR, OR becomes AND)
Q4
A — age < 13 OR hasTicket = false
Q5
B — x < 1 OR x > 10
Section B: Match the Pairs
Q1
NOT (A AND B) = (NOT A) OR (NOT B) → Negating an AND: flip each part and swap AND for OR
Q2
NOT (A OR B) = (NOT A) AND (NOT B) → Negating an OR: flip each part and swap OR for AND
Q3
The opposite of the range check 'age >= 13 AND age <= 17' (a teen) is 'not a teen' → age < 13 OR age > 17
Q4
A truth table proves two conditions are equivalent when their output columns match on every row → A=T, B=F: NOT (A AND B) = T and (NOT A) OR (NOT B) = T
Q5
NOT (A AND B) = (NOT A) AND (NOT B) → The AND was not swapped for OR. Negating each part is not enough on its own.
Q6
NOT (score >= 50 OR score <= 90) = score < 50 OR score > 90 → The OR was not swapped for AND when negating the condition.
Section C: Definitions
Q1
NOT (A AND B) = (NOT A) OR (NOT B) — De Morgan's law: to negate a compound condition, negate each part and swap AND for OR. Likewise NOT (A OR B) = (NOT A) AND (NOT B). A truth table can prove they match.
Section D: Fill in the Blanks
Q1
NOT (A AND B) = (NOT A) OR (NOT B)
Q2
NOT (A OR B) = (NOT A) AND (NOT B)
Q3
NOT (age >= 13 AND age <= 19) = age < 13 OR age > 19
Q4
NOT (score >= 50 AND score <= 100) = score < 50 OR score > 100
Q5
A = true, B = false (NOT A) OR (NOT B) gives true
Section E: Spot the Error
Q1
C — By De Morgan's law, NOT (A AND B) equals (NOT A) OR (NOT B). Negating each part is not enough, because AND must also swap to OR. Line 3 should use OR.
Q2
B — NOT (x OR y) equals (NOT x) AND (NOT y). Both x and y must be false, so the OR must swap to AND.
Q3
D — Negating the range check n >= 0 AND n <= 100 gives n < 0 OR n > 100. A number cannot be below 0 and above 100 at once, so AND would never be true. It should be OR.
Q4
C — NOT (a > 5 OR b < 2) becomes (NOT a > 5) AND (NOT b < 2), which is a <= 5 AND b >= 2. The first part was not negated. It should be a <= 5.
Q5
A — In the truth table row where A is true and B is false, A AND B is false because both inputs must be true. The line should say A AND B = false. Then NOT (A AND B) is true, matching the other side.