We have garland with $n$ lights. Some lights are on, some are off. In one move we can take some turned on light (only turned on) and turn off it and also change state of neigbour lights. We want to turn off all lights after some moves.. For what $n$ is it always possible?
Problem
Source: St Petersburg Olympiad 2011, Grade 10, P6
Tags: combinatorics
25.05.2019 01:33
This solution assumes that a garland is a circular shape, not a line.
06.10.2019 15:49
Let $a,b,c$ are lights and $b$ is on. Then call $f(a,b,c)$ a move if it switches the states of $a,b,c$ and do not affect any other lamp in the garland. Call $f(a,b,c)$ a legal move if $a,b,c$ are consecutive (in a problem we can do only legal moves). Lets call consecutive lamps $a,b,c$ a telephone-1 if $a,c$ is on, $b$ is off. Call consecutive lamps $a,b,c$ a telephone-2 if $a,b$ is off, $c$ is on. If $n=3k$ color all lights in two colors one in black then two in white then one in black then two in white etc. Then every legal move affects two lights of white color, so their number mod 2 is invariant. So we can't do all lights off from the position where 1 white light is on and all other lights are off. It is easy to check than for $n=5$ and $n=4$ problem condition holds. Lemma 1. Let $a,c,d,e,f,g,h$ be consecutive lamps in a garland of length $\geq 7$ such that $d,e,f$ is telephone-1 or telephone-2 and $c$ is on. We can do a sequence of legal moves so the result will be equal to move $f(a,c,g)$. Proof. $d,e,f$ is telephone, so do legal moves $f(a,c,d),f(e,f,g),f(d,e,f)$.It is easy to check that result will be equal to $f(a,c,g)$. Lemma 2. If for condition holds for $n>3$ it holds for $n+3$. Proof. If all lights are off we are done. If all lights are on do legal move $f(a,b,c)$ for some light b in garland. So there is at least one light that is off and at least one light that is on in garland. It is obvious that there is at least one telephone in garland. Let $a,c,d,e,f,g,h$ be a part of a garland where $d,e,f$ is a telephone. By lemma 1 we can ignore the telephone. And because the problem condition holds for n, we can do all lights off except $d,e,f$. And after this as $n\neq 3k$ it is obvious from construction of telephones that we can do all lights off. So the answer is $n\neq 3k$.