Skip to content
Tutorials Center
My learning

Topics

Lesson 62 of 86 ยท Deductive and Analytical Reasoning

Venn Diagrams and Set Problems

Choose the right Venn diagram for a set of items, then solve two-set and three-set overlap problems with inclusion-exclusion and a runnable calculator.

A Venn diagram uses circles to show how groups of things relate. Exams use them in two ways. In the first, you are given three or four words (such as doctors, teachers and women) and must pick the diagram that shows how those groups overlap. In the second, you are given counts, such as how many people like tea, coffee or both, and you must find a missing number.

Both are the same skill: seeing a group as a region of the page. In this lesson you will learn how to choose a diagram from the meaning of the words, how to count with two and three overlapping sets using the inclusion-exclusion formulas, and how to check a survey for impossible numbers. You will run a calculator that fills in every region of a three-circle diagram from the totals.

Choosing a diagram: the four relations

Any two groups are related in exactly one of four ways.

Relation Example Picture
One inside the other Dogs and animals A small circle inside a big one
Overlapping Doctors and women Two circles that cross
Completely separate Cats and dogs Two circles that do not touch
Same group Teachers of mathematics and mathematics teachers One circle (two names)

Ask two questions about each pair of words: "Is every member of one also a member of the other?" (inside) and "Can any member be in both?" (overlap or separate). To handle three words, apply the questions to each pair and then combine the answers into one picture.

flowchart TD
    Q["Take two groups X and Y"] --> A{"Is every X also a Y?"}
    A -->|"Yes"| I["X inside Y"]
    A -->|"No"| B{"Can anything be<br/>both X and Y?"}
    B -->|"Yes"| O["Overlapping circles"]
    B -->|"No"| S["Separate circles"]

Two questions place any pair of groups: inside, overlapping or separate.

Some standard triples worth remembering:

  • Dogs, mammals, animals: three nested circles, because every dog is a mammal and every mammal is an animal.
  • Cats, dogs, rabbits (as pets): three separate circles, with a big circle of "animals" around all three if animals are included.
  • Doctors, women, teachers: three circles overlapping each other, because a person can be any combination.
  • Pen, pencil, stationery: pen and pencil are separate circles, both inside the larger stationery circle.
  • Boys, students, athletes: boys and athletes overlap, and each overlaps the students circle without being inside it, since there are boys who are not students.

You can try the second question on real lists of numbers. The script below compares two sets of whole numbers and names their relation, exactly as you do with words.

JS Name the relation of two sets

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Multiples of 6 sit inside multiples of 3 (every multiple of 6 is a multiple of 3), multiples of 2 and 3 overlap in the multiples of 6, and even and odd numbers never meet. That is the same reasoning you use with "dogs and mammals".

Counting with two sets

When counts are involved, write the numbers in the regions of the diagram. With two groups A and B there are four regions: only A, only B, both, and neither.

The inclusion-exclusion formula for two sets is

n(A or B) = n(A) + n(B) - n(A and B).

You subtract the overlap because adding n(A) and n(B) counts everyone in both circles twice.

Example 1. In a class of 50, 28 play chess, 30 play carrom, and 12 play both. How many play neither, and how many play only chess?

Union = 28 + 30 - 12 = 46. Neither = 50 - 46 = 4. Only chess = 28 - 12 = 16, and only carrom = 30 - 12 = 18. Check: 16 + 18 + 12 + 4 = 50.

Example 2. Of 60 students, 35 study French, 28 study German, and 10 study neither. How many study both?

Union = 60 - 10 = 50. Both = n(A) + n(B) - union = 35 + 28 - 50 = 13.

Example 3. In a group, 60 percent like tea and 70 percent like coffee, and everyone likes at least one. What percent like both?

Union is 100 percent, so both = 60 + 70 - 100 = 30 percent. This is the same method with the union known.

Least and greatest overlap. If nothing is said about "both", the overlap has limits. For 60 percent tea and 70 percent coffee among everyone, the least overlap is 60 + 70 - 100 = 30 percent (everyone likes at least one), and the greatest is 60 percent (all the tea drinkers also like coffee, the smaller group inside the larger).

Counting with three sets

With A, B and C there are eight regions. The formula for the union is

n(A or B or C) = n(A) + n(B) + n(C) - n(A and B) - n(B and C) - n(C and A) + n(A and B and C).

The signs alternate: add the singles, subtract the pairs, add the triple back. This is because the middle region (all three) is added three times by the singles and subtracted three times by the pairs, so it must be added back once.

flowchart LR
    S["Add the three singles"] --> P["Subtract the three pairs"]
    P --> T["Add the triple back"]
    T --> U["Union"]
    U --> N["Neither = total - union"]

The three-set formula in order, ending with the people who belong to none of the groups.

A very common trap is that a pair like n(A and B) includes the people who are also in C. To find the people in only A and B, subtract the triple: only A and B = n(A and B) - n(A and B and C).

The calculator below uses that rule to fill in all eight regions from the given totals. It also flags any negative number, which means the data are impossible.

JS Three-set region calculator

Press Run (or Ctrl + Enter) to see the console output here.

No output.

From the first survey you can answer any question by adding regions. People who like exactly one drink: 27 + 18 + 13 = 58. Those who like at least two drinks: exactly two (27) plus all three (5) = 32. Those who like none: 10. The second run shows how the three-set code behaves as a two-set problem when C is empty. The third shows what an impossible survey looks like: "only A" comes out negative because the pair count 15 is larger than either set.

Reading a three-circle problem step by step

  1. Draw three overlapping circles and label the eight regions.
  2. Fill the center first, the number in all three.
  3. Fill each pair-only region by subtracting the center from each pair total.
  4. Fill each only-one region by subtracting everything else in that circle from the circle's total.
  5. Compute the outside as total minus the sum of all seven regions inside the circles.
  6. Answer the question by adding the right regions, and check the regions add up to the total.

Example 4. In a group of 80, 40 like A, 35 like B and 25 like C. Fifteen like A and B, ten like B and C, twelve like C and A, and five like all three. How many like at least one?

Union = 40 + 35 + 25 - 15 - 10 - 12 + 5 = 68. So 80 - 68 = 12 like none.

Example 5. Using the same data, how many like exactly A and B but not C?

Only A and B = 15 - 5 = 10.

When a problem gives "only", "at least" and "exactly" words, translate each into a sum of regions before calculating. Mixing "at least two" with "exactly two" is the most common slip.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. In a group of 80 people, 50 like pizza, 40 like pasta, and 10 like neither. How many like both?

    Union = 80 - 10 = 70. Both = 50 + 40 - 70 = 20.
  2. 2. Which diagram best represents Dogs, Mammals and Animals?

    Every dog is a mammal and every mammal is an animal, so the circles are nested: dogs inside mammals inside animals.
  3. 3. In a survey, n(A) = 40, n(B) = 35, n(C) = 25, n(A and B) = 15, n(B and C) = 10, n(C and A) = 12 and n(A and B and C) = 5. How many belong to at least one group?

    40 + 35 + 25 - 15 - 10 - 12 + 5 = 68.
  4. 4. In a town, 70 percent of people read newspaper X and 60 percent read newspaper Y. What is the least percent who read both?

    The least overlap occurs when everyone reads at least one: 70 + 60 - 100 = 30 percent.
  5. 5. In the tea, coffee and juice survey (only-A 27, only-B 18, only-C 13, only A and B 15, only B and C 7, only C and A 5, all three 5), how many like at least two drinks?

    Exactly two drinks: 15 + 7 + 5 = 27. Add the 5 who like all three: 27 + 5 = 32.

Summary

  • Any two groups are nested, overlapping, separate or identical; ask whether every member of one is in the other, and whether any member can be in both.
  • For two sets: n(A or B) = n(A) + n(B) - n(A and B).
  • For three sets: add the singles, subtract the pairs, add the triple, then subtract the union from the total to find "neither".
  • Pair totals include the center, so "only two" regions need the triple subtracted.
  • Fill the diagram from the center outward and check that the regions add to the total.
  • Translate "exactly", "only" and "at least" into sums of regions before calculating.

Next: Logical Connectives and Truth Statements, where circles give way to if-then rules and truth tables.