Subfield: Algebra


Question: Suppose there are $n$ plates equally spaced around a circular table. Ross wishes to place an identical gift on each of $k$ plates, so that no two neighbouring plates have gifts. Let $f(n, k)$ represent the number of ways in which he can place the gifts. For example $f(6,3)=2$, as shown below.
<img_3235>

Throughout this problem, we represent the states of the $n$ plates as a string of 0's and 1's (called a binary string) of length $n$ of the form $p_{1} p_{2} \cdots p_{n}$, with the $r$ th digit from the left (namely $p_{r}$ ) equal to 1 if plate $r$ contains a gift and equal to 0 if plate $r$ does not. We call a binary string of length $n$ allowable if it satisfies the requirements - that is, if no two adjacent digits both equal 1. Note that digit $p_{n}$ is also "adjacent" to digit $p_{1}$, so we cannot have $p_{1}=p_{n}=1$.
Prove that $f(n, k)=f(n-1, k)+f(n-2, k-1)$ for all integers $n \geq 3$ and $k \geq 2$.

Solution:
An allowable string $p_{1} p_{2} \cdots p_{n-1} p_{n}$ has $\left(p_{1}, p_{n}\right)=(1,0),(0,1)$, or $(0,0)$.

Define $g(n, k, 1,0)$ to be the number of allowable strings of length $n$, containing $k 1$ 's, and with $\left(p_{1}, p_{n}\right)=(1,0)$.

We define $g(n, k, 0,1)$ and $g(n, k, 0,0)$ in a similar manner.

Note that $f(n, k)=g(n, k, 1,0)+g(n, k, 0,1)+g(n, k, 0,0)$.

Consider the strings counted by $g(n, k, 0,1)$.

Since $p_{n}=1$, then $p_{n-1}=0$. Since $p_{1}=0$, then $p_{2}$ can equal 0 or 1 .

We remove the first and last digits of these strings.

We obtain strings $p_{2} p_{3} \cdots p_{n-2} p_{n-1}$ that is strings of length $n-2$ containing $k-11$ 's.

Since $p_{n-1}=0$, then the first and last digits of these strings are not both 1 . Also, since the original strings did not contain two consecutive 1's, then these new strings does not either.

Therefore, $p_{2} p_{3} \cdots p_{n-2} p_{n-1}$ are allowable strings of length $n-2$ containing $k-1$ 1's, with $p_{n-1}=0$ and $p_{2}=1$ or $p_{2}=0$.

The number of such strings with $p_{2}=1$ and $p_{n-1}=0$ is $g(n-2, k-1,1,0)$ and the number of such strings with $p_{2}=0$ and $p_{n-1}=0$ is $g(n-2, k-1,0,0)$.

Thus, $g(n, k, 0,1)=g(n-2, k-1,1,0)+g(n-2, k-1,0,0)$.

Consider the strings counted by $g(n, k, 0,0)$.

Since $p_{1}=0$ and $p_{n}=0$, then we can remove $p_{n}$ to obtain strings $p_{1} p_{2} \cdots p_{n-1}$ of length $n-1$ containing $k 1$ 's. These strings are allowable since $p_{1}=0$ and the original strings were allowable.

Note that we have $p_{1}=0$ and $p_{n-1}$ is either 0 or 1 .

So the strings $p_{1} p_{2} \cdots p_{n-1}$ are allowable strings of length $n-1$ containing $k$ 1's, starting with 0 , and ending with 0 or 1 .

The number of such strings with $p_{1}=0$ and $p_{n-1}=0$ is $g(n-1, k, 0,0)$ and the number of such strings with $p_{1}=0$ and $p_{n-1}=1$ is $g(n-1, k, 0,1)$.

Thus, $g(n, k, 0,0)=g(n-1, k, 0,0)+g(n-1, k, 0,1)$.



Consider the strings counted by $g(n, k, 1,0)$.

Here, $p_{1}=1$ and $p_{n}=0$. Thus, $p_{n-1}$ can equal 0 or 1 . We consider these two sets separately.

If $p_{n-1}=0$, then the string $p_{1} p_{2} \cdots p_{n-1}$ is an allowable string of length $n-1$, containing $k 1$ 's, beginning with 1 and ending with 0 .

Therefore, the number of strings counted by $g(n, k, 1,0)$ with $p_{n-1}=0$ is equal to $g(n-1, k, 1,0)$.

If $p_{n-1}=1$, then the string $p_{2} p_{3} \cdots p_{n-1}$ is of length $n-2$, begins with 0 and ends with 1 . Also, it contains $k-1$ 1's (having removed the original leading 1) and is allowable since the original string was.

Therefore, the number of strings counted by $g(n, k, 1,0)$ with $p_{n-1}=1$ is equal to $g(n-2, k-1,0,1)$.

Therefore,

$$
\begin{aligned}
f(n, k)= & g(n, k, 1,0)+g(n, k, 0,1)+g(n, k, 0,0) \\
= & (g(n-1, k, 1,0)+g(n-2, k-1,0,1)) \\
& \quad+(g(n-2, k-1,1,0)+g(n-2, k-1,0,0)) \\
& \quad+(g(n-1, k, 0,0)+g(n-1, k, 0,1)) \\
= & (g(n-1, k, 1,0)+g(n-1, k, 0,1)+g(n-1, k, 0,0)) \\
& \quad+(g(n-2, k-1,0,1)+g(n-2, k-1,1,0)+g(n-2, k-1,0,0)) \\
= & f(n-1, k)+f(n-2, k-1)
\end{aligned}
$$

as required.
We develop an explicit formula for $f(n, k)$ by building these strings.

Consider the allowable strings of length $n$ that include $k$ 1's. Either $p_{n}=0$ or $p_{n}=1$.

Consider first the case when $p_{n}=0$. (Here, $p_{1}$ can equal 0 or 1.)

These strings are all of the form $p_{1} p_{2} p_{3} \cdots p_{n-1} 0$.

In this case, since a 1 is always followed by a 0 and the strings end with 0 , we can build these strings using blocks of the form 10 and 0 . Any combination of these blocks will be an allowable string, as each 1 will always be both preceded and followed by a 0 .

Thus, these strings can all be built using $k 10$ blocks and $n-2 k 0$ blocks. This gives $k$ 1 's and $k+(n-2 k)=n-k 0$ 's. Note that any string built with these blocks will be allowable and will end with a 0 , and any such allowable string can be built in this way.

The number of ways of arranging $k$ blocks of one kind and $n-2 k$ blocks of another kind is $\left(\begin{array}{c}k+(n-2 k) \\ k\end{array}\right)$, which simplifies to $\left(\begin{array}{c}n-k \\ k\end{array}\right)$.

Consider next the case when $p_{n}=1$.

Here, we must have $p_{n-1}=p_{1}=0$, since these are the two digits adjacent to $p_{n}$.

Thus, these strings are all of the form $0 p_{2} p_{3} \cdots 01$.

Consider the strings formed by removing the first and last digits.

These strings are allowable, are of length $n-2$, include $k-11$ 's, end with 0 , and can begin with 0 or 1 .

Again, since a 1 is always followed by a 0 and the strings end with 0 , we can build these strings using blocks of the form 10 and 0 . Any combination of these blocks will be an allowable string, as each 1 will always be both preceded and followed by a 0 .

Translating our method of counting from the first case, there are $\left(\begin{array}{c}(n-2)-(k-1) \\ k-1\end{array}\right)$ or



$\left(\begin{array}{c}n-k-1 \\ k-1\end{array}\right)$ such strings.

Thus, $f(n, k)=\left(\begin{array}{c}n-k \\ k\end{array}\right)+\left(\begin{array}{c}n-k-1 \\ k-1\end{array}\right)$ such strings.

To prove the desired fact, we will use the fact that $\left(\begin{array}{c}m \\ r\end{array}\right)=\left(\begin{array}{c}m-1 \\ r\end{array}\right)+\left(\begin{array}{c}m-1 \\ r-1\end{array}\right)$, which we prove at the end.

Now

$$
\begin{aligned}
f & n-1, k)+f(n-2, k-1) \\
& =\left(\begin{array}{c}
(n-1)-k \\
k
\end{array}\right)+\left(\begin{array}{c}
(n-1)-k-1 \\
k-1
\end{array}\right)+\left(\begin{array}{c}
(n-2)-(k-1) \\
k-1
\end{array}\right)+\left(\begin{array}{c}
(n-2)-(k-1)-1 \\
(k-1)-1
\end{array}\right) \\
& =\left(\begin{array}{c}
n-k-1 \\
k
\end{array}\right)+\left(\begin{array}{c}
n-k-2 \\
k-1
\end{array}\right)+\left(\begin{array}{c}
n-k-1 \\
k-1
\end{array}\right)+\left(\begin{array}{c}
n-k-2 \\
k-2
\end{array}\right) \\
& =\left(\begin{array}{c}
n-k-1 \\
k
\end{array}\right)+\left(\begin{array}{c}
n-k-1 \\
k-1
\end{array}\right)+\left(\begin{array}{c}
n-k-2 \\
k-1
\end{array}\right)+\left(\begin{array}{c}
n-k-2 \\
k-2
\end{array}\right) \\
& =\left(\begin{array}{c}
n-k \\
k
\end{array}\right)+\left(\begin{array}{c}
n-k-1 \\
k-1
\end{array}\right) \quad \text { (using the identity above) } \\
& =f(n, k)
\end{aligned}
$$

as required.

To prove the identity, we expand the terms on the right side:

$$
\begin{aligned}
\left(\begin{array}{c}
m-1 \\
r
\end{array}\right)+\left(\begin{array}{c}
m-1 \\
r-1
\end{array}\right) & =\frac{(m-1) !}{r !(m-r-1) !}+\frac{(m-1) !}{(r-1) !(m-r) !} \\
& =\frac{(m-1) !(m-r)}{r !(m-r-1) !(m-r)}+\frac{r(m-1) !}{r(r-1) !(m-r) !} \\
& =\frac{(m-1) !(m-r)}{r !(m-r) !}+\frac{r(m-1) !}{r !(m-r) !} \\
& =\frac{(m-1) !(m-r+r)}{r !(m-r) !} \\
& =\frac{(m-1) ! m}{r !(m-r) !} \\
& =\frac{m !}{r !(m-r) !} \\
& =\left(\begin{array}{c}
m \\
r
\end{array}\right)
\end{aligned}
$$

as required.