Combination Calculator with 3 Variables
- Permutations
- Result
- Total items (n)
- 10
- You entered
- Chosen items (r)
- 3
- You entered
This combination calculator works out how many ways you can choose a subset of items from a larger set when you have three variables: the total number of items (n), the number you choose (r), and whether repetition is allowed. You enter n, r, and toggle repetition on or off, and you get the number of combinations (and the number of permutations) instantly.
Formula
The core formula depends on whether repetition is allowed:
- Without repetition (the classic “n choose r”):
\[ C(n, r) = \frac{n!}{r!(n-r)!} \] - With repetition (stars and bars):
\[ C(n+r-1, r) = \frac{(n+r-1)!}{r!(n-1)!} \]
Where:
- n = total number of distinct items (a positive integer)
- r = number of items you select (a non-negative integer, can be larger than n when repetition is allowed)
- ! = factorial (e.g., 5! = 5×4×3×2×1 = 120)
The calculator also shows permutations: without repetition, \( P(n,r) = \frac{n!}{(n-r)!} \), and with repetition, \( n^r \).
Worked Example
Using the default values (n=10, r=3, repetition not allowed):
- Compute factorials: 10! = 3,628,800; 3! = 6; 7! = 5,040.
- Plug into the formula: \( \frac{3,628,800}{6 \times 5,040} = \frac{3,628,800}{30,240} = 120 \).
- Permutations: \( \frac{10!}{7!} = 10 × 9 × 8 = 720 \).
The calculator returns 120 combinations and 720 permutations for these defaults.
When to Use Combinations vs. Permutations
Use combinations when the order of selection does not matter. For example:
- Choosing 3 toppings from 10 available for a pizza (pepperoni, mushroom, onion is the same as onion, mushroom, pepperoni).
- Selecting a committee of 3 people from a group of 10.
- Picking 6 numbers in a lottery where the order drawn does not matter.
Use permutations when order matters:
- Arranging 3 books on a shelf from a set of 10.
- Assigning 3 distinct roles (president, secretary, treasurer) to 3 people from a group of 10.
- Creating a 3-digit PIN from digits 0-9 (with repetition, that’s 10³ = 1,000).
Common Mistakes and How to Avoid Them
- Switching n and r: C(10,3) and C(10,7) are equal (both 120), but C(3,10) is meaningless without repetition. Always define which is the set size and which is the selection size.
- Forgetting repetition: If you can pick the same item more than once, you must use the stars-and-bars formula, not the standard one. For n=5, r=3, without repetition gives 10; with repetition gives 35.
- Using combinations when order matters: A common error is using C(n,r) for PINs or passwords. Those are permutations (and usually with repetition).
- Rounding factorials: Factorials grow fast; 20! is about 2.43×10¹�. Do not round intermediate steps—use exact integers.
Limits of the Formula
The formulas assume all items are distinct and that selection is without replacement (unless repetition is explicitly allowed). They do not apply when:
- Items are grouped or have constraints (e.g., “at least one from category A”).
- You need to count arrangements with identical items (multinomial coefficients).
- The selection process involves replacement but order matters (that’s permutations with repetition, \( n^r \)).
Also, for very large n and r (e.g., n=10,000, r=5,000), the numbers become astronomically large; the calculator may not display them exactly. In practice, you often use logarithms or approximations for such cases.
Practical Applications
Combination counting appears in many fields:
- Probability: The denominator of a probability often counts total outcomes. For example, the chance of getting exactly 2 heads in 5 coin flips is \( \frac{C(5,2)}{2^5} = \frac{10}{32} \).
- Lottery odds: The number of possible tickets in a 6/49 lottery is \( C(49,6) = 13,983,816 \).
- Card games: The number of possible 5-card poker hands is \( C(52,5) = 2,598,960 \).
- Sampling: When drawing a sample of size r from a population of n, the number of possible samples is \( C(n,r) \).
Frequently Asked Questions
What is the difference between combinations and permutations?
Combinations ignore order; permutations count order as different. For example, choosing 2 letters from {A,B,C}: combinations give {AB, AC, BC} (3), while permutations give AB, BA, AC, CA, BC, CB (6).
Can r be greater than n?
Without repetition, no—you cannot choose more items than exist. With repetition, yes, because you can pick the same item multiple times. For example, choosing 3 scoops of ice cream from 5 flavors (with repetition) gives \( C(5+3-1,3) = C(7,3) = 35 \).
What does “with repetition” mean exactly?
It means after selecting an item, you put it back and can select it again. In the ice cream example, you can choose chocolate three times. The formula \( C(n+r-1, r) \) counts the number of multisets of size r from n types.
Why does the calculator show permutations too?
Because many people confuse the two. Seeing both side by side helps you check which one matches your problem. If order matters, use the permutation result; if not, use the combination result.
How do I calculate combinations with a calculator that doesn’t have an nCr button?
You can use the factorial formula directly: \( C(n,r) = \frac{n!}{r!(n-r)!} \). Many scientific calculators have a factorial key. Alternatively, you can use this online calculator.
What if I have more than three variables?
This calculator handles the three essential variables: n, r, and repetition. If you have additional constraints (e.g., minimum from a subgroup), you’ll need to break the problem into smaller combination problems and combine the results using the multiplication or addition principle.
Related
Formula used
in n | Total items (n) | - | 10 | 1 in r | Chosen items (r) | - | 3 | 0 sel rep | Repetition allowed? | No=0, Yes=1 out comb | Combinations | - | ncr(n+r-1, r) * (1-rep) + ncr(n+r-1, r) * rep | 0 out perm | Permutations | - | (npr(n, r) * (1-rep)) + (n^r * rep) | 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.