Combinations and Permutations, Explained
After reading this you can count the number of ways to choose or arrange r items out of n, decide when order matters, and know whether to allow repetition.
What these two counts mean
Counting problems usually come down to one question: does the order of the chosen items matter? If it does, you are counting permutations. If it does not, you are counting combinations.
Take a small case. You have 10 runners and you want to fill 3 medal positions: gold, silver, bronze. Order matters, because gold is not the same as bronze. That is a permutation, and there are 720 ways. Now suppose you only want to pick 3 runners to advance to a final, with no ranking. Order no longer matters, so the count drops to 120. The same n and r, but different questions and different answers.
The medal count is larger because each unordered group of 3 runners can be arranged in 3! = 6 ways. Multiply 120 × 6 and you get back 720. That relationship (permutations are combinations times the arrangements of the chosen set) is the whole idea in one line.
When to use each, and when not to
Ask two questions before you count anything.
Does order matter? Passwords, race rankings, seat assignments, and the order of tasks all depend on order, so use permutations. Lottery tickets, poker hands, committees, and pizza toppings do not depend on order, so use combinations.
Can an item repeat? If you draw a card and set it aside, the same card cannot appear twice, so you count without repetition. If you roll a die three times, the same face can appear on every roll, so you count with repetition.
These counts assume the n items are distinct and that every arrangement or selection is equally likely to be relevant. If two of your items are identical (say two red balls), the plain formulas overcount. You would need to divide by the arrangements of the identical items.
Do not use these tools when the choices are not independent slots. If picking one item changes how many items are available for reasons other than removal (for example, a rule that says "if you pick A you cannot pick B"), you need to break the problem into cases first.
The four formulas
There are four counts, one for each combination of the two questions above.
Permutations without repetition arrange r distinct items in order, drawing from n without replacement.
Here n! is the factorial (the product of all integers from 1 up to n), and (n-r)! removes the arrangements of the items you did not choose.
Combinations without repetition choose r distinct items with no order.
The extra r! in the denominator divides out the orderings of the chosen set. That is the medal-versus-finalists difference again.
Permutations with repetition fill r ordered slots when each slot can hold any of the n items.
Each of the r slots has n independent choices, so you multiply n by itself r times.
Combinations with repetition choose r items with no order, allowing the same item more than once.
This is the "stars and bars" count. It answers questions like how many ways you can pick 3 scoops from 10 flavors when repeats are allowed.
A worked example with n = 10 and r = 3
All four counts for choosing 3 from 10
Use the demo values: n = 10 total items and r = 3 chosen. Work each formula by hand.
- Permutations without repetition: P(10,3) = \frac{10!}{7!} = 10 \times 9 \times 8 = 720.
- Combinations without repetition: C(10,3) = \frac{720}{3!} = \frac{720}{6} = 120.
- Permutations with repetition: 10^{3} = 1000.
- Combinations with repetition: \binom{12}{3} = \frac{12 \times 11 \times 10}{6} = 220.
Notice the ordering. Allowing repetition raises each count: 1000 > 720 for permutations, and 220 > 120 for combinations. Dropping order lowers each count: 120 < 720 without repetition, and 220 < 1000 with repetition.
How the count grows with r
For fixed n, the number of combinations without repetition rises, peaks, and falls again. With n = 10, C(10, r) is largest at r = 5, where it equals 252. It is symmetric: C(10, 2) = 45 equals C(10, 8) = 45, because choosing 2 to keep is the same as choosing 8 to leave out.
When r is more than half of n, compute C(n, n-r) instead. For example C(10, 9) equals C(10, 1) = 10, which is faster to work out and easier to check.
Reading the result correctly
The calculator returns a plain count of possibilities, not a probability. To turn a count into a probability, put the favorable count over the total count. For a lottery where you pick 6 numbers from 49 with no order and no repeats, the total is C(49,6) = 13{,}983{,}816, so a single ticket has probability 1 / 13{,}983{,}816 \approx 0.0000000715 of matching all six.
Watch the size of the numbers. Permutations grow fast. P(20, 10) is already 670,442,572,800. Counts with repetition can be even larger, since 20^10 is over 10^13. If you feed large n and r, expect very big integers.
| n | C(n, 3) |
|---|---|
| 5 | 10 |
| 10 | 120 |
| 15 | 455 |
| 20 | 1140 |
| 30 | 4060 |
Common mistakes
Confusing order with no order. The most frequent error is using P when the problem calls for C, or the reverse. A committee of 3 from 10 is C(10, 3) = 120, not 720. If swapping two chosen items gives a genuinely different outcome, use permutations.
Forgetting whether items return to the pool. Drawing without replacement uses the factorial formulas. A four-digit PIN, where each digit can repeat, uses 10^4 = 10,000, not P(10, 4) = 5040.
Requiring r larger than n without repetition. You cannot choose 12 distinct items from 10, so C(10, 12) is 0. With repetition, though, r > n is fine: three scoops from ten flavors allows repeats, and even ten scoops from three flavors is valid.
Double counting identical items. The formulas treat all n items as distinct. If some are truly identical, the raw permutation count is too high, and you must divide by the factorials of the repeated groups.
Related tools
Once you have a count, you often want a probability. The Probability Calculator combines events, and the Bayes' Theorem Calculator updates a probability with new evidence. For weighted outcomes, the Expected Value Calculator gives the mean of a discrete distribution.
Two game-focused pages lean directly on counting. The Dice Probability Calculator uses ordered outcomes with repetition, and the Birthday Paradox Calculator is a permutation problem about shared birthdays that surprises most people.
Frequently asked questions
What is the difference between nPr and nCr?
Both draw r items from n. nPr counts ordered arrangements, so it is larger. nCr counts unordered selections. They are related by P(n,r) = C(n,r) \times r!. For n = 10, r = 3, that is 720 = 120 \times 6.
How do I know if repetition is allowed?
Ask whether the same item can be picked more than once. Drawing balls without putting them back means no repetition. Rolling a die or choosing digits for a code means repetition is allowed.
Why is C(n, 0) equal to 1?
There is exactly one way to choose nothing: the empty selection. The formula agrees, since C(n,0) = \frac{n!}{0!\,n!} = 1, using the convention 0! = 1.
Can r be larger than n?
Only with repetition. Without repetition, C(n, r) and P(n, r) are 0 when r > n. With repetition, n^{r} and the stars-and-bars count stay positive.
How does this connect to Pascal's triangle?
Each entry of Pascal's triangle is a combination. Row 10 reads 1, 10, 45, 120, 210, 252, 210, 120, 45, 10, 1, which are exactly C(10, 0) through C(10, 10).