If order matters, it is a permutation: nPr = n!/(n−r)!. If order doesn’t matter, it is a combination: nCr = n!/(r!(n−r)!). Choosing a president and vice-president from 5 people gives 5P2 = 20 ways; choosing 2 representatives gives 5C2 = 10.
Does order matter?
Say you pick 2 of 5 people: Ann, Ben, Cal, Dee and Eve.
- Picking a president and a vice-president: (Ann, Ben) is different from (Ben, Ann). Order matters, so it is a permutation: 5 × 4 = 20 ways.
- Picking two representatives: {Ann, Ben} is the same as {Ben, Ann}. Order doesn’t matter, so it is a combination: 20 ÷ 2 = 10 ways.
A combination is a permutation divided by the r! ways to arrange the chosen items, so nCr = nPr ÷ r!.
Formulas
- nPr = n! / (n − r)! = n × (n−1) × … × (n−r+1)
- nCr = n! / (r! × (n − r)!)
- n! = 1 × 2 × … × n, and 0! = 1
- nCr = nC(n−r): choosing 6 of 45 is the same as choosing the 39 to leave out.
Entering them on the calculator
Type n, press SHIFT × (nPr) or SHIFT ÷ (nCr), type r and press =. On a keyboard, type 5P2 or 5C2 with a capital P or C. Factorial is SHIFT x⁻¹ (x!).
Examples
| Situation | Expression | Ways |
|---|---|---|
| Pick 6 lottery numbers from 1–45 | 45C6 | 8,145,060 |
| A 5-card poker hand from 52 | 52C5 | 2,598,960 |
| 4-digit PIN, all digits different | 10P4 | 5,040 |
| 4-digit PIN, repeats allowed | 10⁴ | 10,000 |
| Line up 10 people | 10! | 3,628,800 |
The chance of matching all 6 numbers in a 6/45 lottery is 1 ÷ 45C6 = 1/8145060 ≈ 0.000000123, shown as 1.22773804×10⁻⁷ in scientific notation.
Big numbers
Factorials grow fast: 70! is about 1.197857167×10¹⁰⁰. This calculator handles integer factorials up to 3000! and switches to scientific notation when the result is long.
Published 2026-10-06 · Updated 2026-10-06 · Lumen Lab