7. Overlapping sets
Two-set formula Total = A + B - Both + Neither, or the 2x2 matrix. Watch divisibility twists.
Core ideas
- Two-set formula: Total = A + B - Both + Neither; adding A and B double-counts the overlap once.
- When items split on TWO yes/no traits, draw a 2x2 matrix; rows and columns must sum to their totals.
- Divisibility twist: multiples of a or b up to N = floor(N/a) + floor(N/b) - floor(N/lcm(a,b)).
- "Only A" means A minus Both; read set language literally before plugging in.
Worked example 1
In a class of 40 students, 25 take French, 18 take Spanish, and 6 take neither. How many take both?
Show solution
Total = F + S - Both + Neither, so 40 = 25 + 18 - Both + 6. That gives 40 = 49 - Both, so Both = 9. Sanity check: only French = 25 - 9 = 16, only Spanish = 18 - 9 = 9, and 16 + 9 + 9 + 6 = 40.
Worked example 2
How many integers from 1 to 200 are divisible by 4 or by 6?
Show solution
Multiples of 4: floor(200/4) = 50. Multiples of 6: floor(200/6) = 33. The overlap is multiples of lcm(4, 6) = 12, not 24: floor(200/12) = 16. Answer: 50 + 33 - 16 = 67. The classic trap is using 4 * 6 = 24 for the overlap; always use the lcm.
Practice set
Question 1
In a class of 40 students, 25 play soccer, 18 play basketball, and 10 play both sports. How many students play neither sport?
Use Total = A + B - Both + Neither and solve for the missing piece.
The number of students who play at least one sport is 25 + 18 - 10 = 33, since the 10 who play both were counted twice. So the number who play neither is 40 - 33 = 7.
Question 2
How many integers from 1 to 100 inclusive are divisible by neither 4 nor 6?
Numbers divisible by both 4 and 6 are exactly the multiples of their least common multiple.
From 1 to 100 there are 25 multiples of 4 and 16 multiples of 6. Multiples of both are multiples of LCM(4,6) = 12, and there are 8 of those. So multiples of 4 or 6 number 25 + 16 - 8 = 33, and 100 - 33 = 67 integers are divisible by neither.
Question 3
At a school of 200 students, 60 percent study French, 45 percent study Spanish, and 15 percent study neither language. How many students study both French and Spanish?
Work in percents first: the two groups plus neither must overshoot 100 percent by exactly the overlap.
In percents, 100 = 60 + 45 - Both + 15, so Both = 120 - 100 = 20 percent. Twenty percent of 200 students is 40.
Question 4
In a club of 150 members, 90 members like jazz and 70 like rock. The number who like both genres is twice the number who like neither. How many members like both jazz and rock?
Let neither = x and both = 2x, then apply the two-set formula.
Let the number who like neither be x, so the number who like both is 2x. Then 150 = 90 + 70 - 2x + x = 160 - x, which gives x = 10. So the number who like both is 2x = 20.