Tutorial on Combinatorics

This tutorial describes some common combinatorial problems and approaches to solve them. We consider counting with distinct, non-repeatable elements, counting with an infinite number of distinct element types, and counting with non-distinct (identical) elements.

Counting with Distinct Elements

Given: A set of [comb-Z-G-1.gif] distinct elements.
Task: Count the number of ways to list the [comb-Z-G-2.gif] elements.

This task is equivalent to finding how many orderings there are of the [comb-Z-G-3.gif] elements. Think of the task this way: Imagine that you have [comb-Z-G-4.gif] people and you want to This task is lik find how many different ways there are to line these [comb-Z-G-5.gif] people up to get lunch from a buffet. Order matters here, because the person at the end of the line will have to wait longer to get their food.

To solve this task, we think of [comb-Z-G-6.gif] slots, which represent the [comb-Z-G-7.gif] possible positions in the line:

[comb-Z-G-8.gif]

Now we consider how many choices we have for each slot. We have [comb-Z-G-9.gif] choices of people to put in the first slot, [comb-Z-G-10.gif] choices of people to put in the second slot, and so on, until we finally have [comb-Z-G-11.gif] choice for the final ([comb-Z-G-12.gif]) slot:

[comb-Z-G-13.gif]

The product rule applies here, so there are

[comb-Z-G-14.gif]

ways to order these [comb-Z-G-15.gif] elements.



Given: A set of [comb-Z-G-16.gif] distinct elements.
Task: Count the number of ways to list [comb-Z-G-17.gif] of the [comb-Z-G-18.gif] elements.

In continuing with our lunch buffet example, imagine this task as such: There are only enough plates for [comb-Z-G-19.gif] of the [comb-Z-G-20.gif] people. How many ways are there to pick [comb-Z-G-21.gif] people and line them up to eat at the buffet?

We solve this task in a way similar to the previous one. The only difference is that there are [comb-Z-G-22.gif] slots:

[comb-Z-G-23.gif]

Again, we fill in the slots from the available choices:

[comb-Z-G-24.gif]

So the number of ways to perform these tasks is:

[comb-Z-G-25.gif]

Notice that this is equivalent to [comb-Z-G-26.gif]. This value is denoted by the special function [comb-Z-G-27.gif], which describes the number of [comb-Z-G-28.gif]-permutations of [comb-Z-G-29.gif].



Given: A set of [comb-Z-G-30.gif] distinct elements.
Task: Count the number of ways to make groups of size [comb-Z-G-31.gif] from these [comb-Z-G-32.gif] elements.

To answer this question, consider the solution to the previous task. In the previous task, we wanted to count the number of ways to pick [comb-Z-G-33.gif] people to eat and then line these [comb-Z-G-34.gif] people up at the buffet. In this task, we are just asking how many possible groups of size [comb-Z-G-35.gif] we can create, and we don't care about ordering them in a line to eat. So, to solve this task, we observe that for each group in the previous solution, there are [comb-Z-G-36.gif] ways to line those people up to eat. Because we don't care about ordering in this task, we can divide the answer from the last task by [comb-Z-G-37.gif]. So the answer is:

[comb-Z-G-38.gif]

This value is denoted by the special function [comb-Z-G-39.gif], which describes the number of [comb-Z-G-40.gif]-combinations of [comb-Z-G-41.gif]. There is also a equivalent special notion [comb-Z-G-42.gif], which is read ``[comb-Z-G-43.gif] choose [comb-Z-G-44.gif]''.



Given: A set of [comb-Z-G-45.gif] distinct elements and [comb-Z-G-46.gif] boxes that can hold [comb-Z-G-47.gif] elements (and [comb-Z-G-48.gif]).
Task: Count the number of ways to fill the [comb-Z-G-49.gif] boxes with the [comb-Z-G-50.gif] elements.

In this task, we have [comb-Z-G-51.gif] slots (boxes). Now, the order of the elements within the boxes does not matter. The only thing that matters is the choice of which elements go into which box. To solve this task, we first choose [comb-Z-G-52.gif] elements to go into the [comb-Z-G-53.gif] box. Now we have [comb-Z-G-54.gif] elements left to place in [comb-Z-G-55.gif] boxes. Next, we choose [comb-Z-G-56.gif] elements to go into the [comb-Z-G-57.gif] box, and so on. The picture looks like this:

[comb-Z-G-58.gif]

This resultant formula is equivalent to [comb-Z-G-59.gif]. To see why this is true, consider the expansion of the above picture:

[comb-Z-G-60.gif]

Counting with Distinct Elements and Repetion

In the previous section, we considered tasks of counting distinct elements without repetition. In this section, we consider counting distinct elements with repetition. For these problems, we have an infinite number of elements, and each element has a particular type.

Given: A set of [comb-Z-G-61.gif] distinct element types.
Task: Count the number of ways to list [comb-Z-G-62.gif] elements, when each element can have one of the [comb-Z-G-63.gif] types.

To solve this task, we can again use our slot diagram. There are [comb-Z-G-64.gif] slots, and for each slot, we can choose any of the [comb-Z-G-65.gif] available element types:

[comb-Z-G-66.gif]

So there are [comb-Z-G-67.gif] ways to list [comb-Z-G-68.gif] elements, where each element takes one of the [comb-Z-G-69.gif] types.

As an example, imagine you own a sports team. In front of your stadium, you have 7 flag poles. Your team colors are red, yellow and white. How many ways are there to place red, yellow or white flags on your seven flag poles? In this case, the colors are [comb-Z-G-70.gif] (3) and the flagpoles are [comb-Z-G-71.gif] (7). So the answer is [comb-Z-G-72.gif].



Given: A set of [comb-Z-G-73.gif] distinct element types.
Task: Count the number of ways to make a group of [comb-Z-G-74.gif] elements, where each element has one of the [comb-Z-G-75.gif] types.

This is the most difficult of the problems. Think of this task as assigning some number of [comb-Z-G-76.gif] elements to have a particular type. Similarly, we can view this as assigning a value to each element type that corresponds to the number of elements that have that type. To model, this problem, we use the ``stars and bars'' method. A star (*) corresponds to one of the [comb-Z-G-77.gif] elements. A bar ([comb-Z-G-78.gif]) corresponds to a divider between element types. When modelling the problem, there will be [comb-Z-G-79.gif] stars (one for each element) and [comb-Z-G-80.gif] bars (because it takes [comb-Z-G-81.gif] dividers to create [comb-Z-G-82.gif] groups). So we have a total of [comb-Z-G-83.gif] slots. The solution to the problem is simply the number of ways to select [comb-Z-G-84.gif] of these slots into which we will place a star. [Equivalently, we can give the number of ways to select [comb-Z-G-85.gif] of these objects to contain a bar.] So the answer is [comb-Z-G-86.gif]. [Or, equivalently, [comb-Z-G-87.gif].]



Counting with Indistinct Elements

In the previous sections, we considered tasks of counting with distinct elements. In this section, we consider counting with indistinct (i.e., identical) elements

Given: [comb-Z-G-88.gif] sets of [comb-Z-G-89.gif] indistinct elements ([comb-Z-G-90.gif])
Task: Count the number of ways to list the [comb-Z-G-91.gif] elements.

The difference between this task and the very first task is that some of the [comb-Z-G-92.gif] elements are identical. Consequently, some of the listings are identical. To solve this task, we consider [comb-Z-G-93.gif] slots. For each of the [comb-Z-G-94.gif] sets, we choose [comb-Z-G-95.gif] slots into which we will place that element type. So, the solution takes the form:

[comb-Z-G-96.gif]

As we saw in a previous task, this is equivalent to [comb-Z-G-97.gif].



Last modified: Tuesday, August 16th, 2005
HTML conversion by TeX2page 2004-09-11