Count unordered groups
Explain why dividing ordered selections by r! removes exactly the repeated orders.
Understand the idea
For a group of r distinct people, internal order is irrelevant. Every group appears r! times among ordered selections, so C(n, r) = n!/(r!(n − r)!). Complementing a selected group proves C(n, r) = C(n, n − r).
Trace a small example
From A, B, C, D, the six pairs are AB, AC, AD, BC, BD, CD. The 12 ordered selections include each pair twice. Choosing zero or all n people gives one outcome; impossible r gives zero under the counting convention.
Conditions and cost
The factorial identity does not make a safe implementation by itself. Factorials can overflow even when the binomial result fits. Check invalid r before indexing a table or calculating a factorial.
How many unranked pairs can be chosen from 5 people?
Turn the idea into code
Choose a committee of 3 from 7 people. How many committees exist?
Give me a hint
You may count ordered triples and remove their internal orders.
Show the explained solution
C(7, 3) = (7 × 6 × 5)/(3 × 2 × 1) = 35.
Your notes
Mark complete when you can explain it yourself.