Permutation and Combination Using Calculator
- Combinations (nCr)
- Result
- Total items (n)
- 10
- You entered
- Items chosen (r)
- 3
- You entered
This calculator works out permutations (nPr) and combinations (nCr) for a set of n items taken r at a time. You enter the total number of items (n) and how many you choose (r), and you get both the number of ordered arrangements (permutations) and the number of unordered selections (combinations). The formulas use factorials, and the calculator handles the arithmetic instantly so you can focus on the problem.
Formula
Permutations count ordered arrangements, so the order of selection matters. The formula is:
nPr = n! / (n – r)!
Combinations count unordered groups, so order does not matter. The formula is:
nCr = n! / [r! × (n – r)!]
Where:
- n = total number of distinct items (a positive integer)
- r = number of items selected (a non-negative integer, r ≤ n)
- ! = factorial, meaning the product of all positive integers up to that number (e.g., 5! = 5 × 4 × 3 × 2 × 1 = 120)
Both formulas assume all items are distinct and that you select without replacement (you cannot pick the same item twice).
Worked Example
Using the default values from the calculator: n = 10, r = 3.
First, compute the factorials:
- 10! = 10 × 9 × 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 3,628,800
- (10 – 3)! = 7! = 7 × 6 × 5 × 4 × 3 × 2 × 1 = 5,040
- 3! = 3 × 2 × 1 = 6
Now apply the permutation formula:
nPr = 10! / 7! = 3,628,800 / 5,040 = 720
Apply the combination formula:
nCr = 10! / (3! × 7!) = 3,628,800 / (6 × 5,040) = 3,628,800 / 30,240 = 120
So with 10 items taken 3 at a time, there are 720 permutations and 120 combinations. The calculator gives the same results.
When to Use Permutations vs. Combinations
The key question is: Does order matter?
- Use permutations (nPr) when order matters. Examples: arranging books on a shelf, assigning medals (gold, silver, bronze), creating passwords where the sequence of characters is important.
- Use combinations (nCr) when order does not matter. Examples: choosing a committee from a group, picking lottery numbers, selecting toppings for a pizza.
A common trap is thinking order matters when it doesn’t, or vice versa. For instance, picking a president, vice-president, and secretary from a club is a permutation because each role is different. But simply selecting three members to form a committee is a combination because all members have equal standing.
How to Use the Calculator
Enter two numbers:
- n – the total number of distinct items available.
- r – how many items you are choosing.
The calculator immediately shows both nPr and nCr. It also works for larger numbers, but be aware that factorials grow extremely fast. For example, 100! has 158 digits, so even a calculator may struggle with very large n. In such cases, you can often simplify the formula before computing.
For example, to compute 100P3, you don’t need 100! – you just multiply 100 × 99 × 98 = 970,200. Similarly, 100C3 = (100 × 99 × 98) / (3 × 2 × 1) = 161,700.
Common Mistakes and Misconceptions
- Entering r > n: If you choose more items than you have, the result is zero because it’s impossible. The calculator will show 0 for both.
- Using the wrong formula: Forgetting to divide by r! in combinations leads to an overcount. Always ask: does order matter?
- Confusing nCr with nPr notation: Some texts use C(n,r) or nCr, and P(n,r) or nPr. They are the same formulas.
- Rounding errors: Factorials are exact integers, so there is no rounding – but if you use a calculator that rounds intermediate steps, you might get a slightly off result. This calculator uses exact integer arithmetic.
- Assuming repetition is allowed: These formulas are for without replacement. If you can reuse items (like a combination lock), the formulas are different: n^r for permutations with repetition, and C(n+r-1, r) for combinations with repetition.
Limits of the Formulas
The formulas assume all n items are distinct. If you have identical items (e.g., 5 red balls and 3 blue balls), the count changes. For permutations with repeated items, you divide by the factorials of the counts of each identical group. For combinations with identical items, you need a different approach.
Also, these formulas count selections without regard to order. If you need to account for order and repetition, use different formulas. The calculator is designed for the classic no-repetition case, which is the most common in introductory probability and combinatorics.
For very large n and r, the numbers can exceed the display capacity of a standard calculator. In that case, use logarithms or a scientific calculator with large-number support. This calculator will still show the result, but it may be in scientific notation if it’s extremely large.
Frequently Asked Questions
What is the difference between permutation and combination?
Permutation counts arrangements where order matters, so ABC and BCA are different. Combination counts groups where order does not matter, so ABC and BCA are the same. For n items taken r at a time, permutations are always larger than combinations because each combination corresponds to r! different orderings.
Can I use this calculator for problems with repetition?
No, this calculator assumes no repetition. If repetition is allowed, use n^r for permutations (e.g., a 4-digit PIN from 0-9 gives 10^4 = 10,000 possibilities). For combinations with repetition, use C(n+r-1, r).
What if r is 0?
If you choose 0 items, there is exactly one way to do it: choose nothing. So nPr = 1 and nCr = 1 for any n. The calculator handles this correctly because 0! = 1 by definition.
Why does my calculator give a different answer than this one?
Some calculators use a different key sequence or require you to enter n and r in a specific order. Also, some cheap calculators may use floating-point arithmetic, which can introduce rounding errors for large numbers. This calculator uses exact integer math, so it is accurate for all valid inputs.
How do I calculate permutations and combinations by hand?
For small numbers, write out the factorial. For example, 5P2 = 5! / 3! = (5 × 4 × 3 × 2 × 1) / (3 × 2 × 1) = 20. For 5C2 = 5! / (2! × 3!) = 120 / (2 × 6) = 10. For larger numbers, cancel common factors before multiplying to keep the numbers manageable.
What is the relationship between nPr and nCr?
The relationship is: nPr = nCr × r!. In other words, each combination can be arranged in r! different orders to form permutations. So if you know one, you can find the other. For example, 10C3 = 120, and 120 × 6 = 720, which is 10P3.
Related
Formula used
in n | Total items (n) | - | 10 | 0 in r | Items chosen (r) | - | 3 | 0 out perm | Permutations (nPr) | - | npr(n,r) | 0 out comb | Combinations (nCr) | - | ncr(n,r) | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.