Permutations and combinations (with or without repetition)
n is the number of items available, r the number you pick. Combinations ignore order, permutations do not. Results are exact, even very large ones.
Result
10Combinations C(n, r) — order does not matter
- Permutations P(n, r) — order matters
- 60
Inputs
- Number of items n
- 5
- Number picked r
- 3
- Can an item be picked again?
- Without repetition
How it is calculated
Permutations without repetition: P(n, r) = n! ÷ (n − r)!.
Result
Combinations C(n, r) — order does not matter
- Permutations P(n, r) — order matters
- 60
How it is calculated
- Permutations without repetition: P(n, r) = n! ÷ (n − r)!.
- Combinations without repetition: C(n, r) = n! ÷ (r! × (n − r)!).
- With repetition: nʳ permutations and C(n + r − 1, r) combinations.
- Everything is computed with exact integers (BigInt), no rounding.
Example
n = 5, r = 3, without repetition: C(5, 3) = 10 combinations and P(5, 3) = 5 × 4 × 3 = 60 permutations.
Good to know
- n and r are whole numbers from 0 up to 100,000.
- Beyond 400 digits the result is shown as ≈ m × 10ⁿ.
When to use it
- Count the possible lottery tickets, such as 6 numbers out of 49.
- Count the possible podiums or rankings when order matters.
- Count codes or passwords where the same symbol can come back.
- For the chance that two given events happen, use Probability of two events.
Frequently asked questions
How do I know if order matters?
Ask whether swapping two picked items gives a different result. A gold–silver–bronze podium: yes, use permutations. A team or a lottery ticket: no, use combinations.
How many combinations are there for 6 numbers out of 49?
C(49, 6) = 13,983,816. One ticket has about a 1 in 14 million chance of matching all six.
How many 4-digit PIN codes exist?
With repetition and order: 10⁴ = 10,000 codes, from 0000 to 9999.