Combinatorics
Senior 4 · Mathematics
Combinatorics
Lesson 1 of 5
25 min
A class teacher in Musanze has a list of 45 students. 28 belong to the football club, 20 to the debate club, and 9 belong to both. How many students belong to neither club? Adding 28 and 20 gives 48, more than the whole class: the 9 students in both clubs have been counted twice. Combinatorics is the mathematics of counting correctly, without listing every case and without counting anything twice. Its results are the raw material of probability, where you will divide one count by another. This lesson uses three tools that make a count visible: the Venn diagram, the tree diagram and the table.
Definition
Number of elements: for a finite set , is the number of elements in .
Addition principle: if and have no element in common (), then .
Inclusion–exclusion principle for any two finite sets:
Example: for the clubs, , so students belong to neither.
A Venn diagram shows every region at once. Fill it from the inside out: first the intersection (9), then each "only" region ( and ), and last the region outside both circles ().
For three sets the same reasoning gives
The elements in all three sets are added three times and subtracted three times, which is why the last term adds them back once.

Worked example 1: three crops
In a survey of 100 farmers in one sector (illustrative data), 60 grow beans (B), 45 grow maize (M) and 30 grow cassava (C); 20 grow beans and maize, 12 beans and cassava, 10 maize and cassava, and 5 grow all three. How many farmers grow none of these crops, and how many grow exactly one?
Solution
so farmers grow none. Filling the diagram from the centre: exactly two crops: only , only , only . Then one crop only: beans , maize , cassava .
Exactly one crop: farmers. Check: . ✓
When an experiment happens in stages, a tree diagram lists every outcome in order: each stage adds a column of branches, and each path from the root to a tip is one outcome. A canteen that offers a lunch of one starch (rice, cassava bread or plantain) with one sauce (beans or peas) has a tree with 3 branches, each splitting into 2, so different meals.
Trees are most useful when the stages are not all the same. In a best-of-three match, the match stops as soon as one team has won two games:
Worked example 2: reading the tree
Use the tree to find (a) the number of different ways the match can go, (b) the number in which team A wins, (c) the number that need all three games.
Solution
Notice that is not : two branches stop early. A tree handles this kind of count safely; a quick multiplication does not.
For two stages with many choices, a table is neater than a tree. Throwing a red die and a blue die gives outcomes; the table shows each sum:
| Red ↓ Blue → | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 2 | 3 | 4 | 5 | 6 | 7 | 8 |
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 4 | 5 | 6 | 7 | 8 | 9 | 10 |
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
The 5 shaded cells give a sum of 8: (2, 6), (3, 5), (4, 4), (5, 3) and (6, 2). A table also makes it easy to see that a sum of 7 happens in 6 ways, more than any other sum.
A contingency table (two-way table) counts a group classified in two ways at once. A school's 160 S4 students, by pathway and sex (illustrative data):
| Pathway | Girls | Boys | Total |
|---|---|---|---|
| Sciences | 34 | 41 | 75 |
| Humanities | 28 | 17 | 45 |
| Languages | 22 | 18 | 40 |
| Total | 84 | 76 | 160 |
Worked example 3: counting from a contingency table
From the table, how many students (a) are girls in Sciences, (b) are girls or in Sciences, (c) are boys not in Sciences?
Solution
Every row total and column total must add up to the grand total 160; check this before you use any table.
Warning
Double counting. "28 play football and 20 debate" does not mean 48 students. Whenever two groups can overlap, ask "how many are in both?" and subtract it once. In a three-set problem, a common slip is to put straight into the "beans and maize only" region; first subtract the farmers who grow all three.
Tip
Choose the tool to fit the problem: a Venn diagram for overlapping groups, a tree for stages (especially when they stop early or change), and a table for two stages with many choices, or a group sorted two ways.
Teacher E: Table, Tree Diagram, Systematic Listing and Fundamental Counting Principle. Watch how the same set of outcomes is listed with a table, a tree and a systematic list, and how the three counts agree.
Practice
Try each one before opening the answers. They get harder as you go.
Key points
Sources and credits
Quick check
n(A) = 18, n(B) = 15 and n(A ∩ B) = 6. What is n(A ∪ B)?