Permutation and combination calculator (nPr and nCr)
Enter your values. The answer and the full worked solution update as you type.
Result
Count the ways to choose r items from n. Permutations, nPr, count ordered arrangements; combinations, nCr, count selections in which the order does not matter. The calculator also gives the counts when items may be repeated, and it works with exact whole numbers for n and r up to 1000: the steps show every digit, even of very large results.
Step-by-step solution
Permutations: the order matters
Combinations: the order does not matter
With repetition allowed
Key formulas
- Permutations
- P(n, r) = n!/(n − r)!
- Combinations
- C(n, r) = n!/(r!·(n − r)!)
- With repetition
- nr if order matters, C(n + r − 1, r) if not
How to calculate permutations and combinations
- Decide whether the order matters. Arranging people in a row, awarding first and second prize or forming a code: the order matters, so use permutations. Choosing a team or a hand of cards: the order does not matter, so use combinations.
- Permutations: nPr = n!/(n − r)!, the product of the r factors n·(n − 1)···(n − r + 1).
- Combinations: nCr = n!/(r!(n − r)!) = nPr/r!. Dividing by r! removes the r! orders of each selection.
- With repetition allowed, ordered choices give nʳ and unordered choices give C(n + r − 1, r).
- Check with a small case: C(4, 2) = 6 and P(4, 2) = 12, because each pair can be written in 2 orders.
Questions and answers
What is the difference between a permutation and a combination?
A permutation is an ordered arrangement and a combination is an unordered selection. From the letters A, B and C you can form 6 ordered pairs (AB, BA, AC, CA, BC, CB) but only 3 unordered pairs ({A, B}, {A, C}, {B, C}).
Why is C(n, r) equal to C(n, n − r)?
Choosing the r items you take is the same as choosing the n − r items you leave behind. For example, C(10, 3) = C(10, 7) = 120.
What is 0!?
0! = 1. That makes the formulas work at the edges: C(n, 0) = C(n, n) = 1, because there is exactly one way to choose nothing or everything.
What are combinations with repetition?
Unordered choices in which the same item may be picked more than once, such as 3 scoops from 10 ice-cream flavours. The count is C(n + r − 1, r), which is C(12, 3) = 220 for that example.
Where are combinations used in probability?
In the binomial formula, C(n, x) counts the orders in which x successes can occur in n trials. In lotteries and card games, the probability of a hand is the number of favourable combinations divided by the total number of combinations.
Practise it yourself
Practise Probability
A calculator gives the answer. In the exam you need the method: practise it with new problems, hints and worked solutions.