I have this experiment,
- Throw a six-sided dice until you get N times one number, let's say 5 for example.
Now, the main question is, what's the variance of the number of times that another number, 6 for example, appears.
Any help is welcome!
I have this experiment,
Now, the main question is, what's the variance of the number of times that another number, 6 for example, appears.
Any help is welcome!
Just to be specific let's say that the "ending number" was $5$ and that the number you are counting is $6$.
Method I (direct): Let $p_n$ denote the probability that you observe exactly $n$ occurrence of $6$ before you stop. Considering the possible consequences of the first toss we obtain the recurrence: $$p_n=\frac 16\times p_{n-1}+\frac 16 \times 0+\frac 46 \times p_n\implies p_n=\frac 12 p_{n-1}$$ We remark that $$\sum_{0}^{\infty}p_n=1 \implies p_0 \sum_{0}^{\infty}\frac 1{2^n}=1\implies p_0=\frac 12$$ Thus we get $$p_n=\frac 1{2^{n+1}}$$
Sanity Check: by symmetry, there is a $\frac 12$ chance that we see $5$ before we see $6$, so $p_0=\frac 12$ as calculated.
It is easy now to compute the mean, $$\mu=\sum_{0}^{\infty}n p_n = 1$$ (Note: this too was easy to compute directly).
To conclude we simply compute the variance directly $$\sum_{0}^{\infty} (n-1)^2\frac 1{2^{n+1}}=\fbox 2$$
Method II (Geometric Distribution):
Note that the only relevant tosses are $5,6$...we can ignore all the others. As these two tosses are equally probable, the problem is equivalent to asking "what is the variance of the number of Heads you toss before you get a Tails?". Thus, this is just the variance of the standard geometric distribution with $p=\frac 12$ and it is well known that this is $\frac {1-p}{p^2}$, or $2$ in this case.