Combinations Calculator (nCr)
Calculate the number of possible combinations that can be obtained by taking a sample of items from a larger set.
Solution Steps
Common Combination Problems
Click on any example to see the calculation and solution:
Combinations Calculator (nCr)
Combinations Calculator (nCr) helps determine the number of ways a subset of items can be selected from a larger group, where the order of selection does not matter. In mathematics, this concept is central to combinatorics — the study of counting, arrangements, and probability.
Combinations appear in everyday problems, from forming committees to calculating lottery odds. Whether you are solving a classroom problem, analyzing statistical outcomes, or programming a probability model, understanding how combinations work is essential to mastering discrete mathematics.
What Is a Combination?
A combination represents a selection of objects from a set without considering the order in which they are chosen.
If there are n total objects, and you select r of them, the number of possible combinations is written as C(n, r) or nCr.
In simpler terms:
- Order does not matter. Choosing {A, B} is the same as choosing {B, A}.
- Repetition is not allowed (unless specified as a replacement problem).
Combinations contrast with permutations, where order does matter. For example, choosing 3 letters from {A, B, C, D} yields 4C3 = 4 combinations, but 4P3 = 24 permutations.
nCr Formula — The Combination Formula in Maths
The combination formula is expressed as:
C(n, r) = n! / (r! × (n − r)!)
Where:
- n = total number of items
- r = number of items chosen
- ! = factorial, the product of all positive integers up to that number
For instance, 5! = 5 × 4 × 3 × 2 × 1 = 120.
This formula calculates the number of distinct ways to select r items from n total objects without regard to order. It is sometimes called “n choose r”, r-combination, or binomial coefficient.
Understanding Factorials in the nCr Formula
Factorials are the foundation of combinatorics. The factorial function counts how many ways objects can be arranged in sequence.
- n! (n factorial) = number of ways to arrange n objects in order
- r! (r factorial) = number of ways to arrange r selected objects
- (n − r)! = arrangements of the remaining unselected objects
Substituting these into the nCr formula removes order from the calculation, giving only the distinct groupings — the combinations.
For a deeper look at factorial variations, explore related topics such as Factorials Calculator and Multi-Factorials.
Example 1: Choosing Prizes from a Set
Problem:
A contest winner may choose 2 prizes from a table of 6 available items.
How many different combinations of prizes can be chosen?
Solution:
n = 6, r = 2
C(6, 2) = 6! / (2! × (6 − 2)!)
= (6 × 5 × 4!)/(2 × 1 × 4!)
= 15
Answer: 15 possible combinations of prizes.
The order doesn’t matter — choosing {Prize 1, Prize 3} is the same as {Prize 3, Prize 1}.
Example 2: Selecting Students for a Competition
Problem:
A teacher must select 3 students from a class of 25 to represent the school in a spelling bee.
How many unique groups of 3 can be formed?
Solution:
n = 25, r = 3
C(25, 3) = 25! / (3! × (25 − 3)!)
= 25 × 24 × 23 / (3 × 2 × 1)
= 2,300
Answer: 2,300 unique student combinations.
This example demonstrates the power of combinations in real-world sampling problems, where order is irrelevant but uniqueness matters.
Example 3: Menu Item Selection
Problem:
From a restaurant menu of 18 dishes, a customer selects 4 favourites.
How many possible groups of dishes could be chosen?
Solution:
n = 18, r = 4
C(18, 4) = 18! / (4! × (18 − 4)!)
= 18 × 17 × 16 × 15 / (4 × 3 × 2 × 1)
= 3,060
Answer: 3,060 possible menu combinations.
The Handshake Problem — A Classic nCr Application
In a group of n people, how many unique handshakes can occur if everyone shakes hands exactly once with everyone else?
Each handshake involves 2 people, so we are choosing 2 from n.
That means we use the combination formula C(n, 2).
C(n, 2) = n! / (2! × (n − 2)!) = n × (n − 1) / 2
For example, if n = 3:
C(3, 2) = 3 × 2 / 2 = 3 handshakes.
The pairs are (1, 2), (1, 3), and (2, 3).
This equation elegantly avoids double-counting reciprocal pairs, ensuring that (1, 2) and (2, 1) count as the same handshake.
Combinations With Replacement
Sometimes, selections allow repetition — for example, choosing multiple scoops of the same ice-cream flavour. This is known as combinations with replacement or multichoose.
The formula becomes:
CR(n, r) = C(n + r − 1, r) = (n + r − 1)! / (r! × (n − 1)!)
Here, order still does not matter, but items can be repeated.
Example: choosing 3 fruits from 5 options (allowing duplicates).
CR(5, 3) = C(5 + 3 − 1, 3) = C(7, 3) = 35
So, 35 different fruit selections are possible when duplicates are allowed.
You can explore more about this topic using the Combinations With Replacement Calculator.
Combinations vs Permutations
Combinations ignore order, while permutations count every possible ordering.
| Concept | Formula | Order Matters? | Example (n = 4, r = 2) | Result |
|---|---|---|---|---|
| Combination (nCr) | n! / (r! × (n − r)!) | No | {A, B}, {A, C}, {B, C} | 6 |
| Permutation (nPr) | n! / (n − r)! | Yes | AB, BA, AC, CA, BC, CB | 12 |
In combinatorial problems, always identify whether order affects the outcome. For ordered scenarios like seating arrangements or password generation, use permutations instead.
For a focused study of order-sensitive cases, refer to Permutations Calculator.
Applying the Combination Formula in Real Life
Combinations have wide-ranging applications in science, mathematics, and daily life. A few common examples include:
- Lottery systems: calculating the odds of selecting winning numbers.
- Genetics: determining possible genotype pairings.
- Statistics and probability: calculating event outcomes without sequence dependency.
- Cryptography: analyzing key selection possibilities.
- Scheduling and grouping: choosing members for committees or project teams.
Whenever you need to determine how many ways a subset can be chosen from a larger pool without regard to order, the nCr formula provides the mathematical foundation.
Extended Example: Sandwich Combinations Problem
Imagine a deli offering choices in four categories:
- 8 breads
- 5 meats
- 5 cheeses
- 3 toppings
If one item is chosen from each category, the total possible combinations are found by multiplying the possibilities:
8 × 5 × 5 × 3 = 600 sandwich combinations
Now, suppose customers can choose several items from each category:
- 1 bread from 8 options → C(8, 1) = 8
- 3 meats from 5 options → C(5, 3) = 10
- 2 cheeses from 5 options → C(5, 2) = 10
- 0–3 toppings from 3 options → C(3, 0) + C(3, 1) + C(3, 2) + C(3, 3) = 8
Multiplying all gives:
8 × 10 × 10 × 8 = 6,400 sandwich combinations
If toppings and meats can be repeated (replacements allowed), use the replacement formula:
- Bread = 8
- Meats = CR(5, 3) = 35
- Cheeses = CR(5, 2) = 15
- Toppings = 8
Then:
8 × 35 × 15 × 8 = 33,600 possible sandwich combinations
This illustrates how combinations with and without replacement can yield vastly different totals.
Visualizing Combinations with Pascal’s Triangle
A fascinating connection exists between Pascal’s Triangle and the nCr formula. Each row in Pascal’s Triangle represents the coefficients of combinations for increasing values of n.
For example, the 5th row (1, 5, 10, 10, 5, 1) corresponds to:
C(5, 0), C(5, 1), C(5, 2), C(5, 3), C(5, 4), C(5, 5)
This structure makes Pascal’s Triangle a quick, visual way to determine combination values without directly computing factorials.
Learn more about this relationship in the Pascal’s Triangle Calculator.
nCr in Probability and Statistics
Combinations are a cornerstone of binomial probability, used to calculate outcomes where each trial has two possible results (success/failure). The number of ways successes can occur in n independent trials is determined by nCr.
For instance, in flipping a coin 4 times, the number of ways to get exactly 2 heads is:
C(4, 2) = 6
Thus, there are 6 possible outcomes with exactly 2 heads.
This principle underpins the binomial theorem, which expands expressions like (a + b)ⁿ into a weighted sum of terms, each coefficient derived from the combination formula.
Common Mistakes to Avoid in Combination Calculations
- Confusing permutations with combinations: Always verify whether order matters.
- Ignoring the factorial’s lower limits: Factorials are only defined for non-negative integers.
- Applying nCr when replacements are allowed: Use the CR(n, r) version instead.
- Mixing up n and r: n must always be greater than or equal to r.
- Overlooking simplification: Cancel factorial terms before calculating to avoid large unnecessary computations.
Quick Reference for Common nCr Values
| n | r | C(n, r) |
|---|---|---|
| 5 | 2 | 10 |
| 6 | 3 | 20 |
| 8 | 4 | 70 |
| 10 | 2 | 45 |
| 10 | 5 | 252 |
| 12 | 3 | 220 |
| 15 | 5 | 3,003 |
| 20 | 10 | 184,756 |
These values demonstrate how rapidly combinations grow as n and r increase — one reason why computational calculators are valuable for large sets.
Combinations — expressed through the nCr formula — capture one of mathematics’ most elegant ideas: how to count possibilities when order does not matter. From small classroom examples to large-scale probability models, this concept underlies much of statistics, computing, and everyday decision analysis.
Understanding the Combinations Calculator (nCr) formula and its variations, such as combinations with replacement, equips you to analyze countless real-world problems — from drawing cards to predicting outcomes in probability theory.
Mathematics thrives on patterns, and combinations reveal one of its most fundamental: the harmony between order, selection, and possibility.
