3.1.7 · D3Boolean Algebra & Logic Gates

Worked examples — Boolean algebra laws (commutative, associative, distributive)

2,520 words11 min readBack to topic

The scenario matrix

Think of every problem this topic can hand you as landing in one cell of the table below. Each row is a class of situation; the worked examples afterward are each tagged with the cell they cover.

# Case class What makes it tricky Covered by
C1 Pure commutative re-order spotting a hidden common factor Example 1
C2 Pure associative re-group 2-input gates building a 3-input function Example 2
C3 Distributive forward (AND over OR expand) expanding to reveal cancellation Example 3
C4 Distributive reverse (factoring) fewest-gate goal Example 4
C5 OR-over-AND weird form () the duplicated term Example 5
C6 Degenerate input (a variable forced to or ) law still holds, but collapses Example 6
C7 All same (, ) — limiting/repeat case idempotent edge, easy to mis-simplify Example 7
C8 Chained laws (comm → assoc → dist together) order of moves Example 8
C9 Real-world word problem translate English → algebra Example 9
C10 Exam twist (a trap that looks like a law but isn't) knowing when a law does NOT apply Example 10

We verify every numeric/logical claim below in the checker. Let's go.


Example 1 — C1: Pure commutative re-order


Example 2 — C2: Pure associative re-group

Figure — Boolean algebra laws (commutative, associative, distributive)

Example 3 — C3: Distributive forward (expand to cancel)


Example 4 — C4: Distributive reverse (factor for fewest gates)


Example 5 — C5: OR-over-AND (the duplicated term)


Example 6 — C6: Degenerate input (a variable pinned to a constant)


Example 7 — C7: Repeat / limiting case (, )


Example 8 — C8: Chained laws (comm → assoc → dist)


Example 9 — C9: Real-world word problem


Example 10 — C10: Exam twist (the law that ISN'T there)


Which cell did each example hit?

Scenario matrix

C1 commute -> Ex1

C2 associate -> Ex2

C3 expand -> Ex3

C4 factor -> Ex4

C5 OR over AND -> Ex5

C6 degenerate -> Ex6

C7 repeat -> Ex7

C8 chained -> Ex8

C9 word problem -> Ex9

C10 exam trap -> Ex10


Active Recall

Answer to 1
; raw needs 3 AND + 1 OR = 4 gates, factored needs 1 OR + 1 AND = 2 gates, saving 2.
Answer to 2
— the duplicates into both brackets.
Answer to 3
False; it mixes and , so associativity (same-operator only) cannot apply — you need distributive: .
Answer to 4
(Absorption); .

Connections

  • Parent: the three laws
  • Boolean Algebra Identity & Null Laws (the , , collapses used all over this page)
  • De Morgan's Theorems (the next simplification tool once these run out)
  • Logic Gates AND OR NOT (what the , gates physically are)
  • Karnaugh Maps (automates the factoring you did by hand here)
  • Combinational Circuit Simplification (where the gate-savings pay off)