1

I need help with a question in my statistics book:

Given a positive integer $n$. We want to form an $n$-bit string. Each bit is independently assigned as a $0$ or $1$ (each with probability $0.5$). Find the expected value of the longest sub-string of $1$'s.

I know how to calculate expected values however in this context I'm so confused that I have no idea how to even begin. How do we go about this?

Any help is very much appreciated. Thank you.

StubbornAtom
  • 17,932
user930
  • 11
  • 2
  • Is this really an exercise in a stats book? It strikes me as a potentially difficult combinatorial counting problem. A suggestion: Compute the expected value for the first several values of $n$, and look up the numerators (using $2^n$ as denominator) at https://oeis.org . – Barry Cipra Aug 03 '20 at 17:48
  • @BarryCipra yes it's a book exercise marked with a star, which indicates a "challenging exercise". Anyhow, let's say we want to compute the value for $n = 5$, how do we do it? – user930 Aug 03 '20 at 17:54
  • For small $n$ you can compute it by hand easily enough. Just try it. – lulu Aug 03 '20 at 17:58
  • @lulu how do we do it for $n=1000$? – user930 Aug 03 '20 at 18:00
  • First try to compute it for small $n$, see if you see a pattern emerging. – lulu Aug 03 '20 at 18:01
  • here is a duplicate and here is a generalization which allows for a bias towards $0$ or $1$. – lulu Aug 03 '20 at 18:05
  • @lulu I don't know if I'm doing this right, but like for $n=2$, the possible strings are $00, 01, 10,$ and $11$. So what is the expected value in this case? Using the formula $E(x) = \sum x \cdot p(x)$ I get 1/4. – user930 Aug 03 '20 at 18:10
  • For $n=2$: The probability of getting a max of $1$ is $\frac 12$, the probability of getting a max of $2$ is $\frac 14$ so the answer is $0+\frac 12\times 1 +\frac 14\times 2=1$. – lulu Aug 03 '20 at 18:12
  • Note: from the duplicates I linked to, you should see that there isn't a pleasant closed form for the general problem. The second link provides a full solution to the general problem, but it involves a rather gruesome sum. But, as I said, it's easy enough for small $n$. – lulu Aug 03 '20 at 18:13
  • Oh I see. Thank you so much lulu, You've been really helpful. – user930 Aug 03 '20 at 18:13

0 Answers0