Skip to the calculator
Rule Calculator

Permutation and combination calculator

There are 2,598,960 five-card hands from a 52-card deck and 311,875,200 ordered ones. The difference is a factor of 120 — the 5! ways to rearrange each hand — and it is the whole distinction: a combination is a set, a permutation is a sequence, and choosing the wrong one is off by a factorial, not by a little.

All four counts at once — with and without order, with and without repeats — because the arithmetic was never the difficulty. Choosing which of the four your question is was.

Checked against Pascal's rule for every n to 40 · How we check

Combinations — order does not matter

2,598,960

Ways to pick 5 from 52 when the order you pick them in makes no difference — a hand of cards, a lottery ticket, a committee.

The four questions this can be

The four questions this can be
QuestionCountExample
Order matters, no repeats311,875,200Gold, silver and bronze from a field
Order does not matter, no repeats2,598,960A hand of cards, a lottery ticket
Order matters, repeats allowed380,204,032A PIN, where 1-1-1 is allowed
Order does not matter, repeats allowed3,819,816Scoops of ice cream, two of the same flavour

Permutations are always the larger of the first two, by exactly r factorial — every unordered selection can be arranged that many ways.

Two questions, four answers

Every counting problem of this shape is settled by two yes-or-no questions. Does the order of what you picked change the outcome? Can the same thing be picked twice? Those give four formulas, and the mistake is almost never in the arithmetic — it is in answering the second question wrong, usually because the problem never said.

A useful test for order: if you can describe the result without saying which came first, order does not matter. A hand of cards, a set of lottery numbers and a committee all pass that test. A podium, a password and a route between cities do not.

Questions people actually ask

What is the difference between a permutation and a combination?
Whether the order counts. Picking three people for gold, silver and bronze is a permutation — swapping two of them gives a different outcome. Picking three people for a committee is a combination, because the committee is the same whichever order you named them in. Permutations are always the larger number, by exactly r factorial.
How many five-card poker hands are there?
2,598,960 — that is 52 choose 5. Order does not matter because a hand is a hand however it was dealt. If order did matter the count would be 311,875,200, which is the same number multiplied by the 120 ways to arrange five cards.
When is repetition allowed?
When the thing you picked goes back. A PIN allows repeats — 1-1-1-1 is a valid PIN — so four digits from ten give 10,000 possibilities rather than 5,040. Scoops of ice cream allow repeats without order mattering, which is the fourth cell of the grid and the one most people have never met.
Why not just use factorials?
Because they overflow long before the answer does. 70 factorial is about 10¹⁰⁰, which no ordinary floating-point number can hold, while 70 choose 35 is a perfectly manageable twenty-digit number. Multiplying and dividing term by term keeps every intermediate value small, and it is why this page answers where a naive implementation returns infinity.
What are the odds of winning a 6-from-49 lottery?
One in 13,983,816 — that is 49 choose 6, since the order the balls come out in does not matter. Buying a hundred tickets makes it one in about 140,000, which is a hundredfold improvement on a number that was never the problem.

Sources

Related

Did this answer your question?