AP CSA Unit 2.6: De Morgan's Law and Equivalent Expressions Practice

Unit 2, Section 2.6
Day 6 Practice • January 12, 2026
🎯 Focus: De Morgan's Law

Practice Question

Consider the following two boolean expressions:
// Expression 1
!(a && b)

// Expression 2
!a || !b
For which values of a and b do Expression 1 and Expression 2 produce different results?

What This Tests: De Morgan's Law states that !(a && b) is equivalent to !a || !b. These expressions ALWAYS produce the same result for any values of a and b.

De Morgan's Laws

// De Morgan's Laws - MEMORIZE THESE!
!(a && b)  ≡  !a || !b
!(a || b)  ≡  !a && !b

// Memory trick: "Distribute NOT, flip the operator"
// NOT-AND becomes OR-NOT
// NOT-OR becomes AND-NOT

Truth Table Proof

a b !(a && b) !a || !b Same?
T T F F
T F T T
F T T T
F F T T

All rows match! The expressions are logically equivalent.

Practice Technique

When to Use De Morgan's

De Morgan's Law helps simplify complex conditions:

if (!(x > 5 && y < 10))

becomes:

if (x <= 5 || y >= 10)

Difficulty: Medium • Time: 2-3 minutes • AP Skill: 2.B - Equivalent expressions

Ready to Level Up Your AP CSA Skills?

Get personalized help or access our complete question bank

Premium Question Bank - Coming Soon Schedule 1-on-1 Tutoring
Back to blog

Leave a comment

Please note, comments need to be approved before they are published.