114. Multiplication of Choices
The principle of multiplication of choices, stated below, is behind the sort of reasoning illustrated in the following argument: You are at a restaurant whose menu has three columns, A, B and C. To have a complete meal, you order one of the three items in column A, one of the five items in column B, and one of the three items in column C. You can therefore choose $45 = 3\times 5\times 3$ different meals.
114.1 Definition: independent tasks
Suppose that there are $k$ tasks $T_{1}, T_{2},\ldots ,T_{k}$ which must be done in order, and, for each $i = 1, 2,\ldots ,k$, there are $n_{i}$ ways of doing task $T_{i}$. Suppose furthermore that doing $T_{i}$ in any particular way does not change the number $n_{j}$ ways of doing any later task $T_{j}$. Then we say that the tasks are independent of each other.
114.2 Theorem: The Principle of Multiplication of Choices
Suppose there are $k$ independent tasks $T_{i} (i = 1,\ldots ,k)$ and suppose that for each $i$ there are $n_{i}$ ways of doing $T_{i} (i = 1,\ldots ,k)$ . Then there are $\prod_{i=1}^{k}n_{i} =n_{1}n_{2}\cdots n_{k}$ ways of doing the tasks $T_{1},\ldots ,T_{k}$ in order.
Proof We prove Theorem 114.2 by induction on $k$, starting at 1.
If you have one task $T_{1}$ which can be done in $n_{1}$ different ways, Theorem 114.2 says you can do $T_{1}$ in $\prod_{i=1}^{1}n_{i} =n_{1}$ different ways, which of course is true.
Now suppose the theorem is true for $k$ tasks. Assume you have $k+ 1$ tasks $T_{1},\ldots ,T_{k},T_{k+1}$, and for each $i$ there are $n_{i}$ ways of doing task $T_{i}$. Let $m$ be the total number of ways of doing the tasks $T_{1},\ldots ,T_{k}$ in order. Suppose you have done them in one of the $m$ ways. Then you can do $T_{k+1}$ in any of $n_{i+1}$ ways. Thus for each of the $m$ ways of doing the first $k$ tasks, you have $n_{i+1}$ ways of doing the $(k+ 1)$st; therefore, there are altogether $n_{i+1} +n_{i+1} +\cdots +n_{i+1}$ (sum of $m$ terms) ways of doing the $k+ 1$ tasks. This means that there are $m\times n_{i+1}$ ways to do $T_{1},\ldots ,T_{k+1}$ in order.
By induction hypothesis, $m=\prod_{i=1}^{k}n_{i}$, so the number of ways of doing the tasks $T_{1},\ldots ,T_{k+1}$ is
$$n_{k+1} \cdot \Bigl(\prod_{i=1}^{k} n_{i}\Bigr)$$
which by 105.1.5 is $\prod_{i=1}^{k+1}n_{i}$, as required.
114.2.1 Worked Exercise How many three-digit integers (in decimal notation) are there whose second digit is not 5?
Answer Writing such a sequence of digits can be perceived as carrying out three tasks in a row:
T.1 Write any digit except 0.
T.2 Write any digit except 5.
T.3 Write any digit.
There are 9 ways to do T.1, 9 ways to do T.2, and 10 ways to do T.3, so according to Theorem 114.2, there are 810 ways to do T.1, T.2, T.3 in order.
114.2.2 Worked Exercise Find the number of strings of length $n$ in $\{a,b,c\}^{*}$ that contain exactly one $a$.
Answer This requires us to look at the problem in a slightly different way from Worked Exercise 114.2.1. To construct a string of length in $\{a,b,c\}^{*}$ with exactly one $a$ requires us to
a) Choose which of $n$ possible locations to put the one and only $a$ ($n$ ways to do this).
b) For each of the $n-1$ other locations, choose whether to put a $b$ or $c$ there (2 choices for each location, $2^{n-1}$ choices altogether).
It follows that there are $n\cdot 2^{n-1}$ such strings.
114.2.3 Exercise Find the number of 5-digit integers with ‘3’ in the middle place. (Answer on page 249.)
114.2.4 Exercise Find the number of even 5-digit integers. (Answer on page 249.)
114.3 Exercise set
In exercises 114.3.2 through 114.3.5, $A =\{a,b,c\}$.
114.3.1 Exercise Find the number of strings of length $n$ in $\{a,b,c\}^{*}$ with no $a$’s. (Answer on page 249.)
114.3.2 Exercise Find a formula $F (n)$ for the number of strings in $A^{*}$ of length $n$, for each $n \in \mathrm{N}$. (Answer on page 249.)
114.3.3 Exercise Find a formula $G (n)$ for the number of strings in $A^{*}$ of length $n$ which begin and end with $a$. (Answer on page 249.)
114.3.4 Exercise Find a formula $H (n)$ for the number of strings in $A^{*}$ of length $n$ which do not begin or end with $c$.
114.3.5 Exercise Find a formula for the number of strings in $A^{*}$ of length $n >2$ which have a ‘$a$’ in the third place.
114.3.6 Exercise In the USA a local telephone number consists of a string of 7 digits, the first two of which cannot be 0 or 1. How many possible local telephone numbers are there?
Pages 174–176 of the book (PDF).