There are $n$ binary digits, from $A_0$ to $A_{n-1}$. Each operation consists of the following 2 steps:
- Each digit is replaced by the XOR addition of itself with the next digit.
$A_i=XOR(A_i,A_{i+1})$ (for all $i$ from $0$ to $n-2$)
- The last digit is replaced by a $0$.
$A_{n-1}=0$
Given the initial set of digits, is there a quicker method that tells you whether performing the operation repeatedly gives a string of $1$ followed by only $0$s, or returns to the original set, and how many operations will have to be performed.
To answer the first question:
Suppose the initial string $A$ is not all $0$ or all $1$. Then after one operation it's easy to see that you get all $0$.
Suppose the initial string $A$ is not all $0$ or all $1$. Then there is some $i$ such that $A_i \neq A_{i+1}$. After doing this operation as you specified, we have a binary string $A'$. By the above analysis, $A'_{i} = 1$.
Note also that $A'_{n-1} = 0$. Thus, there is some $i \leq j \leq n-2$ such that $A'_j \neq A'_{j+1}$. Otherwise, all the digits would have to be the same which is not true since we've already shown $A'_i \neq A'_{n-1}$. It then follows, as before, that $A''_j = 1$ and so on. Thus, you will never get to all digits as $0$.
For the second question:
If $A_{n-1} = 1$, note after applying your operation $k$ times for any $k > 0$, $A^{(k)}_{n-1} = 0$. So we can never recover the original string.
Otherwise, the situation is a little more complicated. I conjecture, but will not prove, that in a length $n$ string, if the position of the last $1$ is $j$, it will take $2^j$ iterations to get back to the original. For example, with $A = 11010$, the last $1$ is in position $2$, so it will take $4$ iterations to get back to $A.
The idea behind the proof is via recursion on the length of the string. First, note that the second to last digit will always stay the same (because it will always be XOR with $0$, the identity). If you keep going backwards in the string, you'll see that having a $1$ in the $i$th position will cycle the $i-1$th digit.
I'll leave the details of the proof to you.