How to Use This Calculator
This calculator computes both combinations (nCr) and permutations (nPr) simultaneously, along with a full factorial breakdown so you can see exactly how the result is derived. It is useful for students learning combinatorics, professionals working with probability, and anyone who needs to count arrangements or selections.
Steps:
- Enter n β the total number of items in your set
- Enter r β the number of items you are choosing or arranging
- Both results appear instantly along with the step-by-step calculation
Note: r must be between 0 and n (inclusive). The calculator supports values up to 170 due to the limitations of JavaScript's number precision for large factorials.
What Are Permutations?
A permutation is an arrangement of items where the order matters. If you are selecting r items from a set of n items and arranging them in a specific sequence, you are counting permutations.
nPr = n! / (n β r)!Example: How many ways can 3 people be arranged in a line from a group of 5?
5P3 = 5! / (5 β 3)! = 120 / 2 = 60There are 60 unique ways to arrange 3 people from a group of 5. The arrangements ABC, ACB, BAC, BCA, CAB, and CBA are all counted as separate permutations because order matters.
What Are Combinations?
A combination is a selection of items where the order does not matter. If you are choosing r items from a set of n items and do not care about the arrangement, you are counting combinations.
nCr = n! / (r! Γ (n β r)!)Example: How many ways can you choose a committee of 3 people from a group of 5?
5C3 = 5! / (3! Γ 2!) = 120 / (6 Γ 2) = 120 / 12 = 10There are only 10 unique committees. The groups (Alice, Bob, Carol) and (Carol, Bob, Alice) are the same combination because order does not matter β unlike permutations, which would count them separately.
Key Differences: Permutations vs. Combinations
| Property | Permutations (nPr) | Combinations (nCr) |
|---|---|---|
| Order matters? | Yes | No |
| Formula | n! / (nβr)! | n! / (r! Γ (nβr)!) |
| Relationship | nPr = nCr Γ r! | nCr = nPr / r! |
| Result | Always β₯ nCr | Always β€ nPr |
| Use when | Arranging items in sequence | Selecting items from a group |
The key question to ask is: βDoes the order in which I arrange the items change the outcome?β If yes, use permutations. If no, use combinations. Every permutation of the same set of items corresponds to one combination, which is why nPr = nCr Γ r!.
Real-World Applications
- Lottery odds: A 6/49 lottery uses combinations (49C6 = 13,983,816) because the order of drawn numbers does not matter. Your chance of winning is 1 in roughly 14 million.
- Password security: A 4-digit PIN has 10,000 permutations (10P4 with repetition). A 4-character alphanumeric password has 36^4 = 1,679,616 possible permutations with repetition.
- Scheduling: Arranging 5 meetings in 5 time slots is a permutation problem (5! = 120 possible schedules).
- Card games: A 5-card poker hand from a 52-card deck is 52C5 = 2,598,960 possible hands. The order of cards in your hand does not matter, so it is a combination.
- Team selection: Choosing 11 starting players from a squad of 25 is 25C11 = 4,457,400 possible lineups. Substituting players changes the combination.
- Genetics: DNA sequences and protein folding involve combinatorial calculations to determine the number of possible configurations.
Frequently Asked Questions
What is the value of 0! (zero factorial)?
Zero factorial equals 1 (0! = 1). This is a mathematical convention that makes the formulas work correctly. For example, nC0 = 1 (there is exactly one way to choose zero items from any set: choose nothing), and this only works if 0! = 1.
What is the maximum value of n I can enter?
This calculator supports n up to 170 because 171! exceeds the maximum value representable by JavaScript's standard number type (approximately 1.8 Γ 10^308). For larger values, you would need arbitrary-precision arithmetic, which is beyond the scope of this tool.
Why is nCr always smaller than nPr?
Because nCr = nPr / r!. The division by r! accounts for all the orderings of the same r items that permutations count separately. For example, 5P3 = 60 but 5C3 = 10 because each group of 3 items has 3! = 6 orderings, and 60 / 6 = 10.
What does nCr equal when r = 0 or r = n?
When r = 0, nC0 = 1 (there is one way to choose nothing). When r = n, nCn = 1 (there is one way to choose all items). This symmetry also means nCr = nC(nβr). For example, 10C3 = 10C7 = 120.
How do combinations with repetition work?
Standard nCr assumes no repetition (each item is chosen at most once). When items can be repeated (e.g., choosing scoops of ice cream where you can pick the same flavor multiple times), the formula becomes (n+rβ1)Cr instead of nCr. This calculator does not currently support combinations with repetition.
How do I calculate the probability of a specific combination?
Divide the number of favorable outcomes by the total number of possible outcomes. For example, the probability of drawing a specific 5-card poker hand is 1 / 52C5 = 1 / 2,598,960. If you want the probability of any flush, count all flushes and divide by 52C5.