Think you can count? We’re in a cafeteria with a fruit basket.

An arrangement of objects into a sequence, where order matters, is a *permutation*. A collection of objects, when the order does not matter, is a *combination*.

# Counting permutations

Here, we consider the choices of fruit among our three friends, Christina, Joaquin, and Ezra. Because Christina, Joaquin, and Ezra are in line at the cafeteria, the order matters.

##### Case 1. Christina, Joaquin, and Ezra each select one fruit. There are plenty of bananas , strawberries , watermelons , and green apples in the cafeteria. How many different outcomes are there? e.g., one outcome is Christina and Ezra select a banana and Joaquin selects a watermelon.

Each person individually has four different outcomes. Since there are three people and any one person’s choice does not change the possible outcomes of the others, the number of outcomes is .

More generally, when people each have a choice of fruits, the number of outcomes is . This is called a permutation *with repetition* since people may choose the same fruits.

##### Case 2. Christina, Joaquin, and Ezra each select one fruit. Now, however, there is only a single banana , green apple , and strawberry remaining in the fruit basket. How many different outcomes are there?

Now, since Christina is in line first, she has a choice between all three fruits. However, after she chooses one, there are only two choices remaining for Joaquin; Ezra gets one choice. So, here the number of different outcomes is .

More generally, given people lined up to select distinguishable fruits, the number of outcomes is:

This is called the *factorial* of , denoted as .

##### Case 3. Christina, Joaquin, and Ezra each select one fruit. Now, however, there is a banana , green apple , strawberry , *and* watermelon remaining in the fruit basket. How many different outcomes are there?

There are four fruits for three people. One fruit will be left behind. Following the logic above, Christina has four choices, Joaquin has three choices, and Ezra has two choices. So there are outcomes.

More generally, when people each choose one of distinguishable fruits, for , the number of outcomes is:

There are factors here, one for each person. Note that this can be written as:

This scenario, where we seek the number of orderings of a subset of objects from a set of distinguishable objects is called a -permutation of .

##### Case 4. Christina, Joaquin, and Ezra each selected one fruit. We know that, all together, Christina, Joaquin, and Ezra selected two bananas and a watermelon, but we don’t know who selected which fruit. How many different possibilities are there? e.g., one possibility is that Christina selected the watermelon and Joaquin and Ezra each selected a banana.

Here, we seek how many different ways we can distribute two bananas and a watermelon among Christina, Ezra, and Joaquin, under the constraint that each receives one fruit. This seems similar to Case 2, where we counted the permutations of three different, *distinguishable* fruits. But, in this scenario, the two bananas are *indistinguishable*. i.e., if we could label the bananas with 1 and 2, the assignment:

Christina: , Ezra: , Joaquin:

is the same as the assignment:

Christina: , Ezra: , Joaquin:

since both describe the scenario where Christina gets the watermelon and Joaquin and Ezra get a banana.

That is, overcounts the number of possibilities because, upon switching the two labeled bananas in each assignment, the assignment represents the same outcome. Consequently, we must then divide the answer for the *distinguishable* fruit case () by the number of ways we can permute the bananas. Since there are two bananas, we need to divide by . Thus, there are outcomes here:

- Christina: , Ezra: , Joaquin:
- Christina: , Ezra: , Joaquin:
- Christina: , Ezra: , Joaquin:

From the list above, we see that we could also reduce this problem to: who gets the watermelon? Then, there are only 3 choices.

More generally, consider when we have fruits consisting of different (*distinguishable*) kinds fruit. Let be the number of fruits of type (e.g. here, and ); we have of these variables, and a constraint here is:

The number of permutations is

The numbers in the denominator– one for each type of fruit– are to account for the indistinguishability of these fruits, as we did for the bananas in this case. This is called a *multiset permutation*.

# Counting combinations

Here, we will see examples where the ordering of the fruits does not matter by considering only Christina’s selection of fruit from the basket.

##### Case 5. Christina selects two *different* fruits from a fruit basket that contains a banana , a strawberry , a watermelon , and a green apple . How many different outcomes are there? e.g., one outcome is that she selects a watermelon and a strawberry. Here, the ordering of the fruit does not matter.

If ordering *did* matter, we would count the permutations of ; Christina has four choices for the first fruit and then three remaining choices for the second fruit she picks, giving outcomes. However, we need to correct for the fact that, here, since ordering does not matter,

{ , }

is the same as

We can correct for this overcounting by dividing by the number of permutations (reorderings) of the two fruits that Christina selected, which in this case is . There are thus different outcomes here.

We will use the brackets {} to denote a *set* of objects where ordering does not matter. All outcomes here are then:

- {, }
- {, }
- {, }
- {, }
- {, }
- {, }

More generally, following the math for -permutations of in Case 3, the number of *combinations* of fruits from a basket of distinguishable fruits (, in this case) is:

So the formula gives the number of -permutations of divided by , the number of ways to permute/rearrange an ordered sequence of fruits, to correct for the order being inconsequential.

The number of combinations of objects from a set of distinguishable objects has a special notation:

read out loud as “ choose ”.

##### Case 6. Christina selects two fruits from a fruit basket with four different types of fruit (bananas , strawberries , watermelons , and green apples ). However, we now relax the constraint in Case 5 by allowing duplicates; Christina can select two of the same fruit if she desires. How many outcomes are there? Again, ordering does not matter.

There is a visual way to understand this problem. To represent a particular outcome, let’s list the fruits that Christina chooses in a special way, using cookies from the cafeteria. We place cookies in a row on the table:

When Christina chooses two fruits, we group them together by fruit type (e.g. bananas with bananas) and place them in between the cookies, using the cookies as *separators*. Our convention is to place the fruits in the following order: bananas, strawberries, watermelons, and then green apples.

For example, if she chooses a banana and a watermelon, we represent this as:

If she chooses two watermelons:

If she chooses a watermelon and a green apple:

That is, we keep a cookie to separate the fruit type even if there were no fruits of that type. This way, no matter what the outcome, there are *always* fruits and cookies in our representation of an outcome, for a total of foods representing the outcome.

From this representation of outcomes, we see that the number of outcomes is equal to the number of ways that we can arrange the cookies in positions (the rest of the positions will be occupied by fruits). This is a *multiset permutation* as in Case 4, where we are looking for the number of permutations of symbols, of which are indistinguishable cookies and the other symbols are fruits, which we also view as indistinguishable since the positions of the cookies distinguish the fruits implicitly by our convention of ordering the fruit.

The number of ways we can arrange the cookies among the positions is:

In this particular case, . We now check by enumerating the possibilities. We have four more possibilities than in Case 5 above, since we now allow for duplicates:

- {, }
- {, }
- {, }
- {, }
- {, }
- {, }
- {, }
- {, }
- {, }
- {, }

This scenario is counting the number of combinations of objects *with repetitions*. This type of counting also has a special notation: