Sub topic 3
Three-set Venn diagrams and inclusion-exclusion
This chapter assumes you can compute factorials, permutations, and combinations, and that you can use the complement method to count "at least one" cases.
Three-set overlaps
For three sets A, B, and C, the union counts each element in at least one set exactly once. Add the three single sets, subtract the three pairwise overlaps, then add back the triple overlap. The triple overlap was subtracted three times, so it needs one correction.
a, b, c = 30, 25, 20
ab, ac, bc = 10, 8, 6
abc = 4
union = a + b + c - ab - ac - bc + abc
print(union) # 55Splitting items into unlabeled groups
When groups have no names, swapping two groups produces the same split. Count the labeled splits, then divide by the number of ways to reorder the groups. For example, splitting 6 people into two teams of 3 gives C(6,3) = 20 labeled choices. Each split appears twice, so the answer is 10.
import math
print(math.comb(6, 3) // 2) # 10Circular arrangements
Seats around a round table are equivalent when rotated. Fix one person in place, then arrange the others in a line. For n people, the count is (n - 1)!. Five people give 4! = 24 arrangements.
import math
print(math.factorial(4)) # 24From counting to probability
Probability is favorable outcomes divided by total outcomes. Suppose you choose a committee of 3 from 6 men and 4 women. The total is C(10,3) = 120. The committees with no women number C(6,3) = 20. So 100 committees include at least one woman, and the probability is 100/120 = 5/6.
import math
from fractions import Fraction
total = math.comb(10, 3)
no_women = math.comb(6, 3)
print(Fraction(total - no_women, total)) # 5/6Strategy for GRE counting questions
Work through these steps in order:
- Decide whether order matters, then choose permutations or combinations.
- If the question says "at least" or gives a restriction, try the complement.
- For overlapping sets, fill the triple overlap first, then the pairwise regions.
- Check that your answer is a whole number no larger than the total.
Exercise
In a group of 50 students, 25 take class A, 20 take class B, and 15 take class C. Pairwise overlaps are 8 (A and B), 6 (A and C), and 5 (B and C). Two students take all three classes. How many students take at least one class, and how many take none?
Show answer
The union is 25 + 20 + 15 - 8 - 6 - 5 + 2 = 43. So 50 - 43 = 7 students take none.