Sub topic 12
De Morgan's Laws
Assume you know basic set notation, complements, unions, intersections, and two-set Venn diagrams. De Morgan's laws help you simplify statements involving “not,” “or,” and “and.” They are especially useful when a CAT question describes people who do not belong to one or more groups.
The two laws
Let \(U\) be the universal set, and let \(A\) and \(B\) be subsets of \(U\).
The first law is:
\[ (A \cup B)^c = A^c \cap B^c \]
Read this as:
> The complement of “\(A\) or \(B\)” is “not \(A\) and not \(B\).”
The second law is:
\[ (A \cap B)^c = A^c \cup B^c \]
Read this as:
> The complement of “\(A\) and \(B\)” is “not \(A\) or not \(B\).”
The complement is always taken relative to the universal set. Thus, \(A^c\) contains every element in \(U\) that is not in \(A\).
| Original statement | Equivalent statement |
|---|---|
| Not in \(A\) or \(B\) | Not in \(A\) and not in \(B\) |
| Not in both \(A\) and \(B\) | Not in \(A\) or not in \(B\) |
The important pattern is that taking a complement changes the operation:
- Union \(\cup\) changes to intersection \(\cap\).
- Intersection \(\cap\) changes to union \(\cup\).
- Each set is replaced by its complement.
Understanding the first law
Suppose \(A\) is the set of students who study Algebra and \(B\) is the set who study Geometry.
The set \(A \cup B\) contains students who study at least one of the two subjects. Therefore, \((A \cup B)^c\) contains students who study neither subject.
That is exactly the same as being outside \(A\) and outside \(B\):
\[ (A \cup B)^c = A^c \cap B^c \]
In a Venn diagram, \(A \cup B\) shades both circles and their overlap. Its complement shades the region outside both circles.
Understanding the second law
The set \(A \cap B\) contains students who study both subjects. Its complement contains everyone who does not study both.
A student is not in both sets if the student is outside \(A\), outside \(B\), or outside one of them. Therefore:
\[ (A \cap B)^c = A^c \cup B^c \]
This includes the “only \(A\)” region, the “only \(B\)” region, and the region outside both sets.
U = set(range(1, 9))
A = {1, 2, 3, 4}
B = {3, 4, 5}
left_one = U - (A | B)
right_one = (U - A) & (U - B)
left_two = U - (A & B)
right_two = (U - A) | (U - B)
print(left_one == right_one, left_one)
print(left_two == right_two, left_two)The program uses U - A to find the complement of \(A\) within \(U\). Both comparisons print True.
Visual pattern
CAT application
If a survey has 100 people, and \(A\) represents people who use app A while \(B\) represents people who use app B, then:
- “Use neither app” means \((A \cup B)^c\).
- “Do not use both apps” means \((A \cap B)^c\).
These statements are different. “Neither” excludes both sets. “Not both” allows people who use exactly one app.
Exercise
If U has 80 elements, n(A) = 45, n(B) = 30, and n(A ∪ B) = 60, find n((A ∪ B)ᶜ) and describe it in words.
Show answer
n((A ∪ B)ᶜ) = 80 − 60 = 20. It represents the elements that are in neither A nor B.