The question goes as follows:
Let there be a random digit generator, generating the numbers $0,1,2,...,9$ uniformly and independently. The generator writes the numbers from left to right.
a) What is the expected value for the number of different digits appearing between two zeroes?
b) What is the distribution of the number of times the number $0$ appeared between two appearances of $9$?
c) Assuming the first digit is 8. What is the expected value of the number made up from the first four digits?
Well, 'c' was pretty simple, and is just $8000 + 4.5*100 + 4.5*10 + 4.5*1 = 8499.5$, since the expectation of the digit generated is $4.5$ and they are independent.
I had problems with solving 'a' and 'b', and would be happy to see both rigorous approach and simple approach if there are.
Thanks.
For a, the probability that a $1$ comes up between two zeros is $\frac 12$ because it just comes down to which comes first, the next $1$ or the next $0$. Make an indicator variable of the fact that a $1$ is there. Its expected value is $\frac 12$. By linearity of expectation, the expected number of different digits between two zeros is $9 \cdot \frac 12=4.5$
For b, the chance we have no zeros is $\frac 12$ because a $9$ has to come before the next zero. Once that $0$ comes, it is again $\frac 12$ that the next $0$ comes before the next $9$, so the chance of $n$ zeros is $\frac 1{2^{n+1}}$