Counting a Union

Add both, then take the overlap off once.

Adding two sets overcounts

A has 12 members and B has 9. How many are in A ∪ B, in A or B or both? Adding gives 12 + 9 = 21, but that is too many whenever the sets overlap.

Here 5 members are in both sets. So A only holds 12 − 5 = 7 and B only holds 9 − 5 = 4, and the union, counted region by region, is 7 + 5 + 4 = 16.

UAB754

A has 7 + 5 = 12 members and B has 5 + 4 = 9. Inside the circles there are 7 + 5 + 4 = 16 members.

The overlap is counted twice

The 12 in A includes the 5 in the overlap, and so does the 9 in B. Adding 12 and 9 counts those 5 members once in A and once again in B: 21 = 7 + 5 + 5 + 4.

UAB754

The overlap shaded: its 5 members are inside A and inside B, so they are in both totals.

Subtract the overlap once

Take the overlap off once, so that every member is counted exactly once: n(A ∪ B) = 12 + 9 − 5 = 16, the same as the count by regions. In symbols, n(A ∪ B) = n(A) + n(B) − n(A ∩ B).

Check on listed sets. With A = {2, 4, 6, 8, 10} and B = {1, 2, 3, 4}, the overlap is {2, 4}, so n(A ∪ B) = 5 + 4 − 2 = 7, and A ∪ B = {1, 2, 3, 4, 6, 8, 10} has 7 elements.

755

the intersection is counted in both totals, so it is subtracted once: |A ∪ B| = |A| + |B| − |A ∩ B|

Make |A ∪ B| = 16

Two sets of 12 and 10. Slide B across A: as the overlap grows by 1, each "only" region shrinks by 1, and the union is always 12 + 10 minus the overlap.

Finding the overlap instead

The same rule finds any one of the four numbers from the other three. In a class, 18 students play a sport. 12 play soccer and 10 play tennis, so n(S ∩ T) = n(S) + n(T) − n(S ∪ T) = 12 + 10 − 18 = 4 play both.

When the sets have nothing in common they are disjoint, n(A ∩ B) = 0, and then n(A ∪ B) = n(A) + n(B). Only then is plain addition right.

Those in neither

Everything in the universal set outside the union is in neither set: n((A ∪ B)') = n(ξ) − n(A ∪ B). If the 12 and 9 come from a universal set of 30, then 30 − 16 = 14 are in neither.

Taking both totals away from 30, 30 − 12 − 9 = 9, is wrong for the same reason as adding them: it takes the 5 in the overlap away twice.

The same rule for probabilities

Dividing every count by the size of the universal set turns the rule into one about probabilities: P(A ∪ B) = P(A) + P(B) − P(A ∩ B). With 30 equally likely outcomes, P(A ∪ B) = 12/30 + 9/30 − 5/30 = 16/30.

Three sets

For three sets, add the three totals and take off the three pair overlaps. That fixes the members in exactly two sets, which were counted twice and are now counted once. But a member of all three was counted 3 times in the totals and taken off 3 times with the pairs, so it is counted 3 − 3 = 0 times. Add the middle back once:

n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(A ∩ C) − n(B ∩ C) + n(A ∩ B ∩ C).

For example, if 30 drink tea, 25 coffee and 20 juice, with 10, 8 and 6 in the pairs and 3 drinking all three, then 30 + 25 + 20 − 10 − 8 − 6 + 3 = 54 drink at least one of them.

Uteacoffeejuice151297533

The three drinks region by region. Tea holds 15 + 7 + 5 + 3 = 30, and the seven regions add to 54, the count the rule gives.

The usual mistakes

Adding the two totals, 12 + 9 = 21. The 5 shared members are counted twice.

Subtracting the overlap twice, 21 − 10 = 11. That removes the shared members completely, but they belong in the union once.

Leaving out the + n(A ∩ B ∩ C) for three sets, which leaves the members of all three uncounted.

Two applications

In the first application below, two mailing lists overlap, and one email goes to every customer on at least one list. The number of emails is the size of the union, and the customers who get none are its complement.

In the second, the number of students taking all three of three languages is unknown. The three-set rule, with the union known, finds it.

Worked example: Two Mailing Lists Merged, So That No Customer Receives the Same Email Twice

Question A shop has 2500 customers on its records. 1240 of them are on the newsletter list A and 860 are on the events list B. 310 customers are on both lists. The shop sends one email to every customer on at least one list, and no customer receives it twice. (a) How many emails does the shop send? (b) Find n((A ∪ B)'), the number of customers who receive no email.

  1. 1.In set notation, n(ξ) = 2500, n(A) = 1240, n(B) = 860 and n(A ∩ B) = 310.

    A newsletterB events2500 customers310n(A) = 1240, n(B) = 860, n(A ∩ B) = 310
    A newsletterB events2500 customers310n(A) = 1240, n(B) = 860, n(A ∩ B) = 310
    The universal set is the 2500 customers, and the 310 on both lists go in the overlap.
  2. 2.Fill the Venn diagram from the overlap outwards. Newsletter only: n(A ∩ B') = 1240 − 310 = 930. Events only: n(A' ∩ B) = 860 − 310 = 550.

    A newsletterB events2500 customers310930550n(A ∩ B') = 1240 − 310 = 930n(A' ∩ B) = 860 − 310 = 550
    A newsletterB events2500 customers310930550n(A ∩ B') = 1240 − 310 = 930n(A' ∩ B) = 860 − 310 = 550
    Take the overlap off each list: 930 on the newsletter list only and 550 on the events list only.
  3. 3.(a) The shop sends one email to each customer in A ∪ B: n(A ∪ B) = 1240 + 860 − 310 = 1790 emails.

    A newsletterB events2500 customers310930550n(A ∪ B) = 1240 + 860 − 310 = 1790
    A newsletterB events2500 customers310930550n(A ∪ B) = 1240 + 860 − 310 = 1790
    (a) n(A ∪ B) = 1240 + 860 − 310 = 1790 emails, one for each customer on at least one list.
  4. 4.Check with the regions: 930 + 310 + 550 = 1790.

    A newsletterB events2500 customers310930550930 + 310 + 550 = 1790
    A newsletterB events2500 customers310930550930 + 310 + 550 = 1790
    The three regions inside the circles add up to the same 1790.
  5. 5.(b) The customers outside both circles are n((A ∪ B)') = 2500 − 1790 = 710.

    A newsletterB events2500 customers310930550neither 710n((A ∪ B)') = 2500 − 1790 = 710
    A newsletterB events2500 customers310930550neither 710n((A ∪ B)') = 2500 − 1790 = 710
    (b) n((A ∪ B)') = 2500 − 1790 = 710 customers receive no email.

Answer: (a) 1790 emails; (b) 710 customers

Common mistakes

  • Sending 1240 + 860 = 2100 emails. The 310 customers on both lists are counted in both totals, so that plan emails each of them twice.
  • Answering (b) with 2500 − 1240 − 860 = 400. Taking both lists away removes the 310 customers on both lists twice; the union, 1790, must be taken away once.

More sets and counting problems, worked step by step →

Worked example: A Survey of Three Languages, Where the Students Taking All Three Are Found from the Totals

Question A school surveyed 120 students about the languages they study. 50 study French, 40 study German and 45 study Spanish. 15 study both French and German, 18 study both French and Spanish, and 12 study both German and Spanish. 24 students study none of the three languages. (a) How many students study all three languages? (b) How many students study exactly one of the three languages?

  1. 1.Let x = n(F ∩ G ∩ S), the number who study all three languages. The students who study at least one language are n(F ∪ G ∪ S) = 120 − 24 = 96.

    FrenchGermanSpanish120 studentsnone 24at least one language: 120 − 24 = 96
    FrenchGermanSpanish120 studentsnone 24at least one language: 120 − 24 = 96
    The students who study at least one language are n(F ∪ G ∪ S) = 120 − 24 = 96.
  2. 2.Write the union by inclusion-exclusion: 96 = 50 + 40 + 45 − 15 − 18 − 12 + x.

    FrenchGermanSpanish120 studentsnone 2496 = 50 + 40 + 45 − 15 − 18 − 12 + x
    FrenchGermanSpanish120 studentsnone 2496 = 50 + 40 + 45 − 15 − 18 − 12 + x
    Inclusion-exclusion: add the three totals, take off the three pair totals, and add back the center x.
  3. 3.Simplify the right-hand side: 96 = 135 − 45 + x = 90 + x, so x = 6. (a) 6 students study all three languages.

    FrenchGermanSpanish120 studentsnone 24696 = 90 + x, so x = 6
    FrenchGermanSpanish120 studentsnone 24696 = 90 + x, so x = 6
    (a) 96 = 90 + x, so x = 6 students study all three languages.
  4. 4.Put 6 in the center of the Venn diagram. Each pair total includes the center, so the regions for exactly two languages are 15 − 6 = 9 (French and German), 18 − 6 = 12 (French and Spanish) and 12 − 6 = 6 (German and Spanish).

    FrenchGermanSpanish120 studentsnone 246912615 − 6 = 9, 18 − 6 = 12, 12 − 6 = 6
    FrenchGermanSpanish120 studentsnone 246912615 − 6 = 9, 18 − 6 = 12, 12 − 6 = 6
    Each pair total includes the center, so take 6 off each: 9, 12 and 6.
  5. 5.Take everything else in each circle away from its total. French only: 50 − 9 − 12 − 6 = 23. German only: 40 − 9 − 6 − 6 = 19. Spanish only: 45 − 12 − 6 − 6 = 21.

    FrenchGermanSpanish120 studentsnone 2469126231921French only: 50 − 9 − 12 − 6 = 23German only: 40 − 9 − 6 − 6 = 19Spanish only: 45 − 12 − 6 − 6 = 21
    FrenchGermanSpanish120 studentsnone 2469126231921French only: 50 − 9 − 12 − 6 = 23German only: 40 − 9 − 6 − 6 = 19Spanish only: 45 − 12 − 6 − 6 = 21
    Take the other regions in each circle away from its total: 23, 19 and 21.
  6. 6.(b) Exactly one language: 23 + 19 + 21 = 63 students. Check: the seven regions add up to 63 + 9 + 12 + 6 + 6 = 96, the number who study at least one language.

    FrenchGermanSpanish120 studentsnone 2469126231921exactly one: 23 + 19 + 21 = 63all seven regions: 96
    FrenchGermanSpanish120 studentsnone 2469126231921exactly one: 23 + 19 + 21 = 63all seven regions: 96
    (b) Exactly one language: 23 + 19 + 21 = 63 students.

Answer: (a) 6 students; (b) 63 students

Common mistakes

  • Adding the three totals and taking off the three pair totals, 135 − 45 = 90, and stopping there. The students in all three sets were counted three times and then taken off three times, so they are not counted at all; the +x puts them back.
  • Writing 15 in the French and German region of the diagram. The 15 students who study French and German include the 6 who also study Spanish, so the region for those two languages only holds 15 − 6 = 9.

More sets and counting problems, worked step by step →

Practice Counting a Union in the app