Sub topic 2
Choosing between permutations and combinations
This chapter assumes you can multiply integers, simplify fractions, solve linear equations, and read word problems closely. You should also know what a set is and what "and" and "or" mean in a count.
Permutations or combinations?
Ask one question first: does the order of the chosen items change the outcome? If it does, count permutations. If it does not, count combinations.
Choosing a president and a vice president from 5 people is ordered, so P(5,2) = 20. Choosing a 2-person committee is unordered, so C(5,2) = 10.
Arranging items when some are identical
When items repeat, divide out the swaps that produce the same arrangement. The letters of BANANA give 6!/(3!·2!) = 60 distinct arrangements, because swapping the three As among themselves or the two Ns among themselves changes nothing.
Restrictions and the complement method
An "at least one" condition is usually easier to count as the complement. Count all outcomes, then subtract the outcomes with none of the property. For a committee of 3 from 6 men and 4 women with at least one woman, the count is C(10,3) − C(6,3) = 120 − 20 = 100.
import math
print(math.perm(5, 2)) # 20: ordered president and vice president
print(math.comb(5, 2)) # 10: unordered 2-person committee
print(math.factorial(6) // (math.factorial(3) * math.factorial(2))) # 60: BANANA
print(math.comb(10, 3) - math.comb(6, 3)) # 100: at least one womanTwo-set Venn diagrams
For two sets A and B, the union has |A| + |B| − |A∩B| elements. The number of elements in neither set equals the total minus the union. Suppose 100 students are surveyed, 60 take A, 45 take B, and 20 take both. The union is 60 + 45 − 20 = 85, so 15 students take neither.
Exercise
How many 3-letter codes can you make from 5 distinct letters if no letter repeats?
Show answer
The order matters, so use P(5,3) = 5!/2! = 60.