Permutation and Combination Calculator
- Updated
- Formula shown
- Free, no sign-up
Results
Combinations C(10, 3) = 120
| Count | Working |
|---|---|
| Combinations | C(10, 3) = 10! ÷ (3! × 7!) = (10 × 9 × 8) ÷ (3 × 2 × 1) = 120 |
| Permutations (for comparison) | P(10, 3) = 10! ÷ (10 − 3)! = 10! ÷ 7! = 10 × 9 × 8 = 720 |
How to use the calculator
- Enter n, the number of different items to choose from, and r, the number you pick.
- Say whether the order matters. If it does (rankings, codes, seating), you want permutations; if not (teams, hands of cards), combinations.
- Say whether an item can be picked more than once, as with digits in a PIN.
- Both counts are shown so you can compare them; the one you asked for is highlighted. Long exact answers can be copied in full.
Permutation and combination formulas
Combinations: C(n, r) = n! ÷ (r! × (n − r)!)
Permutations with repetition: nʳ
Combinations with repetition: C(n + r − 1, r) = (n + r − 1)! ÷ (r! × (n − 1)!)
n! ("n factorial") is n × (n − 1) × … × 2 × 1, and 0! = 1. Each combination of r items can be arranged in r! orders, so P(n, r) = C(n, r) × r!. The repetition formula for combinations is the "stars and bars" count: choosing r items from n types with repeats is the same as placing r stars among n − 1 dividers. The calculator multiplies whole numbers with BigInt arithmetic, so a result like C(100, 50) is exact to the last digit rather than rounded.
Worked example
Eight runners compete for gold, silver and bronze. Order matters, so the count is P(8, 3) = 8! ÷ 5! = 8 × 7 × 6 = 336. If instead the top three simply qualify for the final, order does not matter: C(8, 3) = 8! ÷ (3! × 5!) = 336 ÷ 6 = 56. Each group of three qualifiers can be arranged on the podium in 3! = 6 ways, which is exactly the factor between the two answers.
Common counting problems
| Problem | Formula | Count |
|---|---|---|
| Podium places (gold, silver, bronze) among 8 runners | P(8, 3) | 336 |
| A committee of 3 from 8 people | C(8, 3) | 56 |
| Tickets in a 6-from-49 lottery | C(49, 6) | 13,983,816 |
| Five-card poker hands from 52 cards | C(52, 5) | 2,598,960 |
| Four-digit PIN codes (digits may repeat) | 10⁴ | 10,000 |
| Three scoops from 5 flavours, repeats allowed | C(7, 3) | 35 |
| Ways to seat 10 guests in a row | 10! | 3,628,800 |
| Six-character passwords from 26 lower-case letters | 26⁶ | 308,915,776 |
| Orderings of a 52-card deck | 52! | ≈ 8.0658 × 10⁶⁷ |
A probability follows directly: one ticket in a 6-from-49 lottery wins the jackpot with probability 1 ÷ 13,983,816. The probability calculator handles the next steps, such as the chance of winning at least once in many draws.
Pascal's triangle
Row n of Pascal's triangle lists C(n, 0), C(n, 1), …, C(n, n). Each entry is the sum of the two above it, because C(n, r) = C(n − 1, r − 1) + C(n − 1, r), and the entries of row n add up to 2ⁿ, the number of subsets of n items.
| n | C(n, 0) … C(n, n) |
|---|---|
| 0 | 1 |
| 1 | 1 1 |
| 2 | 1 2 1 |
| 3 | 1 3 3 1 |
| 4 | 1 4 6 4 1 |
| 5 | 1 5 10 10 5 1 |
| 6 | 1 6 15 20 15 6 1 |
| 7 | 1 7 21 35 35 21 7 1 |
| 8 | 1 8 28 56 70 56 28 8 1 |
| 9 | 1 9 36 84 126 126 84 36 9 1 |
| 10 | 1 10 45 120 210 252 210 120 45 10 1 |
Tips: which one do I need?
- Ask "would swapping two choices make a different outcome?" If yes (first and second place, the digits of a code), order matters: permutations.
- A "combination lock" is really a permutation with repetition: 1-2-3 and 3-2-1 open different locks, and digits can repeat.
- Choosing r is the same as leaving out n − r, so C(n, r) = C(n, n − r). C(52, 47) equals C(52, 5).
- Watch the size. Factorials grow very fast: 20! already has 19 digits and 70! has 101. Use the exact output rather than copying a rounded calculator display.
For other very large exact results, the big number calculator keeps every digit, and the scientific notation calculator converts them to a compact form.
Frequently asked questions
What is the difference between a permutation and a combination?
In a permutation the order matters; in a combination it does not. Choosing 3 of 10 people gives C(10, 3) = 120 possible groups, but there are P(10, 3) = 720 ways to award gold, silver and bronze, because each group can be ordered 3! = 6 ways.
What is the formula for combinations?
C(n, r) = n! ÷ (r! × (n − r)!). A lottery that draws 6 numbers from 49 has C(49, 6) = 13,983,816 possible tickets, so one ticket has a 1 in 13,983,816 chance of matching all six.
How do you count when repetition is allowed?
If order matters, there are nʳ choices: a 4-digit PIN has 10⁴ = 10,000 possibilities. If order does not matter, use C(n + r − 1, r): choosing 3 scoops from 5 flavours, repeats allowed, gives C(7, 3) = 35 different cups.
Why does 0! equal 1?
There is exactly one way to arrange nothing, and defining 0! = 1 keeps the formulas consistent. It makes C(n, 0) = C(n, n) = 1: there is one way to choose nobody and one way to choose everybody.
How many ways can a deck of cards be shuffled?
A 52-card deck can be ordered in 52! ≈ 8.0658 × 10⁶⁷ ways, a 68-digit number. By contrast, there are only C(52, 5) = 2,598,960 different five-card poker hands, because the order of the cards in a hand does not matter.