Combinations & Permutations Calculator
Calculate nCr and nPr with and without repetition, plus factorials — and see exactly when order matters and when it does not.
Comment utiliser cette calculatrice
- 1Enter n — the total number of items you are choosing from.
- 2Enter r — how many you are choosing.
- 3Read nCr if order does not matter, or nPr if it does.
- 4Use the with-repetition rows if the same item can be selected more than once.
Comment ça marche
Counting formulas
Permutations (order matters): P(n,r) = n! ÷ (n − r)! Combinations (order does not): C(n,r) = n! ÷ (r! (n − r)!) Permutations with repetition: nʳ Combinations with repetition: C(n + r − 1, r) C(n,r) = P(n,r) ÷ r!
Start with permutations: there are n choices for the first pick, n−1 for the second, and so on. If order does not matter, every group of r items has been counted r! times — once for each way of arranging it — so dividing by r! collapses those duplicates into one. That single division is the entire difference between a permutation and a combination.
Exemple détaillé
A five-card poker hand from a 52-card deck: there are P(52,5) = 311,875,200 ordered deals, but the order you receive cards in does not change the hand, so divide by 5! = 120 to get C(52,5) = 2,598,960 distinct hands.
Combinations & Permutations Calculator : le guide complet
The only question that matters: does order count?
Every counting problem reduces to this one decision. If rearranging the selection gives you a genuinely different outcome, it is a permutation. If it gives you the same thing described differently, it is a combination.
A lottery draw is a combination — holding 1-2-3-4-5-6 is the same ticket regardless of the order the balls emerge. A race podium is a permutation — gold, silver, and bronze are three distinct outcomes for the same three runners. A four-digit PIN is a permutation with repetition, since 1123 and 1213 are different codes and digits can repeat.
Note that the everyday word "combination lock" is precisely backwards: order absolutely matters on a combination lock, so it is really a permutation lock.
Why factorials grow so fast
Factorials outgrow every polynomial and every exponential. 10! is 3.6 million, 20! is 2.4 × 10¹⁸, and 52! — the number of ways to shuffle a deck of cards — is about 8 × 10⁶⁷.
That last figure is worth sitting with. It is vastly more than the number of atoms in the observable universe. Any well-shuffled deck has almost certainly never been in that exact order before in human history, and never will be again.
This growth is why brute-force search fails on combinatorial problems, and why the calculator computes nCr multiplicatively rather than as three factorials: C(52,5) is only 2.6 million, but reaching it through 52! would overflow long before the division rescued it.
Combinations with repetition
This is the "stars and bars" case: choosing r items from n types where you may take the same type more than once, and order does not matter. Picking 3 scoops from 5 ice cream flavours, where two scoops of chocolate is allowed, gives C(5+3−1, 3) = 35 possible cones.
It is the least intuitive of the four cases because the answer exceeds plain C(n,r) — allowing repeats adds options rather than removing them. The trick is imagining r stars to distribute among n bins separated by n−1 bars; every arrangement of stars and bars is one selection.
Pascal's triangle and the binomial theorem
The values of C(n,r) are exactly the rows of Pascal's triangle: C(4,0) through C(4,4) give 1, 4, 6, 4, 1. Each entry is the sum of the two above it, which encodes the identity C(n,r) = C(n−1,r−1) + C(n−1,r) — either you take the new item or you do not.
They are also the coefficients in the binomial expansion of (x + y)ⁿ, which is why C(n,r) is called the binomial coefficient and read "n choose r". The same numbers drive the binomial probability distribution, so the counting and the probability are literally the same mathematics.
Questions fréquentes
What is the difference between a combination and a permutation?
Order. A permutation counts arrangements, a combination counts selections. Choosing 3 people from 10 for a committee is a combination (120 ways); choosing 3 for president, secretary, and treasurer is a permutation (720 ways) — six times more, because each committee can be assigned roles in 3! = 6 ways.
How many 5-card poker hands are there?
C(52,5) = 2,598,960. Enter n = 52 and r = 5 above. Of those, exactly 4 are royal flushes, which is why the probability of being dealt one is about 1 in 649,740.
Why is 0! equal to 1?
There is exactly one way to arrange nothing — the empty arrangement. Defining 0! = 1 is also what makes C(n,0) = 1 and C(n,n) = 1 come out correctly, and it keeps the recurrence n! = n × (n−1)! valid down to n = 1.
What are the odds of winning the lottery?
For a 6-from-49 draw, C(49,6) = 13,983,816, so a single ticket has about a 1 in 14 million chance. Enter n = 49 and r = 6 above. Buying ten tickets makes it 1 in 1.4 million — still far less likely than many risks people ignore daily.