Lumen Lab 루멘랩

Permutations vs combinations: nPr and nCr explained

Lumen Lab · Last checked

Scientific CalculatorScientific functions and physical constantsOpen

The difference between permutations (nPr) and combinations (nCr), their formulas, how to enter them on a scientific calculator, and worked examples from lottery odds to PIN codes and card hands.

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!).

Try 5P2 ▸ Try 5C2 ▸

Examples

SituationExpressionWays
Pick 6 lottery numbers from 1–4545C68,145,060
A 5-card poker hand from 5252C52,598,960
4-digit PIN, all digits different10P45,040
4-digit PIN, repeats allowed10⁴10,000
Line up 10 people10!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.

Try 1÷45C6 ▸

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.

Found a mistake, or a rule that has changed? Email contact@lumenlab.page. We check it, fix it and put the new date on this guide.