Lesson 3 of 42 · Numbers and sets

Sets, Venn diagrams and counting overlaps

Use set notation for union, intersection, complement and Cartesian product, and count overlapping groups in two and three sets without double counting.

About 22 minutes

In this lesson

  • Read and apply inclusion, union, intersection, difference, complement and Cartesian product.
  • Count the elements of a union of two or three sets with inclusion and exclusion.
  • Fill a Venn diagram from the inside out to answer "only", "exactly" and "neither" questions.

The idea

The notation

A set is a collection of distinct objects, its elements. x∈Ax \in A means xx belongs to AA; ∣A∣\lvert A \rvert (or n(A)n(A)) is the number of elements of a finite set. The universe UU is the set of everything under discussion.

Symbol Meaning With A={1,2,3,4}A = \{1, 2, 3, 4\}, B={3,4,5}B = \{3, 4, 5\}, U={1,…,6}U = \{1, \dots, 6\}
A⊆BA \subseteq B every element of AA is in BB false: 1∈A1 \in A but 1∉B1 \notin B
A∪BA \cup B in AA or BB (or both) {1,2,3,4,5}\{1, 2, 3, 4, 5\}
A∩BA \cap B in both AA and BB {3,4}\{3, 4\}
A∖BA \setminus B in AA but not in BB {1,2}\{1, 2\}
A‾\overline{A} (also AcA^c) in UU but not in AA {5,6}\{5, 6\}
A×BA \times B all ordered pairs (a,b)(a, b) with a∈Aa \in A, b∈Bb \in B 12 pairs, from (1,3)(1, 3) to (4,5)(4, 5)

The empty set ∅\varnothing has no elements and is a subset of every set. Every set is a subset of itself. A set with nn elements has 2n2^n subsets, because each element is either in or out of a subset, independently; the count includes ∅\varnothing and the set itself.

The Cartesian product has ∣A×B∣=∣A∣⋅∣B∣\lvert A \times B \rvert = \lvert A \rvert \cdot \lvert B \rvert elements, and order matters: (1,3)∈A×B(1, 3) \in A \times B, while (3,1)(3, 1) belongs to B×AB \times A.

The complement depends on the universe. "Not English" among 120 students is a different set from "not English" among all the students in a school. Name UU before taking any complement.

Two useful laws

De Morgan's laws say that the complement of a union is the intersection of the complements, and the other way round:

A∪B‾=A‾∩B‾,A∩B‾=A‾∪B‾.\overline{A \cup B} = \overline{A} \cap \overline{B}, \qquad \overline{A \cap B} = \overline{A} \cup \overline{B}.

In words: "not (A or B)" is "neither A nor B"; "not (A and B)" is "not A, or not B". These let you count a "neither" group as ∣U∣−∣A∪B∣\lvert U \rvert - \lvert A \cup B \rvert.

Also, A∖B=A∩B‾A \setminus B = A \cap \overline{B}, and AA splits into two disjoint pieces: A=(A∖B)∪(A∩B)A = (A \setminus B) \cup (A \cap B). That split is the idea behind every Venn diagram count.

Intervals are sets too

Sets of real numbers are often intervals, and the same operations apply. With A=[−2,3)A = [-2, 3) and B=(1,5]B = (1, 5]: A∩B=(1,3)A \cap B = (1, 3), A∪B=[−2,5]A \cup B = [-2, 5], A∖B=[−2,1]A \setminus B = [-2, 1]. Draw both on one number line and read off the result, paying attention to which endpoints are included.

Counting a union: inclusion and exclusion

Adding ∣A∣\lvert A \rvert and ∣B∣\lvert B \rvert counts the elements of A∩BA \cap B twice, so subtract them once:

∣A∪B∣=∣A∣+∣B∣−∣A∩B∣.\lvert A \cup B \rvert = \lvert A \rvert + \lvert B \rvert - \lvert A \cap B \rvert.

For three sets, the pairwise overlaps are subtracted, but that removes the triple overlap once too often, so it is added back:

∣A∪B∪C∣=∣A∣+∣B∣+∣C∣−∣A∩B∣−∣A∩C∣−∣B∩C∣+∣A∩B∩C∣.\lvert A \cup B \cup C \rvert = \lvert A \rvert + \lvert B \rvert + \lvert C \rvert - \lvert A \cap B \rvert - \lvert A \cap C \rvert - \lvert B \cap C \rvert + \lvert A \cap B \cap C \rvert.

Filling a Venn diagram from the inside out

When a question asks for "only A", "exactly two" or "neither", draw the diagram and fill it from the innermost region outwards. With two sets there are four regions: only AA, only BB, both, and neither. With three sets there are eight: the centre (all three), three "exactly two" regions, three "only one" regions, and the outside.

  1. Write the triple overlap in the centre.
  2. For each pair, subtract the centre from the pair's total to get "these two only".
  3. For each set, subtract its three inner regions from its total to get "this one only".
  4. Subtract everything inside the circles from ∣U∣\lvert U \rvert to get "neither".

Then add all eight regions; they must give ∣U∣\lvert U \rvert. That final sum is a built-in check.

Reading the wording

"Studies French" includes those who also study German; "studies only French" does not. "At least one" is the union; "exactly one" excludes every overlap; "at most one" includes "neither". Most wrong answers in set questions come from reading one of these as another.

Worked examples

Example 1: Two overlapping groups

Of 120 students, 70 study English, 50 study Spanish and 25 study both. How many study neither language, and how many study only English?

  1. At least one language: ∣E∪S∣=70+50−25=95\lvert E \cup S \rvert = 70 + 50 - 25 = 95.

  2. Neither: 120−95=25120 - 95 = 25.

  3. Only English: 70−25=4570 - 25 = 45. Only Spanish: 50−25=2550 - 25 = 25.

  4. Check the four regions add up: 45+25+25+25=12045 + 25 + 25 + 25 = 120.

Answer

25 study neither and 45 study only English. Forgetting the overlap gives 120−120=0120 - 120 = 0 for "neither", which is the classic double count.

Example 2: Three overlapping groups

A shop surveyed 100 customers. 45 bought product AA, 40 bought BB and 30 bought CC; 15 bought AA and BB, 10 bought AA and CC, 8 bought BB and CC, and 5 bought all three. How many bought none, and how many bought exactly one product?

  1. Union by inclusion and exclusion: 45+40+30−15−10−8+5=8745 + 40 + 30 - 15 - 10 - 8 + 5 = 87. So 100−87=13100 - 87 = 13 bought none.

  2. Fill from the centre: all three is 5. Exactly AA and BB: 15−5=1015 - 5 = 10; exactly AA and CC: 10−5=510 - 5 = 5; exactly BB and CC: 8−5=38 - 5 = 3.

  3. Only AA: 45−10−5−5=2545 - 10 - 5 - 5 = 25. Only BB: 40−10−3−5=2240 - 10 - 3 - 5 = 22. Only CC: 30−5−3−5=1730 - 5 - 3 - 5 = 17. Exactly one: 25+22+17=6425 + 22 + 17 = 64.

  4. Check: 64+(10+5+3)+5+13=64+18+5+13=10064 + (10 + 5 + 3) + 5 + 13 = 64 + 18 + 5 + 13 = 100.

Answer

13 bought none and 64 bought exactly one. Subtracting the pairwise totals without adding the centre back gives "only AA" as 45−15−10=2045 - 15 - 10 = 20, which removes the 5 triple buyers twice.

Example 3: Operations on a small universe

Let U={1,2,…,10}U = \{1, 2, \dots, 10\}, AA the even numbers in UU and BB the multiples of 3 in UU. Find A∩BA \cap B, A∪B‾\overline{A \cup B}, A∖BA \setminus B and ∣A×B∣\lvert A \times B \rvert.

  1. List the sets: A={2,4,6,8,10}A = \{2, 4, 6, 8, 10\} and B={3,6,9}B = \{3, 6, 9\}. So A∩B={6}A \cap B = \{6\}.

  2. A∪B={2,3,4,6,8,9,10}A \cup B = \{2, 3, 4, 6, 8, 9, 10\}, so its complement in UU is {1,5,7}\{1, 5, 7\}.

  3. Check with De Morgan: A‾={1,3,5,7,9}\overline{A} = \{1, 3, 5, 7, 9\} and B‾={1,2,4,5,7,8,10}\overline{B} = \{1, 2, 4, 5, 7, 8, 10\}; their intersection is {1,5,7}\{1, 5, 7\}, the same.

  4. A∖B={2,4,8,10}A \setminus B = \{2, 4, 8, 10\}, and ∣A×B∣=5⋅3=15\lvert A \times B \rvert = 5 \cdot 3 = 15.

Answer

A∩B={6}A \cap B = \{6\}, A∪B‾={1,5,7}\overline{A \cup B} = \{1, 5, 7\}, A∖B={2,4,8,10}A \setminus B = \{2, 4, 8, 10\}, ∣A×B∣=15\lvert A \times B \rvert = 15. Answering 8 for the product, 5+35 + 3, confuses pairs with a list of elements.

Common traps

  • Double counting the overlap

    ∣A∣+∣B∣\lvert A \rvert + \lvert B \rvert counts the members of both sets twice. Whenever groups can overlap, subtract the intersection, or fill a diagram region by region.

  • Forgetting to add back the triple overlap

    With three sets, each pairwise total already contains the people in all three. Subtracting all three pairwise totals removes them three times after they were added three times, so add the triple overlap back once. In a diagram, always start from the centre.

  • Reading "A" as "only A"

    "40 bought BB" includes everyone who also bought something else. If a question asks how many bought only BB, you must subtract the overlaps; if it asks how many bought BB, you must not.

  • Adding instead of multiplying for a Cartesian product

    A×BA \times B is a set of pairs, so it has ∣A∣⋅∣B∣\lvert A \rvert \cdot \lvert B \rvert elements, not ∣A∣+∣B∣\lvert A \rvert + \lvert B \rvert. Its subsets number 2∣A∣⋅∣B∣2^{\lvert A \rvert \cdot \lvert B \rvert}.

Check yourself

Answer each question before you open its answer.

Question 1: Players of both sports

Sets

In a class of 40 students, 22 play football, 17 play tennis and 6 play neither sport. How many play both?

  1. A.11
  2. B.55
  3. C.66
  4. D.1717
Show the answer

Answer: B. 55

Working

Students who play at least one sport: 40−6=3440 - 6 = 34. By inclusion and exclusion, 34=22+17−both34 = 22 + 17 - \text{both}, so both =39−34=5= 39 - 34 = 5. Check: only football 17, only tennis 12, both 5, neither 6, total 40.

Why the other options are wrong

  • A. This computes 40−22−17=140 - 22 - 17 = 1, which ignores the 6 students who play neither sport. The overlap is the sum of the two groups minus the union: 39−3439 - 34.
  • C. This confuses the students who play neither sport with those who play both.
  • D. This assumes every tennis player also plays football. That is the largest the overlap could be, not what the numbers give.

What carries over

Find the union first from the total and the "neither" group, then the overlap is the sum of the sets minus the union.

Question 2: Exactly one of three

Sets

Of 60 people, 25 read paper XX, 20 read YY and 18 read ZZ. 7 read XX and YY, 6 read XX and ZZ, 5 read YY and ZZ, and 2 read all three. How many read exactly one paper?

  1. A.1313
  2. B.2727
  3. C.3333
  4. D.4747
Show the answer

Answer: C. 3333

Working

Centre: 2. Exactly two: 7−2=57 - 2 = 5, 6−2=46 - 2 = 4, 5−2=35 - 2 = 3. Only XX: 25−5−4−2=1425 - 5 - 4 - 2 = 14; only YY: 20−5−3−2=1020 - 5 - 3 - 2 = 10; only ZZ: 18−4−3−2=918 - 4 - 3 - 2 = 9. Exactly one: 14+10+9=3314 + 10 + 9 = 33. Check: the union is 25+20+18−7−6−5+2=4725 + 20 + 18 - 7 - 6 - 5 + 2 = 47, and 33+12+2=4733 + 12 + 2 = 47.

Why the other options are wrong

  • A. This is the number who read no paper, 60−4760 - 47.
  • B. This finds each "only" region by subtracting the two pairwise totals without adding back the 2 who read all three, so they are removed twice from each paper.
  • D. This is the number who read at least one paper, which also counts those who read two or three.

What carries over

For "exactly" questions with three sets, fill the diagram from the centre outwards and check that the regions add up to the union.

Question 3: Subsets of a Cartesian product

Sets

Let A={1,2,3}A = \{1, 2, 3\} and B={a,b}B = \{a, b\}. How many subsets does A×BA \times B have?

  1. A.55
  2. B.66
  3. C.3232
  4. D.6464
Show the answer

Answer: D. 6464

Working

A×BA \times B has 3⋅2=63 \cdot 2 = 6 ordered pairs. A set with 6 elements has 26=642^6 = 64 subsets, counting the empty set and the whole set.

Why the other options are wrong

  • A. This adds ∣A∣+∣B∣\lvert A \rvert + \lvert B \rvert and then stops: it is neither the size of the product nor a count of subsets.
  • B. This is the number of elements of A×BA \times B, not the number of its subsets.
  • C. This is 252^5, built on the wrong size ∣A∣+∣B∣=5\lvert A \rvert + \lvert B \rvert = 5 for the product.

What carries over

∣A×B∣=∣A∣⋅∣B∣\lvert A \times B \rvert = \lvert A \rvert \cdot \lvert B \rvert, and a set of nn elements has 2n2^n subsets.

Key points

  • ∣A∪B∣=∣A∣+∣B∣−∣A∩B∣\lvert A \cup B \rvert = \lvert A \rvert + \lvert B \rvert - \lvert A \cap B \rvert; for three sets, subtract the pairs and add back the triple.

  • Fill Venn diagrams from the centre outwards, and check that the regions add up to the whole.

  • The complement depends on the universe; "neither" is ∣U∣−∣A∪B∣\lvert U \rvert - \lvert A \cup B \rvert.

  • ∣A×B∣=∣A∣⋅∣B∣\lvert A \times B \rvert = \lvert A \rvert \cdot \lvert B \rvert, and a set of nn elements has 2n2^n subsets.

All questions here are original and written for UniExamer; none comes from the test maker.

Written by the UniExamer team with AI assistance. Every worked example and check question was re-solved by an independent checker before publication. No subject expert has reviewed this lesson yet. If you find a mistake, write to support@uniexamer.com.

Practise this topic

Fresh questions on this skill, with worked explanations. Practice needs a Single Exam Pass or Plus.