In a string like "00110101010000111001111011111000" I'm reliably informed that the number of intervals containing consecutive zeros and consecutive ones can only differ by 1. It kind of makes sense, but I'm having trouble seeing why it is true.
Can anyone please provide a proof?
This is what I've got so far:
Suppose we start with 0. Then either the string ends before a 1 is reached and the conditions holds, or a new interval begins consisting of ones. Either this new interval consisting of ones is the final interval, so the condition holds, or there is a new interval consisting of zeros...
Is this just ridiculously simple or do I need to use some tool like proof by induction?