Maths Olympiad Prep

Library / IRL ABooklet /168 of 191

IRL ABooklet

Combinatorics Difficulty 7.2 National Olympiad, round 2 Prove it Ireland

Caitlin and Donal play a game called Basketball Shoot-Out. The game consists of 10 rounds. In each round, Caitlin and Donal both throw a ball simultaneously at each other's basket. If a player's ball falls into the basket, that player scores one point; otherwise, they score zero points. The scoreboard shows the complete sequence of points scored by each player in each of the 10 rounds of the game.
It turns out that Caitlin has scored at least as many points in total as Donal after every round of the game. Prove the number of possible scoreboards is divisible by 4, but is not divisible by 8.

Solutions — 2

Solution 1

We can represent the scoreboard by a 2×n2 \times n binary matrix, e.g.,
[01010011]. \begin{bmatrix} 0 & 1 & 0 & 1 \\ 0 & 0 & 1 & 1 \end{bmatrix}.
The problem is then asking for the number of 2×n2 \times n binary matrices such that, for every 1≤t≤n1 \le t \le n, the first tt elements in the first row always contain at least as many 1s as the first tt elements in the second row.
Denote the number of possible 2×n2 \times n scoreboards by TnT_n. We will develop a recursion for TnT_n. First, we have T1=3T_1 = 3, as the possible 2×12 \times 1 scoreboards are
[00][11][10]. \begin{bmatrix} 0 \\ 0 \end{bmatrix} \quad \begin{bmatrix} 1 \\ 1 \end{bmatrix} \quad \begin{bmatrix} 1 \\ 0 \end{bmatrix}.
Next, for any 0≤k≤n0 \le k \le n define Tn,kT_{n,k} to be the number of 2×n2 \times n scoreboards which satisfy the conditions of the problem such that the top row contains kk more 1s than the bottom row. When k<0k < 0 or n<kn < k, we define Tn,k=0T_{n,k} = 0. We then have Tn=∑kTn,kT_n = \sum_k T_{n,k}. From the above list of 2×12 \times 1 scoreboards we find
T1,0=2andT1,1=1. T_{1,0} = 2 \quad \text{and} \quad T_{1,1} = 1.
For n≥1n \ge 1 and any k≥0k \ge 0 we have
Tn+1,k=Tn,k−1+2Tn,k+Tn,k+1(9) T_{n+1,k} = T_{n,k-1} + 2T_{n,k} + T_{n,k+1} \quad (9)
where the first term on the RHS is obtained by adding [10][\begin{smallmatrix} 1 \\ 0 \end{smallmatrix}] to the existing 2×n2 \times n scoreboard if Tn,k−1≠0T_{n,k-1} \ne 0, the second term on the RHS is obtained by adding [00][\begin{smallmatrix} 0 \\ 0 \end{smallmatrix}] or [11][\begin{smallmatrix} 1 \\ 1 \end{smallmatrix}] to the existing 2×n2 \times n scoreboard if Tn,k≠0T_{n,k} \ne 0, and the third term on the RHS is obtained by adding [01][\begin{smallmatrix} 0 \\ 1 \end{smallmatrix}] to the existing 2×n2 \times n scoreboard if Tn,k+1≠0T_{n,k+1} \ne 0. The recursion (9) is even correct for n=0n = 0 if we set T0,0=1T_{0,0} = 1.

Adding equations (9) for 0≤k≤n+10 \le k \le n + 1, we obtain
∑k=0n+1Tn+1,k=4∑k=0nTn,k−Tn,0,(10) \sum_{k=0}^{n+1} T_{n+1,k} = 4 \sum_{k=0}^{n} T_{n,k} - T_{n,0}, \qquad (10)
which, using the observation that Tn=∑k=0nTn,kT_n = \sum_{k=0}^n T_{n,k}, yields
Tn+1=4Tn−Tn,0for n≥1.(11) T_{n+1} = 4T_n - T_{n,0} \quad \text{for } n \ge 1. \qquad (11)
We can now proceed in two different ways. The first way is a brute force calculation modulo 8 for which we use (9) and Tn=∑k=0nTn,kT_n = \sum_{k=0}^n T_{n,k}:

Tn,kT_{n,k}kk
nn012345678910TnT_n
011
1213
25412
366613
4203016
54564216
654501414
7626662613
86040407016
942000360212
10202034705414

From this table we see that T10≡4(mod8)T_{10} \equiv 4 \pmod 8, which is the required result.

A second way is to prove that Tn,0T_{n,0} is the (n+1)(n+1)-th Catalan number, i.e.,
Tn,0=Cn+1=1n+2(2n+2n+1). T_{n,0} = C_{n+1} = \frac{1}{n+2} \binom{2n+2}{n+1}.
To show this, we describe a bijection between the set of 2×n2 \times n scoreboards counted by Tn,0T_{n,0}, i.e. those which satisfy the conditions of the problem and for which the top row contains the same number of 1s as the bottom row, and the set of North-East lattice paths (also known as Dyck paths or mountain ranges if rotated by 45°) in the plane from (0,0)(0,0) to (n+1,n+1)(n+1, n+1) not going below the line y=xy = x where “North” is the step (0,1)(0,1) and “East” is the step (1,0)(1,0).
To do this, we transform such a 2×n2 \times n scoreboard into a North-East lattice path via the following procedure: we start with a North step from (0,0)(0,0) and then read each subsequent pair of steps from the next column of the scoreboard, using the conventions that
(a) first we perform the step for the top row element, where a 1 in the top row corresponds to a North step and a 0 in the top row corresponds to an East step, and
(b) then we perform the step for the bottom row element, where a 1 in the bottom row corresponds to an East step and a 0 in the top row corresponds to a North step.
At the end, we perform a final East step to end at the point (n+1,n+1)(n+1, n+1).
Figure 1
It is easily checked that the generated paths are precisely the North-East lattice paths in the plane from (0,0)(0,0) to (n+1,n+1)(n+1, n+1) not going below the line y=xy=x, which are counted by the (n+1)(n+1)-th Catalan number Cn+1C_{n+1}. Equivalently and equally well-known is that the Catalan number CnC_n counts the number of so-called Dyck Words of length 2n2n. A Dyck Word based on the two letters NN and EE is a string of length 2n2n that consists of nn letters NN and nn letters EE, such that no initial segment has more EE's than NN's. The Dyck Word of the above example would be NENNNNEENEENENNNNEENEE and from the procedure described above it is clear how Dyck Words correspond to the scoreboards we consider.
Equation (11) now turns into
Tn+1=4Tn−Cn+1for n≥1. T_{n+1} = 4T_n - C_{n+1} \quad \text{for } n \ge 1.
This is valid for n=0n=0 as well, since T1=3=4−C1=4T0−C1T_1 = 3 = 4 - C_1 = 4T_0 - C_1. A straightforward induction then shows that
Tn=4n−∑j=0n−14jCn−j,for every n≥1. T_n = 4^n - \sum_{j=0}^{n-1} 4^j C_{n-j}, \quad \text{for every } n \ge 1.
The statement of the problem follows since C10+4C9=16796+4⋅4862C_{10} + 4C_9 = 16796 + 4 \cdot 4862 is divisible by 4 but not by 8.

Solution 2

It is convenient to split each round into two throws, with Caitlin throwing before Donal. For k≥1k \ge 1 we let c(2k−1)∈{0,1}c(2k-1) \in \{0, 1\} be the score of Caitlin at throw 2k−12k-1 and d(2k)∈{0,1}d(2k) \in \{0, 1\} be the score of Donal at throw 2k2k. The first column of the scoreboard contains c(1)c(1) and d(2)d(2) and, more generally, column kk contains c(2k−1)c(2k-1) and d(2k)d(2k). Finally, the total scores after tt throws are C(t)=∑i=1tc(i)C(t) = \sum_{i=1}^{t} c(i) for Caitlin and D(t)=∑i=1td(i)D(t) = \sum_{i=1}^{t} d(i) for Donal, where we understand that c(2k)=d(2k−1)=0c(2k) = d(2k-1) = 0. We define a sequence WtW_t for t≥0t \ge 0 by letting W0=0W_0 = 0 and, for t≥1t \ge 1,
Wt={2(C(t)−D(t))if t≡0(mod2)2(C(t)−D(t))−1if t≡1(mod2) W_t = \begin{cases} 2(C(t) - D(t)) & \text{if } t \equiv 0 \pmod 2 \\ 2(C(t) - D(t)) - 1 & \text{if } t \equiv 1 \pmod 2 \end{cases}
By inspecting all possibilities, it is easy to see that ∣Wt−Wt−1∣=1|W_t - W_{t-1}| = 1 for all t≥1t \ge 1 and that
Wt−Wt−1={+1if t is odd and c(t)=1, or t is even and d(t)=0−1if t is odd and c(t)=0, or t is even and d(t)=1. W_t - W_{t-1} = \begin{cases} +1 & \text{if } t \text{ is odd and } c(t) = 1, \text{ or } t \text{ is even and } d(t) = 0 \\ -1 & \text{if } t \text{ is odd and } c(t) = 0, \text{ or } t \text{ is even and } d(t) = 1. \end{cases}
This implies that the scoreboard is completely determined by the sequence of differences (Wt−Wt−1)t≥1(W_t - W_{t-1})_{t \ge 1}. We note also that ∣Wt∣≤t|W_t| \le t for all t≥0t \ge 0 and that Wt≡t(mod2)W_t \equiv t \pmod 2.
Comparing with Solution 1, we note that the Dyck Words mentioned there turn into the sequence (Wt−Wt−1)t≥1(W_t - W_{t-1})_{t \ge 1} by removing the starting N and the trailing E, and then replacing N by +1 and E by -1.
When we plot the points (t,Wt)(t, W_t) for 0≤t≤2n0 \le t \le 2n and connect neighbours by a straight line segment, we obtain a mountain range that is obtained from the North-East lattice path in Solution 1 by removing the initial North step and the terminal East step. For this reason, we will speak about paths when we deal with sequences (Wt)1≤t≤T(W_t)_{1 \le t \le T}.
n=4[01010011]t012345678Wt0−10121010 n = 4 \quad \begin{bmatrix} 0 & 1 & 0 & 1 \\ 0 & 0 & 1 & 1 \end{bmatrix} \quad \begin{array}{c|cccccc} t & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\ \hline W_t & 0 & -1 & 0 & 1 & 2 & 1 & 0 & 1 & 0 \end{array}
Figure 2
There are clearly 2T2^T possible paths for the first TT throws, because we can choose the differences Wt−Wt−1W_t - W_{t-1} freely from {−1,1}\{-1, 1\}. We say a path is feasible if Wt≥0W_t \ge 0 for all even tt between 0 and TT inclusive, which is the criterion in the question. That is the same as requiring Wt≥−1W_t \ge -1 for all (odd or even) 0≤t≤T0 \le t \le T, allowing for the possibility that at some even time point, Caitlin has the same score as Donal, misses a throw and then Donal also misses.

For T≥0T \ge 0 and x∈Zx \in \mathbb{Z}, we define FT,xF_{T,x} to be the number of feasible paths between 0 and TT such that WT≥xW_T \ge x. These are paths that start at (0, 0) and end at (T, y) for some y≥xy \ge x.
Note that FT,x=FT,−1F_{T,x} = F_{T,-1} for all x≤−1x \le -1 and FT,x=0F_{T,x} = 0 for T<xT < x since ∣WT∣≤T|W_T| \le T. Note also that we always have y≡T(mod2)y \equiv T \pmod 2, hence FT,x=FT,x−1F_{T,x} = F_{T,x-1} if x≡T(mod2)x \equiv T \pmod 2. The relationship to Tn,kT_{n,k} and TnT_n from Solution 1 is
F2n,2r=∑k=rnTn,kandF2n,0=Tn.(12) F_{2n,2r} = \sum_{k=r}^{n} T_{n,k} \quad \text{and} \quad F_{2n,0} = T_n. \qquad (12)
The question requires us to show that
F20,0≡4(mod8). F_{20,0} \equiv 4 \pmod{8}.
We will proceed in two different ways from here. The first way will be based on a recurrence relation for Ft,xF_{t,x}. From the definition it is clear that
F0,x={1if x≤00if x>0. F_{0,x} = \begin{cases} 1 & \text{if } x \le 0 \\ 0 & \text{if } x > 0. \end{cases}
For t>0t > 0 and x≥−1x \ge -1 satisfying x≡t(mod2)x \equiv t \pmod 2 we have
Ft,x=Ft−1,x−1+Ft−1,x+1.(13) F_{t,x} = F_{t-1,x-1} + F_{t-1,x+1}. \qquad (13)
To see this, recall that Ft,xF_{t,x} counts feasible paths for which Wt≥xW_t \ge x. The most recent throw could either have contributed +1 (in which case Wt−1≥x−1W_{t-1} \ge x-1) or -1 (in which case Wt−1≥x+1W_{t-1} \ge x+1). The claim is the sum of these two cases. Note that when tt is odd and x=−1x = -1 equation (13) reads Ft−1=2Ft−1,0F_{t-1} = 2F_{t-1,0}, because Ft−1,−2=Ft−1,−1=Ft−1,0F_{t-1,-2} = F_{t-1,-1} = F_{t-1,0} as observed above. This is in line with the observation that, for feasible paths, Wt−1≥−2W_{t-1} \ge -2 actually means Wt−1≥0W_{t-1} \ge 0 when tt is odd.
Equation (13) is required only for even tt, so we may use the double-step relation for t≥1t \ge 1 and x≥0x \ge 0:
F2t,2x=F2t−2,2x−2+2F2t−2,2x+F2t−2,2x+2,(14) F_{2t,2x} = F_{2t-2,2x-2} + 2F_{2t-2,2x} + F_{2t-2,2x+2}, \qquad (14)
obtained from applying equation (13) twice. Using (12), this can be seen to be equivalent to the recurrence equation (9) from Solution 1. For x=0x = 0 equation (14) becomes
F2t,0=3F2t−2,0+F2t−2,2, F_{2t,0} = 3F_{2t-2,0} + F_{2t-2,2},
because F2t−2,−2=F2t−2,0F_{2t-2,-2} = F_{2t-2,0} as explained above. One possibility to finish now is to calculate F20,0(mod8)F_{20,0} \pmod 8 using (14):

F2t,2xF_{2t,2x}0246810
01
231
4251
63571
864411
10625731
1247366
143535
16600
1826
204

The number 4 in the bottom row of the table proves the result.

A second way to finish the solution is based on the reflection principle from the theory of random walks, instead of using a recurrence relation for Ft,xF_{t,x}. The reflection principle can be described as follows. Let t≥0t \ge 0, H<0H < 0, and x>Hx > H be integers with t≡x(mod2)t \equiv x \pmod 2. Then the following are equal:
* The number of paths starting with W0=0W_0 = 0 and ending at Wt=xW_t = x having touched HH at least once.
* The number of paths starting with W0=0W_0 = 0 and ending at Wt=2H−xW_t = 2H - x.
The proof involves setting up a bijection between the two classes of path, recognising that in each case there is a first time point τ\tau at which Wτ=HW_\tau = H, and reflecting each path after time τ\tau in the horizontal line at level HH.
Figure 3
The usefulness of the reflection principle comes from the fact that it is easier to count the paths of the second kind. If a path starting with W0=0W_0 = 0 and ending at Wt=2H−xW_t = 2H - x has uu up steps and dd down steps, then u+d=tu + d = t.

and u−d=2H−xu - d = 2H - x. Hence, u=(2H+t−x)/2=H+t−x2u = (2H + t - x)/2 = H + \frac{t-x}{2}. Such a path is determined by the position of the up steps, hence their number is equal to the binomial coefficient
(tu)=(tH+t−x2). \binom{t}{u} = \binom{t}{H + \frac{t-x}{2}}.
The reflection principle implies that this number is also equal to the number of paths starting with W0=0W_0 = 0 and ending at Wt=xW_t = x having touched HH at least once.
Subtracting this from the number of all paths ending at Wt=xW_t = x, which is equal to (t(t−x)/2)\binom{t}{(t-x)/2}, we obtain that the number of paths that start at W0=0W_0 = 0, end at Wt=xW_t = x, and for which Ws>HW_s > H for all 0≤s≤t0 \le s \le t, is equal to
(tt−x2)−(tH+t−x2). \binom{t}{\frac{t-x}{2}} - \binom{t}{H + \frac{t-x}{2}}.
In particular, taking H=−2H = -2 and x=t−2kx = t - 2k, this expression becomes
(tk)−(tk−2)=((tk)+(tk−1))−((tk−1)+(tk−2))=(t+1k)−(t+1k−1). \begin{aligned} \binom{t}{k} - \binom{t}{k-2} &= \left( \binom{t}{k} + \binom{t}{k-1} \right) - \left( \binom{t}{k-1} + \binom{t}{k-2} \right) \\ &= \binom{t+1}{k} - \binom{t+1}{k-1}. \end{aligned}
This is the number of paths reaching Wt=xW_t = x without touching −2-2, which are exactly the feasible paths. Counting the feasible paths ending at Wt≥t−2kW_t \ge t - 2k and subtracting those ending at Wt≥t−2k+2W_t \ge t - 2k + 2 we have
Ft,t−2k−Ft,t−2k+2=(t+1k)−(t+1k−1).(15) F_{t,t-2k} - F_{t,t-2k+2} = \binom{t+1}{k} - \binom{t+1}{k-1}. \quad (15)
Because Ft,t+2=0F_{t,t+2} = 0, using a telescoping sum that involves equation (15) for kk replaced successively by k,k−1,k−2,…,0k, k-1, k-2, \dots, 0, we obtain
Ft,t−2k=(t+1k)(16) F_{t,t-2k} = \binom{t+1}{k} \quad (16)
for t≥0t \ge 0 and integers k≤(t+1)/2k \le (t+1)/2. Substituting t=20t=20 and k=10k=10 gives
F20,0=(2110)=21!10!11!. F_{20,0} = \binom{21}{10} = \frac{21!}{10!11!}.
It is sufficient to show that v2(F20,0)=2v_2(F_{20,0}) = 2, where v2(x)v_2(x) is the 2-adic valuation, that is, the highest power of 2 dividing xx. With the aid of Legendre's formula, vp(n!)=∑i≥1⌊npi⌋v_p(n!) = \sum_{i \ge 1} \lfloor \frac{n}{p^i} \rfloor, this can be calculated as
v2(21!10!11!)=v2(21!)−v2(10!)−v2(11!)=18−8−8=2. v_2 \left( \frac{21!}{10!11!} \right) = v_2(21!) - v_2(10!) - v_2(11!) = 18 - 8 - 8 = 2.

Alternatively, after some numerical work, one may spot formula (16) directly. With the aid of the recurrence (13), this formula can be proved by induction. When t=0t = 0, after recalling that (nk)=0\binom{n}{k} = 0 for negative kk, formula (16) is clear by definition for all k≤0k \le 0. For t≥1t \ge 1, using (13), we obtain
Ft,x=Ft−1,x−1+Ft−1,x+1=(t(t−x)/2)+(t(t−x)/2−1)=(t+1(t−x)/2)F_{t,x} = F_{t-1,x-1} + F_{t-1,x+1} = \binom{t}{(t-x)/2} + \binom{t}{(t-x)/2-1} = \binom{t+1}{(t-x)/2}
Ft,−1=2Ft−1,0=2(t(t−1)/2)=(t(t−1)/2)+(t(t+1)/2)=(t+1(t+1)/2).F_{t,-1} = 2F_{t-1,0} = 2\binom{t}{(t-1)/2} = \binom{t}{(t-1)/2} + \binom{t}{(t+1)/2} = \binom{t+1}{(t+1)/2}.
This concludes the proof of formula (16) by induction.

Want a route through all this instead of an archive? The track puts 2,604 problems in a working order, from Junior Challenge level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.