Maths Olympiad Prep

Library / /440 of 462

Combinatorics Difficulty 7.5 National Olympiad, round 2 Prove it Ireland

A row of nn lamps is labelled from left to right with the numbers 11 to nn, where nn is an odd positive integer. Each lamp has a switch which, if pressed, turns it from OFF to ON or from ON to OFF; however the switches may only be pressed according to the following rules:
(a) Switch 1 may be pressed at any time;
(b) Switch k{2,,n}k \in \{2, \dots, n\} may be pressed if and only if lamp (k1)(k-1) is ON and all lamps l<(k1)l < (k-1) (if any) are OFF.
Initially all lamps are ON. Prove that the minimum number of times the switches must be pressed to turn all the lamps OFF is
2n+113 \frac{2^{n+1} - 1}{3}

Solution

For any n1n \ge 1, let LnL_n denote the minimum number of times the switches must be pressed to turn all the lamps OFF. It is easy to check that L1=1L_1 = 1 and L2=2L_2 = 2.

Consider the problem of turning lamps 1,2,,k1, 2, \dots, k from all ON to all OFF, for some k3k \ge 3. First, lamp kk must be turned OFF at some stage. For this to happen, lamps 1,2,,k21, 2, \dots, k-2 must all be OFF. This requires a minimum of Lk2L_{k-2} switches to be pressed. Then one more switch is required to be pressed in order to turn lamp kk OFF. Next consider lamp (k1)(k-1). To turn lamp (k1)(k-1) OFF, lamp (k2)(k-2) must be turned ON. But to turn lamp (k2)(k-2) ON, lamp (k3)(k-3) must be turned ON, and so on (proof completed by induction). Therefore before lamp (k1)(k-1) may be turned OFF, at least as many switches must be pressed as are required to turn all lamps 1,2,,k21, 2, \dots, k-2 ON - this requires at the minimum a further Lk2L_{k-2} switches to be pressed (note that the number of switches required to turn all lamps from OFF to ON is the same as the number required to turn all lamps from ON to OFF). Finally, to turn lamps 1,2,,(k1)1, 2, \dots, (k-1) OFF requires a minimum of Lk1L_{k-1} switches to be pressed. Summarising,
Lk2Lk2+Lk1+1,(1) L_k \ge 2L_{k-2} + L_{k-1} + 1, \quad (1)
for k3k \ge 3. It is easy to see that the above reasoning defines recursively an algorithm which performs the required switchings while satisfying (1) with equality. Therefore
Lk=2Lk2+Lk1+1.(2) L_k = 2L_{k-2} + L_{k-1} + 1. \qquad (2)
Next we prove by induction that for every r1r \ge 1,
L2r1=4r13;L2r=2(4r1)3 L_{2r-1} = \frac{4^r - 1}{3} \quad ; \quad L_{2r} = \frac{2(4^r - 1)}{3}
This is evident for r=1r = 1. Assuming it is true for r=kr = k, we have
L2k+1=4k13;L2k=2(4k1)3 L_{2k+1} = \frac{4^k - 1}{3} \quad ; \quad L_{2k} = \frac{2(4^k - 1)}{3}
and so for r=k+1r = k + 1 we have by (2)
L2k+1=2L2k1+L2k+1=2(4k1)3+2(4k1)3+1=4k+113 \begin{aligned} L_{2k+1} &= 2L_{2k-1} + L_{2k} + 1 \\ &= \frac{2(4^k - 1)}{3} + \frac{2(4^k - 1)}{3} + 1 \\ &= \frac{4^{k+1} - 1}{3} \end{aligned}
and
L2k+2=2L2k+L2k+1+1=4(4k1)3+(4k+11)3+1=2(4k+11)3 \begin{aligned} L_{2k+2} &= 2L_{2k} + L_{2k+1} + 1 \\ &= \frac{4(4^k - 1)}{3} + \frac{(4^{k+1} - 1)}{3} + 1 \\ &= \frac{2(4^{k+1} - 1)}{3} \end{aligned}

We conclude that for any odd positive integer nn, we have n=2k1n = 2k - 1, so k=(n+1)/2k = (n + 1)/2 and therefore
Ln=L2k1=4k13=4n+1213=2n+113 L_n = L_{2k-1} = \frac{4^k - 1}{3} = \frac{4^{\frac{n+1}{2}} - 1}{3} = \frac{2^{n+1} - 1}{3}

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

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