Combinatorics calculator
What is a Combinatorics Calculator?
Combinatorics answers the question how many ways?: how many lottery tickets are possible, how many passwords of a given length exist, or how many ways a committee can be chosen. This calculator computes factorials, permutations and combinations exactly, even for large numbers.
How to use it
- Enter n, the number of items to choose from.
- Enter r, the number of items chosen.
- Read n!, nPr and nCr.
The formulas
- Factorial:
n! = n × (n-1) × ... × 1, with 0! = 1. 5! = 120. - Permutations (order matters):
nPr = n! / (n-r)! - Combinations (order does not matter):
nCr = n! / (r! × (n-r)!)
Worked examples
- Podium finishes: 10 runners, how many ways to award gold, silver and bronze? Order matters: 10P3 = 10 × 9 × 8 = 720.
- Choosing a team: pick 3 people from 10 for a committee. Order does not matter: 10C3 = 720 / 3! = 120.
- Lottery: choose 6 numbers from 49: 49C6 = 13,983,816, so a single ticket has a 1 in about 14 million chance.
Choosing the right formula
Ask whether rearranging the same chosen items creates a different outcome. A PIN 1-2-3 differs from 3-2-1, so use permutations. A hand of cards is the same hand in any order, so use combinations. If items can repeat, as with PIN digits, use n^r instead: a 4-digit PIN has 10^4 = 10,000 possibilities.
Frequently Asked Questions
What is the difference between permutations and combinations?
Permutations count arrangements where order matters. Combinations count selections where order does not matter.
Why is 0 factorial equal to 1?
There is exactly one way to arrange zero items, and defining 0! as 1 keeps the formulas for nPr and nCr consistent.
How many combinations does a 6 from 49 lottery have?
13,983,816.
What if items can be chosen more than once?
For ordered selections with repetition use n to the power r. For unordered selections with repetition use (n + r - 1) choose r.