There is a line of ones and zeroes of length $n$. Every second, $10$ changes to $01$. Prove that it takes no longer than $10n$ seconds until there is nothing to change in the line.
Example:
- 1110010
- 1101001
- 1010101
- 0101011
- 0010111
- 0001111
My reasoning went like this:
- base case: obvious (for $0$ and $1$, there's nothing to change from the start);
- hypothesis: let's assume the statement is true for a line of length $n$;
- step: what can we say about a line of length $n+1$, then? Let's note that a line of length $n+1$ is just a line of length $n$ from the hypothesis with a $1$ or a $0$ added to it (let's say at the right).
If (line of length $n$)$1$, then $1$ stays intact, and we can apply the hypothesis.
If (line of length $n$ ending with $1$)$0$, then it changes to (line of length $n$)$1$, and our time becomes $10n+1$ at most.
However, if (line of length $n$ ending with $0$)$0$, I don't know how to see the following: that, at the last second of $10n$, it's not possible for the before-last $0$ in the line to change to $1$ and start a chain reaction inside the subline of length $n$, giving us $10n+10n=20n>10(n+1)=10n+10$ seconds of time.
While my book suggests induction for this problem, I am interested in and will be grateful for any proof, no matter inductive or not.
Thank you.