🔀 Permutation and Combination Calculator
Permutation And Combination Calculator
Permutations count arrangements where order matters — gold, silver, bronze medals for 5 runners is P(5,3) = 60. Combinations count groups where order does not matter — choosing any 3 of 5 friends is C(5,3) = 10.
The calculator builds both with direct multiplication instead of giant factorials, so it stays exact for n all the way up to 170.
How to use this calculator
Enter n for the total items and r for how many you choose. The calculator returns both P(n,r) and C(n,r) at once.
- Type n, the total number of items to choose from.
- Type r, how many items are chosen or arranged.
- Make sure r is not larger than n.
- Press Calculate and read the permutation count and the combination count.
Worked example: choosing 3 from 5
Five people — call them A, B, C, D, E — and three slots to fill.
Permutations (order counts — gold, silver and bronze medals): P(5, 3) = 5! ⁄ (5 − 3)! worked out as 5 × 4 × 3 = 60. A-gold/B-silver/C-bronze is not B-gold/A-silver/C-bronze.
Combinations (order does not count — a three-person team): C(5, 3) = 5! ⁄ (3! × 2!) = 120 ⁄ 12 = 10. Each trio was counted six times in the 60 (once per ordering), and the formula divides those duplicates away.
Permutations with repetition (a 3-digit code from 5 symbols, symbols reusable): 5³ = 125.
Combinations with repetition (3 scoops, 5 flavours, doubles allowed): C(5 + 3 − 1, 3) = C(7, 3) = 35.
What does this calculator compute?
It computes P(n,r), the number of ordered arrangements of r items chosen from n, and C(n,r), the number of unordered groups. Both are built by direct multiplication, exact for n up to 170.
The only question that matters: does order count?
You are choosing r things from n. If swapping two of your choices produces a different result — a different podium, a different code — you are in permutation country. If the swapped result is the same thing — the same committee, the same hand of cards — it is a combination. Almost every counting mistake in this topic is answering that one question wrong.
A problem set worth recognising
| Problem | Type | Working | Answer |
|---|---|---|---|
| Medals for gold and silver from 5 runners | Permutation | 5 × 4 | 20 |
| A 2-person team from 5 people | Combination | C(5, 2) | 10 |
| 2-digit code from 5 symbols, repeats allowed | Permutation with repetition | 5² | 25 |
| 2 scoops from 5 flavours, same flavour twice allowed | Combination with repetition | C(6, 2) | 15 |
| Handshakes if 10 people all shake hands | Combination | C(10, 2) | 45 |
The last row is the famous handshake problem: every handshake is an unordered pair of people, so 10 people produce C(10, 2) = 45 handshakes — not 90, because A shaking B is the same handshake as B shaking A.
Why the repetition variants sit in between
Repetition changes the counting because the pool refills. A code can reuse a symbol, so every position keeps all n choices — pure multiplication, nʳ. A combination with repetition keeps the “order doesn’t matter” rule but allows doubles, which the stars-and-bars formula C(n + r − 1, r) handles. If a problem lets you pick the same item twice, one of these two is almost certainly the tool.
Frequently asked questions
What is the difference between P(5, 2) = 20 and C(5, 2) = 10?
P(5, 2) counts arrangements where order matters — first and second are different slots. C(5, 2) counts selections where only the set matters. The factor between them is exactly 2! = 2, the number of ways to order each chosen pair — dividing by it removes the duplicates.
How many handshakes happen when 10 people each shake hands with everyone else once?
45. A handshake is a pair of people with no order to it, so the count is C(10, 2) = 10 × 9 ⁄ 2 = 45. Counting 10 × 9 = 90 would count every handshake twice.
When do I use the “with repetition” versions?
When a chosen item can be chosen again. Codes and PINs (permutations with repetition, nʳ) and selections like scoops of ice cream or coins making up a sum (combinations with repetition, C(n + r − 1, r)). If the item is used up once picked, stay with the plain versions.
Why is C(5, 2) the same as C(5, 3)?
Choosing 2 people to include is the same act as choosing 3 to leave out — every selection of 2 defines its complement of 3. The formula agrees: both evaluate to 10. The calculator’s factorial working shows the symmetry directly.
How large can n get?
The plain results are exact for n up to 170 (the largest factorial that fits in standard arithmetic). Beyond that the calculator switches to an approximation and says so — lottery-scale counts like C(59, 5) are still exact, since the factorials cancel before they overflow.







































