Permutations and Combinations
Combinations and permutations count how many ways you can choose or arrange items. The difference is whether the order matters. Pick the type and enter n and r.
Your numbers
Result
- Formula
- C(5,2) = 5! / [2! · (5-2)!]
| Step | Detail |
|---|---|
| Type | Combination (order does not matter) |
| Formula | C(5,2) = 5! / [2! · (5-2)!] |
| Result | 10 |
The one question that decides everything
Before any formula, answer this: does rearranging the chosen items give you a different outcome?
If yes, you are counting permutations. First, second and third place on a podium is a permutation, because Ana-Ben-Carla is a different result from Carla-Ben-Ana. So is the order of songs on a playlist, or the digits of a PIN.
If no, you are counting combinations. A three-person committee is a combination, because the same three people are the same committee whichever order you name them in. So is a hand of cards, a pizza's toppings, or a set of lottery numbers.
Getting this wrong is the classic mistake in counting problems, and it is always wrong by a predictable amount — exactly a factor of r!, the number of ways to shuffle the items you picked. That is the only difference between the two formulas.
The two formulas, worked out
A permutation of r items from n is P(n,r) = n! ÷ (n − r)!. Think of filling r slots in order: n choices for the first, n − 1 for the second, and so on. For 5 runners and 3 podium places: 5 × 4 × 3 = 60, which is 120 ÷ 2.
A combination is C(n,r) = n! ÷ [r! × (n − r)!]. It is the permutation count divided by r!, discarding the orderings you do not want counted separately. Choosing 3 of 5 people for a committee: 60 ÷ 6 = 10.
With n = 5 and r = 2, the calculator returns P(5,2) = 20 and C(5,2) = 10 — a factor of 2! = 2 apart, exactly as expected.
The permutation count is always greater than or equal to the combination count, and they coincide only when r is 0 or 1, where there is nothing to rearrange.
Repetition changes the answer entirely
Both formulas above assume you draw without replacement: each item can be chosen at most once. Many real problems do not work that way, and the standard formulas silently give the wrong number.
If order matters and repeats are allowed, the count is simply nʳ. A 4-digit PIN has 10⁴ = 10,000 possibilities, not P(10,4) = 5,040, because 1111 is a legal PIN. This is the single most common misuse of nPr.
If order does not matter and repeats are allowed — scooping 3 cones from 5 flavors, doubles permitted — the count is C(n + r − 1, r), which here gives C(7,3) = 35.
There is a fourth case that is not a simple formula: arranging a set that contains identical items. The letters of BANANA arrange in 6! ÷ (3! × 2!) = 60 distinct ways, dividing out the interchangeable A's and N's. This page computes the two standard cases; the others are worth recognizing so you know when to reach past it.
Symmetry and Pascal's triangle
Combination counts have a structure that makes many of them checkable in your head.
First, C(n,r) = C(n, n−r). Choosing 3 people from 10 to include is the same act as choosing 7 to leave out, so both come to 120. When r is more than half of n, flip it and the arithmetic gets much easier.
Second, C(n,r) = C(n−1, r−1) + C(n−1, r). Fix one particular item: either it is in your selection or it is not, and the two cases add up. That is Pascal's identity, and it is why the values line up as Pascal's triangle, where every entry is the sum of the two above it.
Third, adding a whole row gives 2ⁿ — the number of subsets of an n-item set, since each item is independently in or out. For n = 5: 1 + 5 + 10 + 10 + 5 + 1 = 32 = 2⁵.
These are the same numbers as the coefficients in the expansion of (a + b)ⁿ, which is why C(n,r) is also called a binomial coefficient.
Why the counts get so large
Combinatorial counts grow at a speed that defeats intuition, and that is usually the whole point of computing them.
Ten people all shaking hands once is C(10,2) = 45 handshakes. Push it to a hundred people and it is C(100,2) = 4,950 — a tenfold increase in guests, a hundredfold increase in handshakes, because the count grows roughly with the square.
A five-card poker hand from a standard deck is C(52,5) = 2,598,960. A lottery that draws 6 numbers from 49 has C(49,6) = 13,983,816 possible tickets. A game that draws 5 numbers from a pool of 69 and one more from a separate pool of 26 has C(69,5) × 26 = 292,201,338 outcomes — which is what "the odds" in such a game mean, and why buying more tickets moves them so little.
Because these values overflow ordinary floating-point arithmetic long before they stop being interesting, this calculator computes with big integers and returns the exact count.
Frequently asked questions
Sources
Embed this calculator
Copy the code and paste it into your site or blog. Credit with a link back to Contania is included, and the height adjusts itself.
<iframe src="https://contania.app/embed/math/combinations-permutations" title="Permutation and Combination Calculator (nPr, nCr)" width="100%" height="720" loading="lazy" style="border:1px solid #e5e0d8;border-radius:12px;max-width:640px"></iframe>
<script>window.addEventListener("message",function(e){if(e.data&&e.data.type==="contania:embed-height"){var f=document.querySelector('iframe[src="https://contania.app/embed/math/combinations-permutations"]');if(f){f.style.height=e.data.height+"px"}}});</script>Related calculators
Factorial
Calculate the factorial of a number (n!) — the product of all whole numbers from 1 to n. Exact results for large values using big-integer math.
CalculateProbability
Calculate the probability of an event from the favorable and possible outcomes. See the result as a percentage, a decimal and a fraction.
CalculateRatio
Simplify a ratio to its lowest terms, or solve a proportion to find a missing value. Enter two numbers to reduce A:B, or add a third to solve A:B = C:?.
CalculateExponent
Raise any number to a power. Enter a base and an exponent — including negative and fractional exponents — to get the result.
Calculate