Combinations Calculator

A combinations calculator helps you figure out how many ways you can select a group of items from a larger set when the order of selection doesn't matter. Pick 3 players from a squad of 10? Choose 5 toppings from a menu of 12? That's combinations territory. This tool takes two inputs, the total number of items (n) and the number you want to choose (r), and returns the count of unique groups possible. No need to work through the math by hand. But understanding what's going on under the hood makes the results a lot more useful, especially when you're applying them to probability problems or real decisions.

Enter Details

C(n, r) = n! / (r!(n−r)!)

Result

n choose r

Note — This result is an estimate. Talk to a healthcare provider for personalized guidance.

How to Calculate Combinations

Calculating combinations comes down to one core idea: you're counting distinct groups, not arrangements. If you pick items A, B, and C, that counts as exactly the same group as C, B, and A. The order is irrelevant.

The process has three steps. First, determine n, the total pool of items. Second, determine r, how many you're choosing. Third, plug those numbers into the combinations formula. The formula handles the rest by dividing out all the redundant orderings that permutations would otherwise count separately.

For small numbers, you can sometimes list out groups by hand to verify. For larger numbers, the formula (or a calculator) is the only practical route because the values grow fast.

nCr Calculator (Combination Formula)

The notation nCr (also written as C(n, r) or the binomial coefficient) is the standard way to express a combination. You'll see it written with a big C between the two numbers, or as n over r inside parentheses in formal math texts. All of these mean the same thing: choose r items from a set of n.

The formula is:

nCr = n! / (r! × (n − r)!)

The exclamation mark denotes a factorial, which means you multiply a whole number by every positive integer below it. So 5! = 5 × 4 × 3 × 2 × 1 = 120. The formula uses factorials to count all possible arrangements and then cancel out the ones that are just reorderings of the same group.

Understanding n Choose r

When someone says "n choose r," they're describing the act of selecting r objects from a collection of n distinct objects. The phrase itself is borrowed directly from everyday language: you have n things, and you're choosing r of them.

What makes this concept useful is the constraint that order doesn't matter. That single rule is what separates combinations from permutations. If you're choosing a 3-person committee from 8 candidates, the committee of Alice, Bob, and Carol is identical to the committee of Carol, Alice, and Bob. You don't care who was picked first.

The value of nCr is always a whole number, and it's always at least 1 (since choosing all n items or choosing none are both valid, if trivial, cases). It also has a nice symmetry: C(n, r) always equals C(n, n−r). Choosing 3 from 10 gives the same count as choosing 7 from 10, because every group of 3 you select implicitly defines a group of 7 left behind.

Factorial Calculation in Combinations

Factorials are the engine behind the combinations formula. The factorial of a number n, written n!, is the product of all positive integers from 1 up to n. By definition, 0! equals 1, which keeps the formula from breaking down in edge cases like choosing 0 items.

Here's a quick reference:

  • 1! = 1
  • 2! = 2
  • 3! = 6
  • 4! = 24
  • 5! = 120
  • 10! = 3,628,800

Factorials get large very quickly, which is why manual calculation becomes unwieldy for anything above n = 10 or so. In the combinations formula, though, a lot of that cancels out. When you compute 10! / (3! × 7!), you don't actually need to multiply all the way to 10! because the 7! in the denominator cancels most of the terms in the numerator, leaving you with just (10 × 9 × 8) / (3 × 2 × 1) = 120.

Combinations Formula

The combinations formula is:

C(n, r) = n! / (r! × (n − r)!)

Let's walk through a concrete example. Suppose you want to know how many ways you can choose 2 items from a set of 5. Plug in n = 5 and r = 2:

C(5, 2) = 5! / (2! × 3!) = (5 × 4 × 3 × 2 × 1) / ((2 × 1) × (3 × 2 × 1)) = 120 / (2 × 6) = 120 / 12 = 10

So there are exactly 10 unique pairs you can pull from a group of 5 items. You can verify this by listing them if you want: {1,2}, {1,3}, {1,4}, {1,5}, {2,3}, {2,4}, {2,5}, {3,4}, {3,5}, {4,5}. Ten pairs, exactly as the formula says.

The formula works for any valid values of n and r, as long as r is between 0 and n (inclusive). If r is greater than n, there's no valid combination and the result is 0.

Combinations with Repetition

Standard combinations assume you can't pick the same item twice. But sometimes repetition is allowed. Think of choosing 3 scoops of ice cream from 5 flavors: you're allowed to pick the same flavor more than once. That's a combinations-with-repetition problem, and it needs a different formula.

This concept goes by a few names: combinations with repetition, multisets, or "stars and bars" in combinatorics. The setup is familiar but the counting changes significantly because the same item can appear multiple times in your selection.

Formula for Combinations with Repetition

The formula for combinations with repetition is:

C(n + r − 1, r) = (n + r − 1)! / (r! × (n − 1)!)

Here, n is still the number of distinct item types and r is how many you're selecting. Using the ice cream example: 5 flavors, choose 3 scoops with repetition allowed.

C(5 + 3 − 1, 3) = C(7, 3) = 7! / (3! × 4!) = (7 × 6 × 5) / (3 × 2 × 1) = 210 / 6 = 35

Compare that to standard combinations: C(5, 3) = 10. Allowing repetition more than triples the number of possible selections in this case. The gap widens the more items you're choosing.

Real-World Examples of Repeated Combinations

Repetition combinations show up more often than you might expect. A few practical scenarios:

  • Ice cream scoops: Choosing 3 scoops from 10 flavors when you can double or triple up on a flavor.
  • Dice rolls: Counting the distinct outcomes when rolling multiple dice, where two dice can show the same number.
  • Distributing identical objects: Placing 5 identical balls into 3 different boxes. Each box can receive any number of balls, and the boxes are distinct but the balls aren't.
  • Survey responses: A respondent can rate multiple categories at the same level, so the same "value" repeats across selections.

The key signal that you need the repetition formula is when the same option can appear more than once in a valid selection and the order still doesn't matter.

Combinations vs Permutations

This is one of the most common points of confusion in probability and counting problems. Both combinations and permutations deal with selecting items from a set, but they answer different questions.

FeatureCombinationsPermutations
Order matters?NoYes
Formulan! / (r! × (n−r)!)n! / (n−r)!
Result for C(5,3) or P(5,3)1060
Example use caseChoosing a committeeAssigning ranked prizes

Permutations always produce a larger or equal count compared to combinations for the same n and r, because every combination corresponds to r! different permutations (all the ways to arrange that same group).

When Order Matters

Use permutations when the sequence or ranking of selected items changes the outcome. Classic examples include:

  • Awarding 1st, 2nd, and 3rd place prizes from a group of contestants. Alice winning gold and Bob winning silver is a different outcome than Bob winning gold and Alice winning silver.
  • Creating a PIN or password from a set of digits or characters.
  • Arranging books on a shelf where the left-to-right order is meaningful.
  • Assigning people to specific seats at a table.

The formula is P(n, r) = n! / (n − r)!. For P(5, 3): 5! / 2! = 120 / 2 = 60 arrangements.

When Order Does Not Matter

Use combinations when you're just forming a group and it doesn't matter who or what was picked first. The team is the team regardless of the order names were called.

  • Selecting members for a committee or panel.
  • Choosing which questions to answer on an exam (when all carry equal weight).
  • Picking lottery numbers (the winning set {3, 7, 14, 22, 31} is the same no matter what order the balls were drawn).
  • Dealing a hand of cards where only the final hand composition matters.

A quick rule of thumb: if swapping two selected items gives you a result that feels identical, you're dealing with combinations. If swapping them creates something meaningfully different, it's permutations.

Combination Probability Calculator

Once you know how to count combinations, you can use that count to calculate probabilities. The basic structure is:

Probability = (favorable combinations) / (total possible combinations)

Say you're drawing 5 cards from a standard 52-card deck. The total number of possible 5-card hands is C(52, 5) = 2,598,960. If you want to know the probability of getting exactly 2 aces, you count the favorable hands: choose 2 aces from 4 available (C(4, 2) = 6) and then choose the remaining 3 cards from the 48 non-aces (C(48, 3) = 17,296). Multiply those: 6 × 17,296 = 103,776 favorable hands.

Probability of exactly 2 aces = 103,776 / 2,598,960 ≈ 0.0399, or about 4%.

This framework applies broadly: lottery odds, quality control sampling, survey selection, clinical trial design. Anywhere you're picking a subset and asking "how likely is this particular outcome," combinations are doing the heavy lifting.

Combination Calculation Examples

A few worked examples across different contexts:

  1. Committee selection: How many ways can you form a 4-person committee from a group of 9?
    C(9, 4) = 9! / (4! × 5!) = (9 × 8 × 7 × 6) / (4 × 3 × 2 × 1) = 3024 / 24 = 126 ways

  2. Pizza toppings: A pizza shop offers 8 toppings. You want to pick 3. How many different pizzas can you order?
    C(8, 3) = 8! / (3! × 5!) = (8 × 7 × 6) / 6 = 336 / 6 = 56 options

  3. Card hand: How many 5-card hands contain exactly 3 hearts?
    C(13, 3) × C(39, 2) = 286 × 741 = 211,926 hands

  4. Quality control: A factory ships boxes of 20 items. An inspector samples 4 at random. How many different samples are possible?
    C(20, 4) = 20! / (4! × 16!) = (20 × 19 × 18 × 17) / 24 = 116,280 / 24 = 4,845 samples

Sample Space and Counting Principles

The sample space of an experiment is the complete set of all possible outcomes. Knowing its size is the first step in any probability calculation, and combinations are one of the primary tools for counting it.

Two foundational counting principles underlie all of this:

  • The Multiplication Principle: If one event can occur in m ways and a second independent event can occur in n ways, together they can occur in m × n ways. This is why card hand probabilities often involve multiplying two separate combination counts.
  • The Addition Principle: If two events are mutually exclusive (they can't both happen at once), the total number of ways either can occur is m + n.

Combinations slot into this framework naturally. When you're counting a sample space with restrictions (exactly 2 red balls, at least 1 face card, no repeated items), you typically break the problem into parts, count each part using the combination formula, and then combine the counts using multiplication or addition depending on whether the conditions are simultaneous or alternative.

Getting comfortable with these principles makes even complex counting problems manageable because you can decompose them into simpler pieces.

Applications of Combinations in Probability and Statistics

Combinations are everywhere in applied probability and statistics, often working quietly in the background.

  • Binomial distribution: The probability of getting exactly k successes in n independent trials uses the binomial coefficient C(n, k) directly. Every statistics course covers this, and it shows up in everything from drug trial analysis to quality control.
  • Hypergeometric distribution: Used when sampling without replacement from a finite population. The formula is built entirely from combination counts and is the basis for many acceptance sampling plans in manufacturing.
  • Confidence intervals and hypothesis testing: Permutation tests and exact tests (like Fisher's exact test) rely on enumerating or counting combinations of possible data arrangements.
  • Survey sampling: When researchers choose a random sample from a population, the number of possible samples is a combination. Understanding this underpins how sampling error is estimated.
  • Genetics: Counting how many ways genes can combine across generations involves combinations, particularly in problems about dominant and recessive traits.

In short, any time a statistical model involves selecting a subset from a larger group without caring about order, combinations are embedded in the math.

Lottery, Card, and Selection Problems

These three problem types are the classic proving grounds for combinations, and they show up constantly in probability courses and real life.

Lottery problems are straightforward combination calculations. In a standard 6/49 lottery, you pick 6 numbers from 1 to 49. The total number of possible tickets is C(49, 6) = 13,983,816. Your one ticket has a 1 in nearly 14 million chance of matching. Variations involve secondary prizes (match 5 of 6, match 4 of 6), each requiring its own combination calculation.

Card problems are richer because a deck has built-in structure (suits, ranks, face cards). A standard 5-card poker hand problem usually involves counting favorable hands for specific outcomes like a flush, a full house, or a pair. Each of these requires carefully counting how many ways the required cards can appear while the remaining cards fill out the hand, then dividing by the total hand count C(52, 5).

Selection problems cover things like choosing teams, forming groups with specific compositions, or picking items from mixed categories. The trick is usually to break the problem into parts and multiply combination counts. For example: how many ways can you form a group of 5 from 6 men and 8 women if you need at least 2 women? You'd calculate C(8,2)×C(6,3) + C(8,3)×C(6,2) + C(8,4)×C(6,1) + C(8,5)×C(6,0) and add the results.

Practice with these problem types builds real intuition for when and how to apply the combinations formula, which is far more useful than memorizing the formula alone.

Other Maths Calculators

Explore all