Prove that among any consecutive $2017$ lamps not more than $k/2$ lamps are on

33 Views Asked by At

Given a row of $10^6$ lamps, all of them are initially off. Each of $2016$ people approaches the row and switches any $2017$ consecutive lamps. (One turns on lamps which are off, and turns off lamps which are on). It turned out that at the result $k$ lamps were on. How can I prove that among any $2017$ consecutive lamps there are not more than $\frac k2$ lamps which are turned on? It seems to me that it might be possible to prove this by induction, so I added the corresponding tag.