Putting sets together

Just as num­bers can be added and mul­ti­plied, sets can be com­bined. Union gath­ers every­thing, inter­sec­tion keeps only what is shared, dif­fer­ence takes some­thing away, and the com­ple­ment is what­ever lies out­side. We will define each of these, pic­ture them in Venn dia­grams, prove the main laws (De Mor­gan's among them), and then use the very prac­ti­cal count­ing for­mula n(A∪B)=n(A)+n(B)−n(A∩B)n(A \cup B) = n(A) + n(B) - n(A \cap B).

Oper­a­tions

  • Union A∪B={x:x∈A or x∈B}A \cup B = \{x : x \in A \text{ or } x \in B\}.
  • Inter­sec­tion A∩B={x:x∈A and x∈B}A \cap B = \{x : x \in A \text{ and } x \in B\}. If A∩B=∅A \cap B = \varnothing, AA and BB are dis­joint.
  • Dif­fer­ence A−B={x:x∈A,x∉B}A - B = \{x : x \in A, x \notin B\}.
  • Com­ple­ment A′=U−AA' = U - A.

Exam­ple 1. A={1,3,5,7,9}A = \{1, 3, 5, 7, 9\}, B={3,6,9,12}B = \{3, 6, 9, 12\}: A∪B={1,3,5,6,7,9,12}A \cup B = \{1, 3, 5, 6, 7, 9, 12\}; A∩B={3,9}A \cap B = \{3, 9\}; A−B={1,5,7}A - B = \{1, 5, 7\}; B−A={6,12}B - A = \{6, 12\}.

Exam­ple 2. With U={1,2,…,12}U = \{1, 2, \ldots, 12\} and AA as above, A′={2,4,6,8,10,11,12}A' = \{2, 4, 6, 8, 10, 11, 12\}.

A Venn dia­gram makes all this vis­i­ble. Draw UU as a rec­tan­gle and each set as a cir­cle inside it, then shade the region an oper­a­tion pro­duces. You will notice that A−BA - B, A∩BA \cap B and B−AB - A are three sep­a­rate pieces which, put together, make up A∪BA \cup B.

Venn diagram in U = 1 to 12: A only holds 1, 5, 7; the overlap holds 3, 9; B only holds 6, 12; outside both are 2, 4, 8, 10, 11.
A = {1, 3, 5, 7, 9} and B = {3, 6, 9, 12} inside U = {1, ..., 12}

Laws

  • Com­mu­ta­tive: A∪B=B∪AA \cup B = B \cup A, A∩B=B∩AA \cap B = B \cap A.
  • Asso­cia­tive: (A∪B)∪C=A∪(B∪C)(A \cup B) \cup C = A \cup (B \cup C), like­wise for ∩\cap.
  • Iden­tity: A∪∅=AA \cup \varnothing = A, A∩U=AA \cap U = A.
  • Idem­po­tent: A∪A=AA \cup A = A, A∩A=AA \cap A = A.
  • Dis­trib­u­tive: A∩(B∪C)=(A∩B)∪(A∩C)A \cap (B \cup C) = (A \cap B) \cup (A \cap C) and A∪(B∩C)=(A∪B)∩(A∪C)A \cup (B \cap C) = (A \cup B) \cap (A \cup C).
  • Com­ple­ment: A∪A′=UA \cup A' = U, A∩A′=∅A \cap A' = \varnothing, (A′)′=A(A')' = A, ∅′=U\varnothing' = U.
  • De Mor­gan: (A∪B)′=A′∩B′(A \cup B)' = A' \cap B' and (A∩B)′=A′∪B′(A \cap B)' = A' \cup B'.

Most of these are obvi­ous once you shade them. De Mor­gan's laws are the ones stu­dents tend to mud­dle, so it is worth see­ing why they hold.

Proof of the first De Mor­gan law. Fol­low a sin­gle ele­ment through the chain: x∈(A∪B)′  ⟺  x∉A∪B  ⟺  x∉A and x∉B  ⟺  x∈A′∩B′x \in (A \cup B)' \iff x \notin A \cup B \iff x \notin A \text{ and } x \notin B \iff x \in A' \cap B'.

Exam­ple 3. U={1,…,8}U = \{1, \ldots, 8\}, A={1,2,3,4}A = \{1, 2, 3, 4\}, B={3,4,5,6}B = \{3, 4, 5, 6\}. (A∪B)′={7,8}(A \cup B)' = \{7, 8\}; A′∩B′={5,6,7,8}∩{1,2,7,8}={7,8}A' \cap B' = \{5, 6, 7, 8\} \cap \{1, 2, 7, 8\} = \{7, 8\}. ✓

Count­ing

For finite sets, if you sim­ply add the two counts, the ele­ments lying in both get counted twice. Sub­tract them once and the count comes out right:

n(A∪B)=n(A)+n(B)−n(A∩B)n(A \cup B) = n(A) + n(B) - n(A \cap B)

With three sets the same idea runs one step fur­ther. Take away the pair­wise over­laps, then add back the cen­tre, which those sub­trac­tions removed once too often:

n(A∪B∪C)=n(A)+n(B)+n(C)−n(A∩B)−n(B∩C)−n(A∩C)+n(A∩B∩C).n(A \cup B \cup C) = n(A) + n(B) + n(C) - n(A \cap B) - n(B \cap C) - n(A \cap C) + n(A \cap B \cap C).

Exam­ple 4. In a class of 5050, 3232 take chess, 2121 take car­rom and 99 take both. The num­ber tak­ing at least one is 32+21−9=4432 + 21 - 9 = 44, so 66 take nei­ther, and 2323 take chess only.

Venn diagram of 50 students: 23 take chess only, 9 take both chess and carrom, 12 take carrom only, and 6 take neither.
Chess and car­rom in a class of 50

Exam­ple 5. Of 200200 peo­ple, 9090 read paper PP, 8080 read QQ and 6060 read RR. Also, 3030 read PP and QQ, 2525 read QQ and RR, 2020 read PP and RR, and 1010 read all three. Those read­ing at least one num­ber 90+80+60−30−25−20+10=16590 + 80 + 60 - 30 - 25 - 20 + 10 = 165, which leaves 3535 who read none. A tip for such prob­lems: fill the Venn dia­gram from the cen­tre out­wards, as in the fig­ure.

Three-circle Venn diagram for papers P, Q, R among 200 people: P only 50, Q only 35, R only 25, P and Q only 20, Q and R only 15, P and R only 10, all three 10, none 35.
Read­ers of papers P, Q and R, filled from the cen­tre out­wards

Prac­tice ques­tions

  1. A={2,4,6,8,10}A = \{2, 4, 6, 8, 10\}, B={5,10,15}B = \{5, 10, 15\}. Find A∪BA \cup B, A∩BA \cap B, A−BA - B, B−AB - A.
  2. U={x∈N:x≤10}U = \{x \in \mathbf{N} : x \le 10\}, A={x:x is prime}A = \{x : x \text{ is prime}\}, B={x:x is odd}B = \{x : x \text{ is odd}\}. Find A′A', B′B', (A∪B)′(A \cup B)', A′∩B′A' \cap B'.
  3. Are {x:x is a multiple of 4}\{x : x \text{ is a multiple of } 4\} and {x:x is odd}\{x : x \text{ is odd}\} dis­joint?
  4. Shade in Venn dia­grams: A′∩BA' \cap B; (A∩B)′(A \cap B)'; A−(B∪C)A - (B \cup C).
  5. Ver­ify A∩(B∪C)=(A∩B)∪(A∩C)A \cap (B \cup C) = (A \cap B) \cup (A \cap C) for A={1,2,3,4}A = \{1, 2, 3, 4\}, B={3,4,5}B = \{3, 4, 5\}, C={1,5,6}C = \{1, 5, 6\}.
  6. Prove: A−B=A∩B′A - B = A \cap B'.
  7. Show that A∪B=A∩BA \cup B = A \cap B implies A=BA = B.
  8. n(A)=25n(A) = 25, n(B)=18n(B) = 18, n(A∪B)=36n(A \cup B) = 36. Find n(A∩B)n(A \cap B), n(A−B)n(A - B).
  9. Of 6060 stu­dents, 3838 like tea, 3030 like cof­fee, 66 like nei­ther. How many like both?
  10. In a sur­vey of 400400 fam­i­lies: 210210 own a scooter, 180180 a car, 120120 a cycle; 8080 own scooter and car, 5050 car and cycle, 6060 scooter and cycle, 3030 all three. How many own none?

Answers

Show answers
  1. {2,4,5,6,8,10,15}\{2, 4, 5, 6, 8, 10, 15\}; {10}\{10\}; {2,4,6,8}\{2, 4, 6, 8\}; {5,15}\{5, 15\}.
  2. A={2,3,5,7}A = \{2, 3, 5, 7\}, B={1,3,5,7,9}B = \{1, 3, 5, 7, 9\}: A′={1,4,6,8,9,10}A' = \{1, 4, 6, 8, 9, 10\}; B′={2,4,6,8,10}B' = \{2, 4, 6, 8, 10\}; (A∪B)′={4,6,8,10}(A \cup B)' = \{4, 6, 8, 10\}; A′∩B′={4,6,8,10}A' \cap B' = \{4, 6, 8, 10\}.
  3. Yes.
  4. Dia­grams.
  5. Both sides {1,3,4}\{1, 3, 4\}.
  6. x∈A−B  ⟺  x∈A,x∉B  ⟺  x∈A∩B′x \in A - B \iff x \in A, x \notin B \iff x \in A \cap B'.
  7. If x∈Ax \in A then x∈A∪B=A∩B⊂Bx \in A \cup B = A \cap B \subset B; so A⊂BA \subset B, and sim­i­larly B⊂AB \subset A.
  8. 77; 1818.
  9. 38+30−54=1438 + 30 - 54 = 14.
  10. At least one: 210+180+120−80−50−60+30=350210 + 180 + 120 - 80 - 50 - 60 + 30 = 350; none: 5050.