How to use the calculator
Enter the total number of items, n, and how many you pick, r. Then say whether repetition is allowed and press Calculate.
- Not allowed: each item can be used at most once, like people taking places on a podium or cards dealt from a deck. You get the number of permutations (nPr) and combinations (nCr).
- Allowed: an item can be picked again, like the digits of a PIN or scoops of the same ice cream flavor. You get n^r ordered arrangements and the number of combinations with repetition.
Every result is an exact whole number. When a result has more than 15 digits, the result card shows a scientific approximation and the digit count, and the full number appears in the details panel.
Permutations or combinations?
Ask whether order matters. If picking A then B is different from picking B then A, you are counting permutations. If only the group matters, you are counting combinations. Every combination of r items can be ordered in r! ways, which is why nCr = nPr / r!.
Formulas
- Permutations:
nPr = n! / (n − r)! - Combinations:
nCr = n! / (r! × (n − r)!) - Permutations with repetition:
n^r - Combinations with repetition:
C(n + r − 1, r) = (n + r − 1)! / (r! × (n − 1)!)
Worked example
Ten runners compete for gold, silver and bronze, so n = 10 and r = 3. Order matters, so there are 10P3 = 10 × 9 × 8 = 720 possible podiums. If you only ask which three runners reach the podium, the count is 10C3 = 720 / 3! = 720 / 6 = 120.
Now allow repetition. A three-digit code using the digits 0 to 9 has 10^3 = 1,000 possibilities. Choosing three scoops from ten flavors, where flavors can repeat and order does not matter, gives C(12, 3) = 220 options.
A poker hand is 5 cards from 52 without repetition, and order does not matter: 52C5 = 2,598,960 hands.
Good to know
- Without repetition you cannot pick more items than you have, so r larger than n gives 0. With repetition, r can be larger than n.
- By convention 0! = 1, so choosing nothing can be done in exactly one way: nP0 = nC0 = 1.
- Factorials grow very fast. 1000! has 2,568 digits, which is why the calculator works with exact big integers rather than ordinary decimal numbers.