A maximal run of ones in a bitstring is a maximal consecutive substring of ones. For example, the bitstring $1000111110100111$ has four maximal runs of ones: $1, 11111, 1,$ and $111$.
Let n>=1 be an integer and consider a random bitstring of length n.
Determine the random variable X to be the number of maximal runs of ones
in this bitstring.
Determine the expected value E(X) of X. (Hint: Use indicator random variables)
What I have done so far is let $S = (s_1, s_2, \ldots s_n)$ to be sequence of random bitstrings of length $n$ and defined an indicator random variable:
$X_i = 1$ if a subsequence of S is a run of ones and $X_i = 0$ otherwise
but I don't know how to continue from here. I would like to get some help of how I should go from there or any ideas on how to solve the question.
Thanks.
I do not know if it is what was intended, but you could have your indicator registering if the $n-1^\text{th}$ bit is $0$ and the $n^\text{th}$ bit is $1$.
You may need to take the unseen bit before the first to be $0$.
Then use linearity of expectation.