Combination & Permutation Calculator
Calculate C(n,r) combinations, P(n,r) permutations and n! factorial with exact results.
1,267 views
Combination vs. Permutation, and How They're Calculated
Both formulas count the number of ways to choose r items out of a group of n, but they answer a different question depending on whether the order of selection matters.
In a permutation, order matters — swapping two chosen items produces a different, distinct outcome. The formula is P(n,r) = n! ÷ (n−r)!. In a combination, order does not matter — the same group counts only once no matter how it was arranged. The formula is C(n,r) = n! ÷ (r! × (n−r)!), which is just the permutation formula divided by r! to cancel out the ways of reordering the same r items.
Worked example: from 5 people, choosing 3 to fill a podium — 1st, 2nd, 3rd place — is a permutation, because Alice-Bob-Carol finishing 1st-2nd-3rd is a different result from Bob-Alice-Carol. P(5,3) = 5!/(5-3)! = 120/2 = 60 possible orderings. Choosing the same 3 people to form an unordered 3-person committee is a combination — Alice, Bob and Carol as a committee is the same committee regardless of who was named first. C(5,3) = 5!/(3!×2!) = 120/12 = 10 possible committees. Both use the same 5 people and pick 3, but the different question — does the arrangement matter? — changes the answer from 60 to 10.
The tool also computes plain factorials (n!), the building block behind both formulas: n! is the product of every integer from 1 to n, and it grows extremely fast (10! is already 3,628,800). For n large enough that a regular calculator would run out of precision, this tool uses exact big-integer arithmetic instead of floating-point math, so results up to n = 5000 come out precise to the last digit rather than in rounded scientific notation.
What You Should Know
- The quickest test: ask "if I reorder the same items, is it a different outcome?" If yes, use permutation; if no, use combination. Lottery numbers, committees, hands of cards and ingredient lists are combinations. Passwords, race rankings, and podium finishes are permutations.
- 0! = 1 by definition, not by calculation — there is exactly one way to arrange zero items (do nothing), and this convention keeps formulas like C(n,n) = n!/(n!×0!) = 1 correct: there is only one way to choose an entire group.
- C(n,r) always equals C(n, n−r) — choosing which 3 of 10 people join a committee is the same count as choosing which 7 stay out, since both describe the same split.
- A frequent mistake is using the permutation formula for a genuinely unordered situation (like a raffle draw), which inflates the count by a factor of r! — always confirm whether swapping the order changes the outcome before picking a formula.
- Scale: this tool handles n up to 5000 with exact big-integer results, far past where ordinary floating-point calculators start rounding or overflowing.
Frequently Asked Questions
When do I use combination vs. permutation?
Ask whether order matters. Lottery numbers, committees and card hands are combinations; passwords, rankings and podium finishes are permutations.
What is 0! and why?
By definition 0! = 1. This convention keeps the formulas consistent — e.g. C(n,n) = n! ÷ (n! × 0!) = 1, which is correct: there is exactly one way to choose everything.
How large can n be?
The tool uses exact big-integer arithmetic up to n = 5000, far beyond what floating-point calculators handle without rounding errors.
Why does the podium example give 60 permutations but only 10 combinations for the same 5 people and 3 spots?
A permutation counts every distinct order separately: P(5,3) = 5!/(5-3)! = 60. A combination groups all orderings of the same 3 people together, dividing by 3! = 6 to remove the reorderings — C(5,3) = 60/6 = 10. That 6-to-1 ratio is exactly r! = 3! = 6, the number of ways to arrange the 3 chosen items.
Why is C(n,r) always equal to C(n, n-r)?
Choosing which r items to include is the same decision as choosing which n-r items to leave out — both describe the identical split of the group into two parts. For example, C(10,3) = C(10,7) = 120: picking 3 people for a committee automatically decides which 7 are not on it.
Similar Tools
Report a Problem
Combination & Permutation Calculator
Comments
No comments yet — be the first to write one!