Suppose I have a binary string of an arbitrary length. How many times could the string "0 1 0" appear in the larger string? I have the following hypothesis:
For a string with an odd number of characters, the maximum possible number of appearance of "0 1 0" is equal to $\lfloor\frac{n}{2}\rfloor$.
For a string with an even number of characters, it is $\frac{n}{2} - 1$
Is this correct? What is the intuition behind this? (I don't need an entire formal proof but would still like a good way of thinking about this problem.) I am a bit confused because appearances of "0 1 0" can "overlap" (e.g. "0 1 0 1 0").
For intuition, the shortest string that includes $k$ copies of $010$ is $01010101010\ldots $ with $k\ 1$'s and $2k+1$ characters. This supports your two conclusions. You can unite them to say it is $\lfloor \frac {n-1}2 \rfloor$