Combinations Formula: Definition and Examples

By Dr. Zubair Khalid, DVM, MS, PhD ·

Combinations Formula: Definition and Examples

The combination formula counts the number of ways to choose a group of items from a larger set when the order of the chosen items does not matter. If you have $n$ items and you pick $k$ of them, the number of possible groups is written $C(n,k)$ and read as "n choose k." This article defines the formula, explains each symbol, and works through a full example you can follow with a calculator.

Quick Answer

  • The combination formula is $C(n,k) = \dfrac{n!}{k!(n-k)!}$, where $n!$ means $n$ factorial.
  • A factorial multiplies every whole number from 1 up to that number, so $4! = 4 \times 3 \times 2 \times 1 = 24$.
  • Order does not matter. Choosing Ana, Ben, Cara is the same group as choosing Cara, Ben, Ana.
  • For 10 students choosing 3, $C(10,3) = 120$.
  • In Excel use =COMBIN(10,3), and in Python use math.comb(10, 3). Both return 120.

The Formula

The combinations formula is:

$$C(n,k) = \frac{n!}{k!(n-k)!}$$

Each symbol has a specific meaning:

SymbolMeaning
$n$The total number of items in the full set
$k$The number of items you choose
$n!$The factorial of $n$, or $n \times (n-1) \times \dots \times 1$
$k!$The factorial of $k$
$(n-k)!$The factorial of the difference between $n$ and $k$
$C(n,k)$The number of unordered groups of size $k$ from $n$ items

You may also see this written as $\binom{n}{k}$, which is called binomial notation and means exactly the same thing.

The logic behind the formula is worth understanding. If order mattered, you would have $n!/(n-k)!$ arrangements, which is called a permutation. Because order does not matter, you divide by $k!$ to remove the duplicate orderings of each group. That division is what turns a permutation count into a combination count.

How to Calculate It Step by Step

  1. Identify $n$, the total number of items.
  2. Identify $k$, the number of items being chosen.
  3. Compute $n!$.
  4. Compute $k!$.
  5. Compute $(n-k)!$.
  6. Multiply $k!$ by $(n-k)!$ to get the denominator.
  7. Divide $n!$ by that denominator.

A useful shortcut: when $k$ is small, you can cancel most of the factorials. For $C(10,3)$, the $10!$ and $7!$ cancel down to $10 \times 9 \times 8$, so you only need to divide $720$ by $3! = 6$ to get $120$. This keeps the numbers small and reduces arithmetic errors.

Worked Example

Suppose a class has 10 students, and you need to form a committee of 3. Order does not matter, so this is a combinations problem. The dataset is a single column listing each student.

student
Ana
Ben
Cara
Dan
Eli
Fay
Gus
Hana
Ivan
Jo

Here are the steps with the actual computed values.

  1. Identify $n$ and $k$: $n = 10$ students, $k = 3$ chosen.
  2. Write the combinations formula: $C(n,k) = n! / (k!(n-k)!) = 10! / (3! \times (10-3)!)$.
  3. Compute $n!$: $10! = 3628800$.
  4. Compute $k!$: $3! = 6$.
  5. Compute $(n-k)!$: $(10-3)! = 5040$.
  6. Divide: $3628800 / (6 \times 5040) = 3628800 / 30240 = 120$.

The result is 120 possible committees. To confirm, enumerating every group programmatically also produced 120 tuples, so the formula and the brute-force count agree.

The Python snippet below uses the standard library function for combinations.

import math
print(math.comb(10, 3))  # 120

Output:

120

The same calculation in Excel is =COMBIN(10,3), which returns 120.

How to Interpret the Result

The value 120 means there are 120 distinct groups of 3 students you can form from a class of 10. Each group is counted once, no matter what order you list its members in.

This is different from a permutation, which would count Ana-Ben-Cara and Cara-Ben-Ana as two separate arrangements. For a committee, a lottery draw, or a hand of cards, order is irrelevant, so combinations are the right tool. If you were assigning three students to president, vice president, and treasurer, order would matter and you would use permutations instead.

The result also grows fast. Choosing 3 from 10 gives 120, but choosing 5 from 20 gives 15504. Combinations scale quickly because the number of possible groups expands with both $n$ and $k$.

Doing It in Software

You rarely need to compute factorials by hand once you know the formula. Spreadsheets and programming languages have built-in functions.

Excel and Google Sheets. Use =COMBIN(n, k). For this example, =COMBIN(10,3) returns 120. The function takes two arguments, the total count and the number chosen, in that order.

Python. Use math.comb(n, k) from the standard library. It returns an exact integer, so there is no floating-point rounding for reasonable inputs.

R. Use choose(n, k). For example, choose(10, 3) returns 120.

ToolCallResult
Excel=COMBIN(10,3)120
Pythonmath.comb(10, 3)120
Rchoose(10, 3)120

If you are working with probabilities, combinations often appear inside larger formulas. The binomial distribution formula uses $C(n,k)$ to count the ways a set of successes can occur, and conditional probability problems often rely on counting outcomes the same way. When you need to compare counts across categories, the formula for range can help you describe how spread out those counts are.

Common Mistakes

  • Confusing combinations with permutations. Combinations ignore order, permutations do not. If the problem says "arrange," "rank," or "order," you likely need a permutation. If it says "choose," "select," or "group," use combinations.
  • Swapping $n$ and $k$. $n$ is always the larger pool and $k$ is the number chosen. Writing $C(3,10)$ is not the same problem. By convention it equals 0, and Excel's COMBIN(3,10) returns a #NUM! error.
  • Forgetting that $0! = 1$. This matters for edge cases like choosing 0 items, where $C(n,0) = 1$. There is exactly one way to choose nothing.
  • Trying to compute large factorials directly. $20!$ is already about 2.43 quintillion, which overflows many calculators. Cancel terms first or use a built-in function.
  • Assuming the result counts ordered outcomes. The number 120 counts each group once. If you list the same three students in a different order, that is not a new combination.
  • Rounding intermediate values. Keep full precision until the final division. Rounding $10!$ or $7!$ early can shift the answer.

Limitations

The combinations formula assumes every item is distinct and that you choose without replacement. If two students had identical names and were treated as interchangeable, the count would change. It also assumes each item can be chosen at most once, so it does not apply to situations where you can pick the same item repeatedly. For repeated choices, you would use the combinations with repetition formula instead.

The formula tells you how many groups exist, not which groups are better or more likely. In probability work, combinations only give you the count of outcomes. You still need to divide by the total number of possible outcomes to get a probability, and that requires knowing whether every outcome is equally likely. If outcomes are not equally likely, counting alone will mislead you.

Frequently Asked Questions

What is the difference between a combination and a permutation?

A combination counts groups where order does not matter, while a permutation counts arrangements where order does matter. The permutation formula is $n!/(n-k)!$, and the combination formula adds an extra $k!$ in the denominator to remove duplicate orderings. For 10 students choosing 3, there are 120 combinations but 720 permutations.

Can the combination formula give a decimal answer?

No. The number of combinations is always a whole number because you are counting distinct groups. If you get a decimal, you made an arithmetic error, likely from rounding a factorial or dividing in the wrong order. Using =COMBIN or math.comb avoids this entirely.

What does C(n,k) equal when k is 0 or k equals n?

Both cases equal 1. Choosing 0 items from any set gives one empty group, and choosing all $n$ items gives one group containing everything. This follows from $0! = 1$ in the formula.

Why does the formula divide by k!?

Dividing by $k!$ removes the duplicate orderings within each group. When you count arrangements, each group of $k$ items appears $k!$ times in different orders. Since combinations treat those as one group, you divide by $k!$ to count each group once.

Is the combination formula the same as the binomial coefficient?

Yes. The binomial coefficient $\binom{n}{k}$ is another name for $C(n,k)$, and both equal $n!/(k!(n-k)!)$. The term "binomial coefficient" comes from its role in expanding expressions like $(x+y)^n$, where the coefficients are combinations.

References

This article draws on the standard references listed under Further Reading.

Further Reading

Related Articles