Course contentsShow
← Computer Science
Lesson 42 of 2,8722. Discrete Mathematics for CSFree lesson

Distributive and Associative Laws

Understand how logical operators combine and how to rearrange complex logical expressions algebraically.

Distributive and Associative Laws

What you'll learn: How to rearrange and regroup logical operators to simplify complex boolean expressions using algebraic-style laws.


The Core Idea

Just like in arithmetic where 3 × (4 + 5) = (3 × 4) + (3 × 5), logical operators follow similar structural patterns. These laws let you rearrange and regroup parts of logical expressions without changing their meaning—making complex propositions easier to work with.

Distributive Law

The distributive law lets you "distribute" one operator over another:

  • AND over OR: P ∧ (Q ∨ R) ≡ (P ∧ Q) ∨ (P ∧ R)
  • OR over AND: P ∨ (Q ∧ R) ≡ (P ∨ Q) ∧ (P ∨ R)

Think of it like handing out copies: if you AND something with a choice (OR), you can instead make the choice between two ANDed versions.

Example: "I need my laptop AND (coffee OR tea)" is the same as "(laptop AND coffee) OR (laptop AND tea)."

Associative Law

The associative law says you can regroup operations of the same type without changing the result:

  • AND: (P ∧ Q) ∧ R ≡ P ∧ (Q ∧ R)
  • OR: (P ∨ Q) ∨ R ≡ P ∨ (Q ∨ R)

The parentheses don't matter when you're chaining the same operator—like addition where (2 + 3) + 4 = 2 + (3 + 4).

Example: "(Sunny AND warm) AND windy" equals "Sunny AND (warm AND windy)."


Why It Matters

These laws are essential for simplifying boolean expressions in circuit design and programming logic. They let you rearrange terms to find equivalent but simpler forms, reducing complexity and computation.

Key Takeaway: The distributive law lets you expand or factor logical expressions, while the associative law lets you regroup same-type operations freely—both preserve logical equivalence.