The Dreaded Combinatorics

The first thing I want to discuss is something we call “Basic Counting Principle” because it is useful in almost all 600-700 level questions of Combinatorics (Note here that I will avoid using the terms “Permutation” and “Combination” and the formulas associated with them since they are not necessary and make people uncomfortable). Also, many of the 700+ level questions use basic counting principle as the starting point so it’s not possible to start a discussion on combinatorics without discussing this principle first. Let’s try to understand it using an example.

Example 1: There are 3 boys and 2 girls. We want to select a pair of one boy and one girl for a dance. In how many ways can we do it?Solution: Let’s discuss the solution in detail. This is a very basic and very important concept.

Say the 3 boys are B1, B2 and B3. Say the 2 girls are G1 and G2.

In how many ways can you make a pair?

B1 – G1

B1 – G2

B2 – G1

B2 – G2

B3 – G1

B3 – G2

A total of 6 ways. We see that we can select a boy in 3 ways (since there are 3 boys) and we can select a girl in 2 ways (since there are 2 girls). So we can make a pair in 3*2 = 6 ways.

The basic counting principle deals with problems having ‘distinct spots’ and ‘available contenders’. Here we have 1 spot for a boy and 1 spot for a girl i.e. 2 distinct spots. There are 3 contenders for the empty ‘boy spot’ and 2 contenders for the empty ‘girl spot’. These spots can be filled in 3*2 = 6 ways. The word ‘distinct’ is important here as we will see in the next few weeks.

Also notice here that it is not 3+2 = 5 ways. This is so because we have to choose a boy AND a girl simultaneously. For every boy, we could choose a girl in 2 ways and there are 3 boys so we can choose a pair in 3*2 ways. If we had to choose one boy OR one girl (i.e. just one person), we could have done it in 3+2 = 5 ways because there are 5 people and we have to choose one of them. The distinction between ‘AND’ and ‘OR’ is quite important since it defines whether you will multiply or add.

Let’s look at some more examples of basic counting principle.

Example 2: A restaurant serves 6 varieties of appetizers, 10 different entrees and 4 different desserts. In how many ways can one make a meal if one chooses one appetizer, one entree and one dessert?Solution: In how many ways can you choose an appetizer? 6 ways

In how many ways can you choose your entree? 10 ways

In how many ways can you choose your dessert? 4 ways

In how many different ways can you make your meal? To make your meal, you need one appetizer AND one entree AND one dessert. There are 3 distinct spots and you have to fill each one of them. You can do it in 6*10*4 = 240 ways.

Example 3: In how many ways can you make a five letter password using the first ten letters of the English alphabet? (You can use only capital letters.)Solution: In how many ways can you choose the first letter of the password? 10 ways. You can put in any letter from A to J.

What about the second letter? Again, you can choose it in 10 ways. The question doesn’t say that you cannot repeat a letter once you use it.

Similarly, each digit can be chosen in 10 ways.

Since you have to choose the first letter AND the second letter AND the third letter etc, the total number of ways of selecting a five letter password is 10*10*10*10*10 = 10^5 ways. You have 5 distinct spots and you can fill each one of them in 10 ways.

You can make the 5 letter password in 10^5 ways.

Example 4: Five friends go to watch a movie. They are supposed to occupy seat numbers 51 to 55. In how many different ways can they do it?Solution: Let’s look at the first seat i.e. seat number 51. In how many ways can you make someone sit there? Of course 5 ways since you have 5 people. Say, you make one of them sit on seat number 51. Now in how many ways can you make someone sit on seat number 52? Remember that you have only 4 contenders left now since one of them is already sitting on seat number 51. Therefore, you can make someone sit there in 4 ways only. Next, for seat number 53, you only have 3 contenders left. For seat number 54, you have only 2 contenders left and then for seat number 55, only the last person is remaining i.e. just one option.

The total number of ways of arranging 5 people on 5 distinct seats is 5*4*3*2*1 = 120

These are some of the most basic examples of basic counting principle. Below, I am giving more questions which are just twists on these questions. Try them and get back if you have any doubts. We will take some higher level concepts from next post on.

Question 1: A restaurant serves 6 varieties of appetizers, 10 different entrees and 4 different desserts. In how many ways can one make a meal if one chooses an appetizer, at least one and at most two different entrees and one dessert?

Question 2: In how many ways can you make a five digit password using the first ten letters of the English alphabet if each letter can be used at most once? (You can use only capital letters.)

Question 3: In how many ways can BRIAN make a five digit password using the first ten letters of the English alphabet if each letter can be used at most once and one is not allowed to use any letter which appears in one’s name? (You can use only capital letters.)

Question 4: Six friends go to watch a movie. They are supposed to occupy seat numbers 51 to 56. However one of them falls sick and returns home. In how many different ways can the 5 people sit?

Question 5: Eight friends go to watch a movie but only 5 tickets were available. In how many different ways can 5 people sit and watch the movie?

1. 6*10*4 + 6*(10*9)/2 * 4 (Choose one entree or two but do not arrange entrees in case you select two)

2. 10*9*8*7*6 (First digit selected in 10 ways, second digit in 9 ways etc)

3. 7*6*5*4*3 (Out of first ten letterns, Brian cannot use A, B and I)

4. 6*5*4*3*2 (Allot the seats to the friends say the first friend has 6 seat options, second friend has 5 seat options etc)

5. 8*7*6*5*4 (First seat can be filled in 8 ways, second seat in 7 ways etc)