Counting choices
How many ways are there to pick 3 people from 10? To arrange them on a podium? To set a 4-digit code? These questions belong to combinatorics, and they come down to two ideas: whether order matters and whether items can be repeated. This calculator gives all four counts at once, plus the factorial of n.
The formulas
- Combinations (order ignored): nCr = n! ÷ (r! (n − r)!)
- Permutations (order matters): nPr = n! ÷ (n − r)!
- Combinations with repetition: (n + r − 1)C r
- Permutations with repetition: nʳ
- Factorial: n! = n × (n − 1) × … × 2 × 1, with 0! = 1
Very large results are shown in scientific notation, such as 3.04 × 10⁶⁴ for 50!.
Worked example
A club of 10 members picks 3 people.
- To form a committee, order does not matter: 10C3 = 3,628,800 ÷ (6 × 5,040) = 120.
- To elect a president, a treasurer and a secretary, order matters: 10P3 = 10 × 9 × 8 = 720.
- If one person may hold several roles, there are 10³ = 1,000 possibilities.
- Any single committee has a 1 in 120 chance, or 0.83%, of being drawn at random.
Which formula to use
| Order matters? | Repetition allowed? | Example | Formula |
|---|---|---|---|
| No | No | lottery numbers, a committee | nCr |
| Yes | No | a race podium, seat assignments | nPr |
| No | Yes | choosing 3 scoops from 10 flavors | (n + r − 1)C r |
| Yes | Yes | a PIN code, a combination lock | nʳ |
Lottery odds
The Powerball jackpot requires 5 white balls out of 69, in any order, plus 1 red ball out of 26. That is 69C5 × 26 = 11,238,513 × 26 = 292,201,338 combinations, so a single ticket has a 1 in 292 million chance.
Factorials grow fast
| n | n! |
|---|---|
| 5 | 120 |
| 10 | 3,628,800 |
| 13 | 6,227,020,800 |
| 20 | about 2.43 × 10¹⁸ |
| 52 | about 8.07 × 10⁶⁷ |
A shuffled deck of 52 cards has 52! possible orders, so almost certainly no two well-shuffled decks in history have ever been in the same order.
Symmetry
Choosing r items to keep is the same as choosing n − r items to leave out, so nCr = nC(n − r): there are as many ways to pick 7 people out of 10 as to pick 3. The comparison table shows the counts rising, then falling symmetrically.