SET 07 · Set Operations & Venn Diagrams
| Operation | Notation | Definition | Logic |
|---|---|---|---|
| Union | in A or B (or both) | ||
| Intersection | in both A and B | ||
| Difference | in A but not in B | ||
| Complement | (, ) | not in A (within U) | |
| Symmetric difference | in exactly one | → SET 09 Symmetric Difference |
Memory — operations are connectives
∪ = ∨ (cup = or), ∩ = ∧ (cap = and), ’ = ¬, − = “and not”. Any set question can be turned into a logic question.
Venn diagrams
- Rectangle = universal set U. Circles = sets.
- — the lens where circles overlap.
- — both circles fully shaded. It’s the three pieces “only A”, “only B”, “both”.
- — A’s circle minus the overlap (“only A”).
- — everything in the rectangle outside A.
A = {1, 3, 5}, B = {1, 7, 8}
, , ,
A = {1, 3, 5}, B = {1, 2, 3}
. The difference A − B is also called the complement of B relative to A.
Complement
U = positive integers, A = integers > 10 ⇒ . The complement depends on U.
The most useful identity in GATE
Convert every ”−” to ”∩ ’” and you can simplify any expression with the logic laws in SET 08 Set Identities.
Difference is not commutative or associative
(generally). (generally).
⚡ Region method (fast way to compare 3-set expressions)
Three circles split U into 8 regions. Label each by membership (in A? in B? in C?):
| Region | A | B | C | Description |
|---|---|---|---|---|
| 1 | ✓ | ✗ | ✗ | only A |
| 2 | ✗ | ✓ | ✗ | only B |
| 3 | ✗ | ✗ | ✓ | only C |
| 4 | ✓ | ✓ | ✗ | A∩B, not C |
| 5 | ✓ | ✗ | ✓ | A∩C, not B |
| 6 | ✗ | ✓ | ✓ | B∩C, not A |
| 7 | ✓ | ✓ | ✓ | all three |
| 8 | ✗ | ✗ | ✗ | outside all |
To compare two expressions, find which regions each one covers. Same region list ⇒ equal. This is a truth table in disguise: each region is a row.
In A, not B, not C → region 1 only.
Solved problems (slides) — try first
Q1. A = students living within one mile of school = {Mark, Allen, Roy}; B = students who walk to class = {Allen, John, Mark, Henry}. Describe and list:
a)
👁 Show answer
Students who live within a mile or walk = {Mark, Allen, Roy, John, Henry}
b)
👁 Show answer
Live within a mile and walk = {Mark, Allen}
c)
👁 Show answer
Live within a mile but don’t walk = {Roy}
d)
👁 Show answer
Walk but don’t live within a mile = {John, Henry}
Q2. Prove: (a) (b)
👁 Show answer
(a) (b) (distributive)
Q3. Which regions (table above) does each expression shade?
a)
👁 Show answer
The parts of A that overlap B or C: regions 4, 5, 7.
b)
👁 Show answer
Outside all three circles: region 8 only. (Equals by De Morgan.)
c)
👁 Show answer
A − B = {1, 5}, A − C = {1, 4}, B − C = {2, 4} ⇒ union = regions 1, 2, 4, 5. Not shaded: 7 (in all three), 6 (B∩C only), 3 (C only), 8. Compact form: .
GATE 2005 (X = (A−B)−C vs Y = (A−C)−(B−C)) → SET 11 GATE PYQs
Prev ← SET 06 Cartesian Product · Next → SET 08 Set Identities