Combination & Permutation Calculator
Calculate the number of combinations (nCr) and permutations (nPr) for choosing r items from n.
Cómo funciona
This calculator finds two related but distinct quantities: permutations, which count ordered arrangements, and combinations, which count unordered selections, both for choosing r items from a group of n.
Permutations use the formula P(n,r) = n! / (n−r)!, where ! denotes factorial (the product of all positive integers up to that number, e.g., 5! = 5×4×3×2×1 = 120). This counts every distinct ordering of r items chosen from n — arranging 3 people from a group of 5 into 1st, 2nd, and 3rd place gives P(5,3) = 5!/(5-3)! = 120/2 = 60 possible orderings.
Combinations use the formula C(n,r) = P(n,r) / r!, which takes the permutation count and divides out the different orderings of the same r items, since combinations don't care about order. Choosing 3 people from 5 to form a committee (where the order they're picked in doesn't matter) gives C(5,3) = 60/3! = 60/6 = 10 possible committees.
The distinguishing question to ask is simply: does order matter? Choosing a president, vice-president, and treasurer from 5 candidates is a permutation problem (ABC and BCA are different outcomes, since the roles differ), while choosing 3 people to form an unranked committee from the same 5 candidates is a combination problem (the same 3 people form one committee regardless of the order they were selected in).
Combinations and permutations are foundational to probability calculations: the odds of winning a lottery, the number of possible poker hands, and the number of ways to arrange a shuffled deck of cards are all classic examples solved with these exact formulas.
As n and r grow, both quantities grow extremely fast due to the factorial terms involved — choosing just 6 items from a group of 49 (a common lottery format) already produces nearly 14 million possible combinations, illustrating why factorial-based counting problems can produce astronomically large numbers from relatively small inputs.
Both formulas are foundational building blocks in the broader field of combinatorics, the branch of mathematics dealing with counting, arrangement, and combination problems — beyond probability, these same principles underpin password strength estimation, scheduling problems, and genetics (counting possible gene combinations), among many other applications.
What's the difference between the two?
Permutations care about order (ABC ≠ BCA); combinations don't (ABC = BCA counts once).
How do I know whether to use a permutation or combination?
Ask whether order matters for your problem — ranking or assigning distinct roles is a permutation; selecting an unordered group is a combination.
What does the factorial symbol (!) mean?
It's the product of all positive integers up to that number — 5! means 5×4×3×2×1 = 120. By convention, 0! equals 1.
How is a combination calculated from a permutation?
Divide the permutation count by r! (the factorial of the number of items chosen) — this removes the different orderings of the same selected items, since combinations ignore order.
Why do lottery odds use combinations rather than permutations?
The order the winning numbers are drawn in doesn't matter for winning — only which numbers are selected — making it a combinations problem, not a permutations one.
Can r be larger than n?
No — you can't choose more items than exist in the group, so r must be less than or equal to n for both permutations and combinations to be defined.
Why do these numbers get so large so quickly?
Factorials grow explosively as their input increases, so even modest values of n and r can produce combination or permutation counts in the millions or more.
What's a real-world example of a permutation problem?
Arranging a specific batting order for 9 players, or assigning first, second, and third place in a race — any scenario where the assigned order or role matters.
What field of mathematics do these formulas belong to?
Combinatorics — the branch of mathematics focused on counting, arranging, and combining objects, with applications spanning probability, computer science, and genetics.
Are these formulas used outside of probability and games of chance?
Yes — password strength estimation, scheduling and resource allocation problems, and counting possible genetic combinations all rely on the same underlying permutation and combination principles.