Venn diagrams and counting with sets · Mathematics… | StemPy Lab
Course 17.1·Lesson 2 of 3
Venn diagrams and counting with sets
A Venn diagram draws sets as overlapping circles inside a rectangle for the universal set. To count with it, fill in the overlap first and work outwards. The rule n(A ∪ B) = n(A) + n(B) − n(A ∩ B) stops the overlap being counted twice. Extended uses three overlapping circles.
about 30 min1 simulation1 practice question2 Python programs5 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.
Lesson 2 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
What you will be able to do
draw and shade a Venn diagram for two sets;
fill in the numbers of a Venn diagram from a problem and answer questions about it;
Extended: do the same with three sets.
A picture of sets
A shop asks 40 customers what they bought. Some bought bread, some bought milk, some bought both and some bought neither. Words are hard to follow here. A picture is easier.
A Venn diagram is a rectangle that stands for the universal set ξ. Inside it, each set is a circle. Where two circles overlap we see the elements that are in both sets.
For two sets the circles make four regions:
only in A;
in both A and B;
only in B;
in neither, outside both circles but inside the rectangle.
Shading
Shading shows a set. Look at the four small diagrams in the figure.
A∪B is both circles, including the overlap.
A∩B is only the overlap.
A′ is everything outside circle A, including the part of B that is outside A.
(A∪B)′ is only the region outside both circles.
Six small Venn diagrams of two overlapping circles A and B in a rectangle. Shaded in turn: both circles together (A union B), only the overlap (A intersection B), everything outside circle A (A complement), the part of A outside B (A intersection B complement), the part of B outside A (A complement intersection B), and only the region outside both circles (A union B, complement).
Two more sets are worth knowing. A∩B′ is the part of A that is not in B, which means "only A". And A′∩B means "only B".
Counting with a Venn diagram
Here is the main rule of the lesson.
Always start with the overlap, then work outwards.
A class has 40 students. Of them, 22 are in the chess club (set C), 17 are in the robotics club (set R) and 9 are in both clubs. How many are in neither?
The overlap. Write 9 where the circles meet.
Only chess.22−9=13.
Only robotics.17−9=8.
Neither. The three numbers inside the circles add up to 13+9+8=30. So 40−30=10 students are in neither club.
A Venn diagram in a rectangle labelled 40 students. Circle C for the chess club holds 13 in its own part, circle R for the robotics club holds 8 in its own part, and the overlap holds 9. The number 10 is written in the rectangle outside both circles. Beside it, the totals n(C) = 22 and n(R) = 17 are listed.
We could also use a rule. The number of students in at least one club is
n(C∪R)=n(C)+n(R)−n(C∩R)=22+17−9=30.
We take away n(C∩R) because the students in both clubs were counted once in n(C) and once again in n(R).
Reading a diagram
When the numbers are already in the diagram, an answer is just an addition. In the clubs example:
n(C)=13+9=22, which includes the overlap;
n(C′)=8+10=18;
n(C∩R′)=13 (chess only).
Watch the difference between "only chess" and "chess". "Chess" means all of circle C.
Extended: three sets
For three sets A, B and C, the circles make eight regions: seven inside the circles and one outside. Fill in the numbers in this order.
The centre,A∩B∩C.
The three pair-overlaps with the centre taken out. For example, "in A and B only" is n(A∩B)−n(A∩B∩C).
The three "only" regions. For example, "only A" is n(A) minus the centre and minus the two pair-overlaps that belong to A.
The outside, from the total.
Twelve students play football, eight play tennis and seven swim, out of 30 in all. Several play more than one sport. The figure shows the regions once they are filled in.
A Venn diagram of three overlapping circles, F for football, T for tennis and S for swimming, inside a rectangle for 30 students. The regions hold: football only 7, tennis only 3, swimming only 3, football and tennis only 2, football and swimming only 1, tennis and swimming only 1, all three 2, and 11 outside all the circles.
You do not have to learn this formula for the exam. Filling in the diagram from the middle outwards gives the same answer, and you can see each step.
Practise with new numbers
Try it in Python
The first program counts the regions of the clubs example. The second counts three sets with Python's own set operations.
Common mistakes
Writing the total of a set in the "only" region. If n(C)=22 and 9 are in both, only chess is 22−9=13, not 22.
Forgetting the outside. The number in neither circle belongs in the rectangle. Without it, the total will not match.
Starting with the outer regions. Start with the overlap, or the centre for three sets.
Shading A′ as only B.A′ includes everything outside circle A, including the outside of both circles.
Remember these
Fill in the overlap first. Then the "only" regions. Then the outside.
n(A∪B)=n(A)+n(B)−n(A∩B).
The numbers in all regions add up to n(ξ).
Extended: three sets have eight regions. Start from the centre.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
In a group of 50 children, 30 like football, 25 like cricket and 8 like neither. How many like both?
In a Venn diagram, n(A∩B)=6, n(A)=15 and n(B)=11. How many elements are in A only, and how many in B only?
Which region is shaded when you shade A′∩B?
Extended. Sixty students study French, Spanish or German. n(F)=25, n(S)=22, n(G)=18, n(F∩S)=8, n(F∩G)=6, n(S∩G)=5 and n(F∩S∩G)=3. How many study at least one language?
Extended. In the same problem, how many students study French and Spanish but not German?
References
Cambridge IGCSE Mathematics 0580 syllabus for 2025, 2026 and 2027, section 1.2: two sets at Core, two or three sets at Extended.
NCERT, Mathematics Textbook for Class XI, Chapter 1, the sections on Venn diagrams and operations on sets.
Enroll free in Sets and Limits of Accuracy
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.