MathLabs

Problem 6

There are nn lamps L0,…,Ln−1L_0,\ldots,L_{n-1} in a circle, where n>1n>1 and Ln+k=LkL_{n+k}=L_k. At step sis_i, if Li−1L_{i-1} is lit, switch LiL_i, otherwise do nothing. Initially all lamps are on. Show that (a) there is a positive integer M(n)M(n) such that after M(n)M(n) steps all lamps are on again; (b) if n=2kn=2^k, take M(n)=n2−1M(n)=n^2-1; (c) if n=2k+1n=2^k+1, take M(n)=n2−n+1M(n)=n^2-n+1.
Step 1 of 5: Encode the lamps
In plain words

Sequential updates make each lamp depend on the already updated predecessor.

xi∈F2x_i\in\mathbb F_2
Detailed analysis

Let xix_i be 1 when LiL_i is lit and 0 otherwise. A switch is addition by 1 in the field with two elements. During one complete pass, the updated values satisfy y0=x0+xn−1y_0=x_0+x_{n-1} and yi=xi+yi−1y_i=x_i+y_{i-1} for ii from 1 through n−1n-1.