Counting & Probability

Combinations: How to Calculate nCr Step by Step

The number of ways to choose rr items from nn different items, when order does not matter, is (nr)=n!r! (n−r)!\binom{n}{r}=\frac{n!}{r!\,(n-r)!}. It is read “n choose r” and also written nCr_nC_r or C(n,r)C(n,r).

(nr)=n!r! (n−r)!\binom{n}{r}=\frac{n!}{r!\,(n-r)!}

Try it with your numbers

Show every step

A combination counts groups, not lineups. A hand of cards, a committee, a pizza with three toppings: swapping the order inside the group changes nothing, so those swaps must not be counted. Everything on this page comes from that one idea.

What is the combinations formula, and how do you read nCr?

The symbol n!n! (n factorial) means n⋅(n−1)⋅(n−2)⋯2⋅1n\cdot(n-1)\cdot(n-2)\cdots 2\cdot 1, with the special case 0!=10!=1. In (nr)\binom{n}{r}, the top number nn is the size of the pool and the bottom number rr is the size of the group you pull out. Reading it aloud as “n choose r” keeps the roles straight.

Take 5 friends (A, B, C, D, E) and invite 2 to a movie:

(52)=5!2! 3!=1202⋅6=10\binom{5}{2}=\frac{5!}{2!\,3!}=\frac{120}{2\cdot 6}=10

Listing confirms it: AB, AC, AD, AE, BC, BD, BE, CD, CE, DE. Ten groups, and AB is the same group as BA.

The formula assumes three things: the nn items are all different, you choose rr of them with 0≤r≤n0\le r\le n, and no item can be picked twice. When one of those breaks, you need an adjusted method, and the later sections cover each case.

Quick check

Evaluate (90)+(99)\binom{9}{0}+\binom{9}{9}.

Why does the combinations formula divide by r factorial?

Grid of 60 ordered picks arranged as 10 groups of 6 orderings each, showing division by 3 factorial
Choosing 3 of 5 gives 60 ordered picks, but each group appears 3! = 6 times, so there are 10 groups.

Start by pretending order matters. Using the fundamental counting principle, the first pick has nn options, the second n−1n-1, and so on down to n−r+1n-r+1 for the rr-th pick. That ordered count is the number of permutations:

P(n,r)=n(n−1)⋯(n−r+1)=n!(n−r)!P(n,r)=n(n-1)\cdots(n-r+1)=\frac{n!}{(n-r)!}

Now correct the overcount. Any one group of rr people can be lined up in r!r! different orders, and the ordered count has included every one of those orders as a separate outcome. So each group has been counted exactly r!r! times. Divide, and each group is counted once:

(nr)=P(n,r)r!=n!r! (n−r)!\binom{n}{r}=\frac{P(n,r)}{r!}=\frac{n!}{r!\,(n-r)!}

For n=5n=5 and r=3r=3: there are 5⋅4⋅3=605\cdot4\cdot3=60 ordered picks, each group appears 3!=63!=6 times, and 60÷6=1060\div 6=10 groups.

Why the answer is always whole

Every group is counted exactly r!r! times, never more and never fewer. That makes the division exact, so (nr)\binom{n}{r} is always a whole number. A decimal answer means an arithmetic slip.

How do you calculate combinations without huge factorials?

Writing out n!n! is wasteful, because most of it cancels. Keep only the top rr factors of n!n! (counting down from nn) and divide by r!r!:

(103)=10⋅9⋅83⋅2⋅1=7206=120\binom{10}{3}=\frac{10\cdot 9\cdot 8}{3\cdot 2\cdot 1}=\frac{720}{6}=120

A quick mental check: the numerator and the denominator always have the same number of factors, here three each. Cancel before multiplying when you can. In 10⋅9⋅83⋅2⋅1\frac{10\cdot9\cdot8}{3\cdot2\cdot1}, the 99 cancels with the 33 and the 88 with the 22, leaving 10⋅3⋅4=12010\cdot 3\cdot 4=120.

The second shortcut is symmetry: (nr)=(nn−r)\binom{n}{r}=\binom{n}{n-r}. Choosing who joins is the same as choosing who stays out. So always compute with the smaller of rr and n−rn-r:

(10098)=(1002)=100⋅992=4950\binom{100}{98}=\binom{100}{2}=\frac{100\cdot 99}{2}=4950

Calculators typically overflow somewhere around 70!70!, so (10098)\binom{100}{98} via full factorials fails, while the shortcut takes seconds. For truly enormous values, the logarithm rules turn the product into a sum: log⁡(nr)=log⁡n!−log⁡r!−log⁡(n−r)!\log\binom{n}{r}=\log n!-\log r!-\log (n-r)!.

Combinations vs permutations: how do you decide?

Ask one question: if two chosen items swapped places, would that be a different outcome? If yes, order matters and you need permutations. If no, you need combinations. The trap is that the story’s wording often hides the answer. “Select”, “choose”, “committee”, “hand” and “subset” signal combinations. “Arrange”, “rank”, “assign roles” and “code” signal permutations.

A classic example: a “combination lock” is really a permutation lock, because 1-2-3 and 3-2-1 open different things (or nothing). The name misleads, the order decides.

The two counts are linked by P(n,r)=r!(nr)P(n,r)=r!\binom{n}{r}. This gives a clean way to handle mixed problems. A coach picks 3 starters from 8 players and then assigns them 3 distinct positions. Pick the group first, then order it:

(83)⋅3!=56⋅6=336\binom{8}{3}\cdot 3!=56\cdot 6=336

This equals 8⋅7⋅6=3368\cdot7\cdot6=336, as it must. For a full side-by-side comparison with more problem types, see Permutations vs Combinations.

Quick check

From 10 runners there are (103)=120\binom{10}{3}=120 ways to pick a relay team of 3. In how many ways can gold, silver and bronze be awarded to 3 of the 10?

How do you solve combination problems with conditions?

Most textbook problems are not a single (nr)\binom{n}{r}. They combine several, and three rules cover nearly all of them:

  • “And” across independent groups means multiply the counts.
  • “Or” across separate cases means add the counts.
  • “At least one” usually means subtract the bad case from the total.

Example 1. A committee needs 3 men from 7 and 2 women from 5. The two choices are independent, so multiply:

(73)(52)=35⋅10=350\binom{7}{3}\binom{5}{2}=35\cdot 10=350

Example 2. A group of 5 is chosen from 6 men and 4 women, with at least 1 woman. Counting every case (1 woman, 2 women, and so on) takes four lines. The complement takes two. Count all groups, then remove the groups with no women:

(105)−(65)=252−6=246\binom{10}{5}-\binom{6}{5}=252-6=246

Try this: Confirm 246 the long way. Add the four cases (41)(64)+(42)(63)+(43)(62)+(44)(61)\binom{4}{1}\binom{6}{4}+\binom{4}{2}\binom{6}{3}+\binom{4}{3}\binom{6}{2}+\binom{4}{4}\binom{6}{1} and see that the total matches.

The complement method works because “at least one” has many cases while “none” has only one. When a problem says “at most”, the same idea applies from the other side.

What are combinations with repetition (stars and bars)?

When you may pick the same type more than once, such as 3 scoops from 5 flavors where double chocolate is allowed, the standard formula undercounts. The count becomes:

(n+r−1r)\binom{n+r-1}{r}

Here nn is the number of types and rr is how many you take. The reason is a picture. Draw each scoop as a star and separate the nn flavors with n−1n-1 bars. The selection “2 vanilla, 0 chocolate, 1 mint, 0 pistachio, 0 coffee” looks like ⋆⋆ ∣ ∣ ⋆ ∣ ∣\star\star\,|\,|\,\star\,|\,|. Every selection is one row of rr stars and n−1n-1 bars, so you are choosing which of the n+r−1n+r-1 positions hold the stars.

For 3 scoops from 5 flavors:

(5+3−13)=(73)=35\binom{5+3-1}{3}=\binom{7}{3}=35

Without repeats it would be (53)=10\binom{5}{3}=10, so allowing repeats more than triples the count.

The most common slip is using nn stars instead of rr stars. Remember: stars are the things you take, bars are the dividers between types. The same method counts non-negative whole-number solutions to x1+x2+x3+x4=10x_1+x_2+x_3+x_4=10: here n=4n=4 variables and r=10r=10, giving (1310)=(133)=286\binom{13}{10}=\binom{13}{3}=286. It fails when the supply is limited (only 2 chocolates in stock, say), because then some star rows are not allowed.

How are combinations used in probability?

When all outcomes are equally likely, probability is favorable outcomes divided by total outcomes, as in basic probability. Combinations count both. A 5-card hand has (525)\binom{52}{5} possibilities, and you can calculate that with the shortcut and early cancelling:

(525)=52⋅51⋅50⋅49⋅485⋅4⋅3⋅2⋅1=2,598,960\binom{52}{5}=\frac{52\cdot51\cdot50\cdot49\cdot48}{5\cdot4\cdot3\cdot2\cdot1}=2{,}598{,}960

Example 3. What is the probability that a 5-card hand contains all four aces? Choose all 4 aces ((44)=1\binom{4}{4}=1 way) and 1 other card from the remaining 48:

P=(44)(481)(525)=482,598,960=154,145P=\frac{\binom{4}{4}\binom{48}{1}}{\binom{52}{5}}=\frac{48}{2{,}598{,}960}=\frac{1}{54{,}145}

Keep top and bottom consistent

If the denominator ignores order, the numerator must too. Mixing an unordered total like (525)\binom{52}{5} with an ordered favorable count gives a wrong probability that looks reasonable.

Lotteries work the same way. Picking 6 numbers from 49 gives (496)=13,983,816\binom{49}{6}=13{,}983{,}816 equally likely tickets. Combinations also sit inside the binomial distribution, where (nk)\binom{n}{k} counts the ways to place kk successes among nn trials, and its spread is measured with the standard deviation.

Pascal’s triangle and the identities behind nCr

Write the values of (nr)\binom{n}{r} in rows and you get Pascal’s triangle. Row 5 reads 1, 5, 10, 10, 5, 11,\ 5,\ 10,\ 10,\ 5,\ 1. Each entry is the sum of the two above it, which is Pascal’s rule:

(nr)=(n−1r−1)+(n−1r)\binom{n}{r}=\binom{n-1}{r-1}+\binom{n-1}{r}

The reasoning is a single decision. Fix one item. Either it is in your group (choose the other r−1r-1 from the remaining n−1n-1) or it is not (choose all rr from the remaining n−1n-1). Those two cases cover everything with no overlap.

Row sums follow a pattern too: row 5 adds to 32=2532=2^5, because choosing any number of items from nn is the same as deciding yes or no for each one. These numbers are also the coefficients in the binomial theorem, so (a+b)4(a+b)^4 has coefficients 1,4,6,4,11,4,6,4,1.

One more link worth knowing: (n2)=n(n−1)2\binom{n}{2}=\frac{n(n-1)}{2} equals 1+2+⋯+(n−1)1+2+\cdots+(n-1), the sum from the arithmetic series formula. It counts handshakes: each of nn people shakes hands with the other n−1n-1, and dividing by 2 removes the double count.

Quick check

Write (93)+(94)\binom{9}{3}+\binom{9}{4} as a single combination and evaluate it.

How do you check a combinations answer?

Four fast checks catch most errors:

  • The result must be a whole number, and at least 1 when 0≤r≤n0\le r\le n.
  • It must not exceed P(n,r)P(n,r), and it should equal (nn−r)\binom{n}{n-r}.
  • Edge cases hold: (n0)=(nn)=1\binom{n}{0}=\binom{n}{n}=1 and (n1)=n\binom{n}{1}=n.
  • Use a small sibling problem. If the case with 4 items gives a count you can list by hand, the method is sound.

The formula also runs backward. Suppose a tournament has (n2)=66\binom{n}{2}=66 games, one per pair of teams. Then n(n−1)2=66\frac{n(n-1)}{2}=66, so n2−n−132=0n^2-n-132=0. The quadratic formula gives:

n=1±1+5282=1±232n=\frac{1\pm\sqrt{1+528}}{2}=\frac{1\pm 23}{2}

Only n=12n=12 is valid, since a negative team count makes no sense. Check: 12⋅112=66\frac{12\cdot 11}{2}=66.

Know where the method stops working. If items are identical (arranging the letters of MISSISSIPPI), if the same item can be reused, or if order matters, plain (nr)\binom{n}{r} is the wrong tool. A parallel question applies to the answer’s size: if it is far larger than seems plausible, a missed division by r!r! is the usual cause.

Practice problems

0 of 5 solved

  1. Evaluate (73)\binom{7}{3}.

  2. Evaluate (10098)\binom{100}{98}.

  3. A committee needs 3 men chosen from 6 and 2 women chosen from 5. How many different committees are possible?

  4. Find nn if (n2)=66\binom{n}{2}=66.

  5. A group of 5 is chosen from 7 boys and 4 girls. How many groups contain at least 1 girl?

Common questions

What is the formula for combinations?

The number of combinations of rr items chosen from nn is (nr)=n!r! (n−r)!\binom{n}{r}=\frac{n!}{r!\,(n-r)!}. It applies when the items are all different, none is repeated and order does not matter.

What is the difference between combinations and permutations?

A permutation counts ordered arrangements and a combination counts unordered groups. They are linked by P(n,r)=r!(nr)P(n,r)=r!\binom{n}{r}, so each group of rr items produces r!r! permutations.

How do you use the nCr button on a calculator?

Enter nn, press the nCr key (often under a PROB or MATH menu), then enter rr and press equals. Spreadsheets use COMBIN(n, r) for the same result.

What are n choose 0 and n choose n?

Both equal 1. There is exactly one way to choose nothing (the empty group) and exactly one way to choose everything. This is also why 0!0! is defined as 1.

How do you count combinations when repeats are allowed?

Use stars and bars: choosing rr items from nn types with repeats allowed gives (n+r−1r)\binom{n+r-1}{r}. For 3 scoops from 5 flavors this is (73)=35\binom{7}{3}=35.

Can r be larger than n in a combination?

Not without repeats. You cannot choose 6 different items from 4, so (46)=0\binom{4}{6}=0. The formula is only defined for 0≤r≤n0\le r\le n when items cannot repeat.

Up next