What Are Combinations?
Combinations count the number of ways to choose r items from a set of n items where the order of selection does not matter. For example, if you have 5 books and want to take 3 on a trip, the number of possible selections is 10, regardless of which book you pick first. The formula is nCr = n! / (r!(n - r)!), where the exclamation mark denotes factorial, the product of all positive integers up to that number.
Permutations are closely related but count selections where order does matter. Arranging 3 of 5 books on a shelf gives 60 possible orderings, because each combination of 3 books can be arranged in 6 different sequences. The permutation formula is nPr = n! / (n - r)!. For a broader tool covering both, see our Permutation and Combination Calculator.
What This Calculator Does
This combination calculator takes two non-negative integers n and r, then computes both nCr (combinations) and nPr (permutations). It also shows a step-by-step factorial breakdown so you can see exactly how each result is derived.
- Inputs: Total items n and items chosen r
- Outputs: nCr, nPr, and factorial breakdown for n!, r!, and (n - r)!
How the Calculation Works
nCr = n! / (r! × (n - r)!)
nPr = n! / (n - r)!
The factorial n! is the product of all integers from 1 to n. For combinations, dividing by r! removes the overcounting that occurs when the same r items are selected in different orders. For permutations, no such division is needed because each ordering is considered distinct. For factorial-only calculations, use our Factorial Calculator.
Example Calculation
Example: How many ways can you choose 3 items from a set of 5? Here n = 5 and r = 3. We compute 5! = 120, 3! = 6, and (5 - 3)! = 2! = 2. Then nCr = 120 / (6 × 2) = 120 / 12 = 10, and nPr = 120 / 2 = 60. So there are 10 combinations and 60 permutations.
Real-World Applications
Combinations appear in probability, statistics, and everyday decision-making. Lottery odds are calculated using combinations, since the order of drawn numbers does not matter. In quality control, combinations determine how many ways a sample can be drawn from a batch. In genetics, combinations help calculate the number of possible allele pairings. For probability calculations involving events, try our Probability Calculator.