A hard question on inclusion–exclusion for P5, with a step-by-step solution, diagrams and the answer. Common in the Hua Xia Cup's P3 to P6 qualifying rounds and finals; harder ones have three overlapping groups, or ask who is in exactly two.
The question
The school's lockers are numbered 44 to 170.
Lockers whose number is a multiple of 3 get a red sticker; multiples of 5 get a blue sticker.
A locker that fits both gets both stickers.
How many lockers have at least one sticker?
Show the hints (3)
💡Hint 1: Count the multiples of 3 and of 5 first. Careful: the numbers don't start at 1.
💡Hint 2: Lockers with both stickers are counted twice. Their numbers are multiples of what?
💡Hint 3: Multiples of 3: 42; of 5: 26; of both, i.e. of 15: 9.
Worked solution
Have a go first, then read the solution step by step.
1.Multiples of 3: 56 from 1 to 170, 14 from 1 to 43, so 42.
2.Multiples of 5: 34 from 1 to 170, 8 from 1 to 43, so 26.
3.Multiples of both 3 and 5 are the multiples of 15, their lowest common multiple.
4.Multiples of 15: 11 from 1 to 170, 2 from 1 to 43, so 9.
5.The 9 lockers with both stickers are in both 42 and 26, so take them off once: 42 + 26 − 9 = 59.
⚠️Common mistake: dividing 170 by 3 straight away, forgetting the numbers start at 44.