๐ข Combination & Permutation Calculator
Calculate the total number of permutations (nPr) and combinations (nCr) when choosing r items out of n. Permutations count order as significant, while combinations don't. Useful for probability and statistics homework, or for figuring out how many possible outcomes a lottery or drawing has.
How to use
- Enter the total number of items, n.
- Enter how many items to choose, r (r โค n).
- The permutation (nPr) and combination (nCr) values are calculated automatically.
How the calculation works
This tool counts permutations and combinations when choosing r items from n. Permutations (nPr): the order of the chosen items matters nPr = n ร (n โ 1) ร โฆ ร (n โ r + 1) = n! รท (n โ r)! Combinations (nCr): only which items are chosen matters nCr = nPr รท r! = n! รท (r!(n โ r)!) Combinations use the smaller of r and n โ r, since nCr = nC(nโr). Results grow enormous (1000C500 has 300 digits), so the tool calculates with JavaScript BigInt, which has no digit limit, and shows every digit exactly. n can be up to 1000.
Worked example
Choosing 3 people from 10 Order matters (chair, vice-chair, secretary): 10P3 = 10 ร 9 ร 8 = 720 Order does not matter (a committee of 3): 10C3 = 720 รท 3! = 120 Japan's Loto 6 (6 numbers from 1โ43): 43C6 = 6,096,454 A 5-card hand from 52 cards: 52C5 = 2,598,960
Things to be aware of
- When r = 0 there is exactly one way (choose nothing): nP0 = nC0 = 1.
- If items can be chosen repeatedly (combinations with repetition), use (n+rโ1)Cr instead.
- For probabilities, divide the favourable count by the total count (Loto 6 first prize is 1 in 6,096,454).
FAQ
What's the difference between a permutation and a combination?
A permutation (nPr) counts different orderings of the chosen items as distinct. A combination (nCr) only counts the set of chosen items, ignoring order.
Is there a limit on n?
n is capped at 1000 to avoid calculation and display issues.
What happens if r is greater than n?
You can't choose more items than are available, so no result is shown. Make sure r โค n.