Summary
Permutations and combinations are the two fundamental ways of counting how items can be selected from a group. A permutation counts arrangements where order matters (e.g., ranking, seating, passwords). A combination counts selections where order does not matter (e.g., lottery picks, committee membership, card hands). Both rely on the factorial function, which multiplies a number by every positive integer below it.
How it works
The calculator computes three values:
- Factorial (n!) — the product of all positive integers from 1 to n. By definition, 0! = 1.
- Permutations (nPr) — the number of ordered arrangements of r items chosen from n. Each different ordering counts as a separate permutation.
- Combinations (nCr) — the number of unordered selections of r items chosen from n. Rearranging the same items does not create a new combination.
The key insight: nCr = nPr / r! because every combination of r items can be arranged in r! different orders.
The formulas
Where
Where
Where
Worked examples
How many 3-letter arrangements from A, B, C, D, E?
Identify n and r
= n = 5, r = 3
Apply permutation formula
= 60
Result
There are 60 different 3-letter arrangements (ABC, ACB, BAC, ... are all distinct)
How many 5-card hands from a 52-card deck?
Identify n and r
= n = 52, r = 5
Apply combination formula (order doesn't matter)
= 311,875,200 / 120
Simplify
= 2,598,960
Result
There are 2,598,960 possible 5-card poker hands
10! (factorial of 10)
Multiply all integers from 1 to 10
= 3,628,800
Result
10! = 3,628,800
Practical uses
- Lottery odds — the number of ways to choose 6 numbers from 49 is 49C6 = 13,983,816, giving odds of roughly 1 in 14 million.
- Passwords — the number of possible 8-character passwords from 62 characters (a-z, A-Z, 0-9) is 62P8 with replacement = 62^8 = 218 trillion.
- Tournament brackets — the number of ways to seed n teams is n! (a permutation of all teams).
- Committee selection — choosing a 4-person committee from 20 candidates is 20C4 = 4,845 possible groups.
Assumptions & limitations
- Non-negative integers only — factorial is defined for non-negative integers. The gamma function extends it to real and complex numbers, but this calculator uses the integer definition.
- Overflow for large n — factorials grow extremely fast (20! = 2.4 quintillion). The calculator handles large values but may show results in scientific notation.
- r cannot exceed n — you cannot choose more items than are available. nPr and nCr are zero (or undefined) when r > n.
- No replacement — these formulas assume each item is used at most once. For sampling with replacement, the formulas differ (n^r for ordered, C(n+r-1, r) for unordered).