Skip to main content

Section 4.3 Enumeration Examples

Problem 4.3.1.

For the following conditions count the number of strings of length 5 consisting of the letters “brown”?

  1. All such strings

  2. How many of these strings contain the sub-string “row”?

  3. How many of these strings do not contain the sub-string “row”?

  4. How many of these strings do not contain the sub-string “nob”?

Solution.

1. There are 5! = 120 permutations of the word “brown”.

2. There are three cases where the substring “row” is contained in the string.

  • r o w _ _ ; 2 options for remaining ‘b’ and ‘n’

  • _ r o w _ ; 2, see above

  • _ _ r o w ; 2, see above

There are 6 strings that contain substring “row”.

3. We will count by complement. Since there are 120 total strings, and 6 contain “row”, then there are 120 - 6 = 114 strings that do not contain “row”.

4. There are three cases where the substring “nob” is contained in the string.

  • n o b _ _ = 2 options for remaining ‘r’ and ‘w’

  • _ n o b _ = 2, see above

  • _ _ n o b = 2, see above

Since 6 strings contain “nob”, there are 114 strings do not contain “nob”.

Problem 4.3.2.

For the following conditions count the number of arrangements of 12 students.

  1. Each student in turn will present solutions to problems \(1,2,\ldots,12\text{.}\)

  2. They line up and care only about who is standing next to them.

  3. They sit around a table and care only about who is sitting next to them.

Solution.

Discussing this problem with K. Walker led to two interesting interpretations of its contents. One from the perspective of the instructor who is lining up twelve students and counting permutations while trying to preserve the adjacencies of the students; and another from the perspective of the student in the lineup who wishes only to count the number of possibilities of who might be standing next to them (possibly to gauge the liklihood of standing next to a crush or calculating the probability of standing next to a peer with particaularly poor personal hygiene).

First, let us consider the perspective of the instructor. The instructor wishes to count the number of arrangements that 12 problems can be presented by 12 students. Clearly, there are 12 students who could present the first, then 11 who could present the second, and so on. We see immediately that the number of arrangements of presentations is equal to the permutations of the order of the students. Therefore there are \(12!\) different ways that 12 students could present 12 solutions.

Next, the instructor wishes to count all of the ways that they could arrange the students in a line, where any arrangements in which all students are standing next to same adjacent students are considered identical. We see that the only way to preserve the adjacencies in this way is to completely reverse the order in which they are standing. For example:

\begin{equation} ABCDEFGHIJKL=LKJIHGFEDCBA\tag{4.3.1} \end{equation}

and so on. We see then that for ever permutation of the line, there is an identical permutation which is just the same students in reverse order. So there are \(\frac{12!}{2}\) different arrangements of students in the line.

Finally, the instructor wishes to seat them around a table, and to count any arrangements in which all students have the same adjacent students as being identical. This is very similar to the previous question, but now the first student in the lineup is adjacent to the last student in the lineup since the circular table has no “ends.” For example:

\begin{equation} ABCDEFGHIJKL=BCDEFGHIJLA=CDEFGHIJLAB...\tag{4.3.2} \end{equation}

and so on. Additionally, we see that any permutation read “forwards” is identical to any permutation read “backward” as in the lineup scenario. We see then that in the table scenario, there are \(\frac{12!}{2 \cdot 12}=\frac{11!}{2}\) possible seatings for the students if identical adjacencies equate to identical seatings.

Now let us adopt the perspective of a student who is standing in the lineup. Playing the role of the student, suppose that we are interested in knowing how many combinations of our peers could be stood next to us. Assuming we care about where we are located in the lineup, there are 10 placements in the lineup where other students will be located on our left and right. Since there are 11 students other than ourselves, that means there are \(11 \cdot 10=110\) possible pairs of peers that could be stood next to us for each place in line for a total of \(11 \cdot 10 \cdot 10=1100\) possible arrangements assuming we are not placed at an end. For the ends, there is only one other student standing next to us, so each end place has only 11 possible peers standing adjacent to us. In total, this give that there are \(1100+11+11=1122\) possible arrangements of other students standing next to us assuming that each place we stand is different somehow (maybe one end of the line is closer to the heater and thus more desirable).

Now let's pretend we are being seated at the round table and each seat is different somehow (some seats place the sun in your eyes more than others). Each seat will place a student to our left and to our right, so all 12 seats have \(11 \cdot 10=110\) possible combinations of other students sitting next to us. We see then that this scenario presents \(11 \cdot 10 \cdot 12=1320\) unique seating possibilities.

Problem 4.3.3.

For the following conditions count the number strings of length six consisting of unlimited copies of the letters \(\{\text{a,b,c}\}\text{.}\)

  1. There are no restrictions.

  2. No pair of consecutive letters can be the same.

  3. It must start with ‘a’ and end with ‘c.’

  4. It must start with ‘a’ and no pair of consecutive letters can be the same.

Solution.

When there are no restrictions, there are three options for each of the six places. So, \(3^6= 729\) options.

When no pair of consecutive letters may be the same, we have 3 options for the first place, and two for every other place. So, \(3(2^5)= 96\) options.

There is one option for the first and last place, and three for the centre 4 places. So, \(3^4 = 81\) options.

There is one option for the first place, and two for each of the remaning five places. So, \(1 \cdot 2^5 = 32\) options.

Problem 4.3.4.

How many strings of length eight are there consisting of two of the letters from \(\{\text{a,b,c,d,e}\}\text{.}\)

Solution.

Assumption: the two letters in question may be repeated and as such the assumption is that the proposed strings solely consist of those two letters.

Ergo, we have eight slots to put one of two letters in each slot. The letters can be placed in any order.

Therefore, we must first choose two of the five letters to make the string:

We will use the n choose k technique, where \(n=5\) and \(k=2\text{.}\)

\(\binom{n}{k} = \binom{5}{2} = 10\)

Then we consider the number of slots (8) and that either two of the chosen letters may be placed in each slot.

\(2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 \cdot 2 = 2^8 = 256\)

Ergo, the total amount of strings that can be made with the given conditions is \(10 \cdot 2^8 = 2560\) strings.

Problem 4.3.5.

If Allen presents one of nine problems or one of 5 theorems and then Betty presents one of the remaining problems or theorems, how many outcomes are there?

Solution.

There are 9 ways Allen can choose 1 out of 9 problems, and 5 ways to choose 1 out of 5 theorems. So, there are 14 ways Allen could choose a problem or a theorem.

There are either 8 problems and 5 theorems remaining, or there are 9 problems and 4 theorems remaining. Either way, there are 13 options for Betty.

For each of the 14 ways Allen could choose a problem or theorem, there are 13 ways for Betty to do the same, so the answer is \(14 \cdot 13 = 182\) outcomes.

This problem is solved assuming that the problems and theorems are numbered (distinct), and that choosing a problem vs. a theorem has no consequences (meaning if Allen chooses a problem, Betty can still choose a problem or a theorem).

Problem 4.3.6.

If there are nine problems, how many ways are there to do the following?

  1. Select three problems to present

  2. Select three problems to present, and select four other problems for your friend to present.

  3. Select three sets of three problems for three, different students to present.

Problem 4.3.7.

If there are nine chocolate chip cookies, how many ways are there to do the following?

  1. You and your friend divide up the cookies.

  2. You and your friend divide up the cookies, and each of you must receive at least one.

  3. You and your friend divide up the cookies, and you must receive at least one, and your friend must receive at least two.

Solution.

Use partitioning to divide the cookies between two friends. I will be using the partition formula we made in class.

\(\frac{n+(r-1)!}{(r-1)!n!}\)

How many ways to partition the cookies into two groups.

r=2 groups and n=9 cookies. \((9+(2-1))!/((2-1)!9!) = 10!/(1!9!) = 10/1! = 10\) ways.

Each friend gets at least 1 cookie.

There is be n=9-2 cookies as each friend will have one cookie already.

r=2 groups and n=7 cookies. \((7+(2-1))!/((2-1)!7!) = 8!/(1!9!) = 8/1! = 8\) ways.

One friend gets one cookie and the other gets 2 cookies.

There is be n=9-3 cookies as 1 friend gets one cookie and the other gets 2 cookies.

r=2 groups and n=6 cookies. \((6+(2-1))!/((2-1)!6!) = 7!/(1!6!) = 7/1! = 7\) ways.

Problem 4.3.8.

How many ways are there to choose teams from 12 players under the following conditions. Note the two captains are not part of the 12.

  1. The captains alternately choose players, and no one has an ego.

  2. The captains alternately choose players, and everyone cares when they were picked.

  3. One captain chooses a complete team

Problem 4.3.9.

You can select eight pieces of pie. How many options do you have under the following conditions?

  1. There are unlimited pieces of apple, rhubarb, and orange meringue pie.

  2. You must take at least one of each of the three types.

  3. You must take four each of two of the three types.

  4. You select at most three pieces of apple pie.

Solution.

I am assuming that I select as many pieces of pie as possible. (One could also count the options for choosing at most 8 pieces, which would come out differently.)

  1. Here we can partition 8 proto-pie slices into three groups that will become apple, rhubarb or orange meringue slices, respectively. The number of ways to do this is

    \begin{equation*} \frac{(8 + 3 -1)!}{8!(3-1)!} = \binom{10}{2}= 45. \end{equation*}
  2. If we must take at least one of the three types, then we have only five to allocate among the three groups. This leaves us

    \begin{equation*} \frac{(5+3-1)!}{5!(3-1)!} = \binom{7}{2} = 21 \end{equation*}

    ways to choose our slices.

  3. This one we do a little differently. We must choose exactly two types of pie from three, and then our decision can only be made in one way. It follows that there are \(\binom{3}{2} = 3\) ways to do this.

  4. We can approach this restriction in several ways. A straightforward but heavy-handed method is to separate the options by how many apple slices are chosen and to add them together. Doing so, we obtain

    \begin{equation*} \frac{(8+1)!}{8!1!} + \frac{(7+1)!}{7!1!} + \frac{(6+1)!}{6!1!} + \frac{(5+1)!}{5!1!} \end{equation*}

    where the successive terms of this sum correspond to selecting 0, 1, 2, or 3 slices of apple pie, respectively, then dividing the remaining slices among rhubarb and orange meringue. Simplifying, we obtain

    \begin{equation*} \binom{9}{1} + \binom{8}{1} + \binom{7}{1} + \binom{6}{1} = 9+8+7+6 = 30. \end{equation*}

    ways to select pie slices if we select at most three slices of apple pie.

Problem 4.3.10.

How many arrangments of the letters of “graceful” exist under the following conditions?

  1. There are no extra conditions.

  2. “gr” appears somewhere in the arrangement.

  3. The letters ‘g’ and ‘l’ appear next to each other in the arrangement.

  4. There are three consecutive vowels.

  5. There are two consecutive vowels.

Solution.

1. There are 8! ways to arrange the letters in the string "graceful" with no restirctions.

2. If we want "gr" to appear in the string, we can think of "gr" as consolidated letter. Let's call it *.

With our new alphabet {*,a,c,e,f,u,l} we can make 7! strings.

3. of we want g and l to appear beside eachother, then there are two ways to do this. gl, and lg.

Let's call either combination of g and l beside eachother *. With our new alhpabet of 7 letters, there are \(2 \times 7!\) ways to arrange the letters.

4. There are 3! ways to arrange the vowels {a,e,u}. And if we consider any combination of consecutive vowels

a new letter * with 3! variations of *, and with an alphabet now of 6 letters with * as a letter

then there are \(3! \cdot 7!\) ways to arrange the letters.

5. If we use the choose formula for the vowels, we find there are 3 ways to select 2 vowels.

If we represent the vowles as *, there are 7! ways to arrange the letters. We must multiply 7! by 3

as well as by 2 since there are two ways to arrange the two vowels. The answer is then \(3 \times 2 \times 7!\text{.}\)

Problem 4.3.11.

How many ways can you choose donuts from two dozen nutmeg cake donuts, one dozen chocolate cake donuts, and a half dozen Spritzkuchen?

(a)

You select 8 donuts.

Solution.

We are selecting 8 donuts, and we are limited by the fact that we can only choose 6 Spritzkuchen. We will examine the 7 cases where you can choose between 0 and 6 Spritzkuchen, and then we will partition the remaining portions between the other two types of donuts.

0 Spritzkuchen: 8 portions remaining, 9 choose 1 = 9 combos

1 Spritzkuchen: 7 portions remaining, 8 choose 1 = 8 combos

\(\vdots\)

6 Spritzkuchen: 2 portions remaining, 3 choose 1 = 3 combos

9 + 8 + 7 + 6 + 5 + 4 + 3 = 42 combos.

(b)

You select a dozen donuts.

Solution.

Very similar approach as above, but instead we are selecting 12 donuts.

0 Spritzkuchen: 12 portions remaining, 13 choose 1 = 13 combos

1 Spritzkuchen: 11 portions remaining, 12 choose 1 = 12 combos

\(\vdots\)

6 Spritzkuchen: 6 portions remaining, 7 choose 1 = 7 combos

13 + 12 + 11 + 10 + 9 + 8 + 7 = 70 combos of one dozen donuts.

(c)

You select 42 donuts.

Solution.

Since there are 42 total donuts to select from, there is only 1 combination where you can choose all 42.

Problem 4.3.12.

How many integer solutions are there to \(x_1+x_2+x_3+x_4+x_5=28\) under the following conditions?

  1. \(x_i \ge 0\text{.}\)

  2. \(x_i > 0\text{.}\)

  3. \(x_i \ge i\text{.}\)

Problem 4.3.13.

How many integer solutions are there to \(x_1+x_2+x_3+x_4+x_5+x_6=20\) under the conditions \(x_1+x_2+x_3=7\) and \(x_i \ge 0\) for all \(i\text{?}\)

Problem 4.3.14.

How many integer solutions are there to \(x_1+x_2+x_3 \le 7\) under the condition \(x_i \ge 0\) for all \(i\text{?}\)

Solution.

We can count this by brute force: finding all the solutions to \(x_1+x_2+x_3 = k\) for \(0 \leq k \leq 7\text{.}\) This is a sum of successive binomial coefficients in the second diagonal of Pascal's triangle. We obtain the sum

\begin{equation*} \frac{(0+2)!}{0!2!} + \frac{(1+2)!}{1!2!} + \frac{(2+2)!}{2!2!} + \frac{(3+2)!}{3!2!} + \frac{(4+2)!}{4!2!} + \frac{(5+2)!}{5!2!} + \frac{(6+2)!}{6!2!} + \frac{(7+2)!}{7!2!}, \end{equation*}

which is also

\begin{align*} \binom{2}{2} + \binom{3}{2} \amp+ \binom{4}{2} + \binom{5}{2} + \binom{6}{2} + \binom{7}{2} + \binom{8}{2} + \binom{9}{2} \\ \amp= 1 + 3 + 6 + 10 + 15 + 21 + 28 + 36 = 120. \end{align*}

Note that this is also a binomial coefficient, namely \(\binom{10}{3}\text{.}\)