# Combination

In mathematics, a combination refers to a selection of objects from a collection in which the order of selection doesn't matter. Think of ordering a pizza. If the selection of toppings are sausage, pepperoni, mushrooms, onions, and bacon, and you want sausage, pepperoni, and mushrooms, it doesn't matter whether you pick mushrooms, pepperoni, or sausage first. As long as you get all three, the order that you pick them in won't change what you end up with on your pizza.

When the order does matter, such as the characters on the license plate of a car, we'd use permutations instead.

There are a number of different ways to denote a combination. Some of them include: nCr, nCr, C(n, r), C(n, r), or most commonly, as in the binomial theorem, . All of these are read as "n choose r." This refers to the number of ways we can select r objects from a set of n objects. Looking back at the pizza example above, there are 5 possible toppings: pepperoni (P), sausage (S), mushrooms (M), onions (O), and bacon (B). Of the 5 toppings, we are choosing only 3. There are 10 possible combinations of the toppings where the order doesn't matter, and there is no repetition (i.e. 2 pepperoni, 1 mushroom):

 1 PSM 2 PSO 3 PSB 4 PMO 5 PMB 6 POB 7 SMO 8 SMB 9 SOB 10 MOB

Depending on the number of choices available, it can quickly become very difficult to determine the number of possible combinations without using a formula.

## Combination formulas

There are two types of combinations, one where repetition is allowed, and one where repetition isn't allowed.

### Combinations without repetition

The above pizza example is an example of combinations with no repetition (also referred to as combinations without replacement), meaning that we can't select an ingredient more than one time per combination of toppings. The formula to determine the number of ways we can choose 3 toppings from the 5 is: where n is the number of toppings (the total number of objects in a set), and r is the number of toppings we are choosing (the number of objects chosen from the set to make up each combination). Refer to the factorial page for a refresher on working with factorials if necessary. Using the formula with the pizza example: This tells us that there are 10 different combinations of 3 toppings that we can choose from a set of 5 if repetition is not allowed and order doesn't matter. This is consistent with what we found above.

### Combinations with repetition

If repetition is allowed, continuing with the above pizza example, we could have 2 pepperoni toppings and 1 sausage topping. In such a case, we would use the following formula instead:      This tells us that there are 35 different combinations of 3 toppings that we can choose from a set of 5 if repetition were allowed.

## Using combinations in probability

Combinations can be useful in probability in many cases where we need to determine the number of ways a specific event can happen. One basic example is the flip of a coin. If we were to flip a coin 5 times, what is the probability that we get exactly 2 tails as a result?

To determine this probability we need to know two values. The first is the total number of possible outcomes. Each time we flip the coin, there are two possible outcomes, heads or tails. If we flip the coin 5 times, the number of total possible outcomes is 25, or 32.

The second value we need to know is the total number of ways we can get an outcome of exactly two flips being tails, given that we flip the coin 5 times; this describes a combination without repetition where n = 5 and r = 2:   There are 10 different ways that we can flip a coin 5 times and end up with a result of exactly 2 tails. To find the probability that we get exactly 2 tails from flipping a coin 5 times, we divide the number of ways this outcome can occur by the total number of possible outcomes, both of which we have determined:

P = Therefore, the probability of getting tails exactly 2 times in 5 flips of a coin is 31.25%. This is just one example of using combinations in probability. There are many other ways that combinations can be used as part of more complex probability calculations.