Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right 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 |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
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.NOT (A AND B) = (NOT A) OR (NOT B)NOT (A OR B) = (NOT A) AND (NOT B)NOT (age >= 13 AND age <= 19)
= age < 13 OR age > 19NOT (score >= 50 AND score <= 100)
= score < 50 OR score > 100A = true, B = false
(NOT A) OR (NOT B) gives true