# Geometric distribution, tossing a die [duplicate]

Possible Duplicate:
geometric distribution throwing a die

Yesterday I posted a question which was answered but I disagree with the answer so I'd like to ask again so we can discuss it together :)

The problem says as follows: We throw a die repeatedly. X and Y denote, respectively, the number of rolls until we reach a 5 and 6 . The aim is to compute $E[X|Y=5]$.

First question: If Y=5 (this means no 6 have come up in the first 4 rolls) then the probability of getting 5 in those rolls should be 1/5 instead of 1/6?

I have done some simulations to guess the expected number of rolls and I get always something around 5.8 which seems reasonable but I can't arrive to that answer algebraically or analitically.

Thanks a lot for you help! :)

-

## marked as duplicate by Stefan Hansen, Did, Hagen von Eitzen, Sasha, rschwiebJan 16 '13 at 21:53

If $Y$ is the number of rolls until we get a $6$, then $Y=6$ means that there is no $6$ in the first $5$ rolls, and it says nothing about whether there were any $5$’s. –  Brian M. Scott Jan 16 '13 at 20:59
Sorry there are mistypes... where it says "Y=6" it should say "Y=5" –  Daniel Jan 16 '13 at 21:01
But it still means that there is no $6$ in the first $4$ rolls, not that there is no $5$. –  Brian M. Scott Jan 16 '13 at 21:03
It's generally a really bad idea to repost a question. There are a lot of really smart people here, and you essentially have hidden all the work that other people have done to both attempt to understand your problem (since we are right now trying to figure out what you actually mean) and to help you answer it. –  Thomas Andrews Jan 16 '13 at 21:05
It would be helpful to link the questions (and hence the two different accounts you must have created). Thomas is quite correct in that by hiding the link between the two questions, you are creating a substantial amount more work for everyone (including yourself). Disagreeing with or not understanding given answers is fine, but questions should be asked at your original question. As a parenthetical side note, Einstein had a word for those who performed the same task over again and expected different results. Surely, you must realize that the answers given here are not random, right? –  JavaMan Jan 16 '13 at 21:10

If you know that $Y=5$, then you know that you did not roll a $6$ on any of the first four rolls. Thus, $X=1$ with probability $\frac15$, $X=2$ with probability $\frac45\cdot\frac15$, $X=3$ with probability $\left(\frac45\right)^2\cdot\frac15$, and $X=4$ with probability $\left(\frac45\right)^3\frac15$. Clearly the probability that $X=5$ is $0$. For $n>5$ the probability that $X=n$ is $\left(\frac45\right)^4\left(\frac56\right)^{n-6}\cdot\frac16$. Thus,

\begin{align*} \Bbb E[X\mid Y=5]&=\sum_{k=1}^4k\left(\frac45\right)^{k-1}\frac15+\left(\frac45\right)^4\sum_{k\ge 6}k\left(\frac56\right)^{k-6}\frac16\\\\ &=\frac15\sum_{k=1}^4k\left(\frac45\right)^{k-1}+\frac16\left(\frac45\right)^4\sum_{k\ge 0}(k+6)\left(\frac56\right)^k\\\\ &=\frac15\sum_{k=1}^4k\left(\frac45\right)^{k-1}+\left(\frac45\right)^4\sum_{k\ge 0}\left(\frac56\right)^k+\frac16\left(\frac45\right)^4\sum_{k\ge 1}k\left(\frac56\right)^k\\\\ &=1.3136+\frac{0.4096}{1-5/6}+\frac16\left(\frac45\right)^4\left(\frac56\right)\sum_{k\ge 1}k\left(\frac56\right)^{k-1}\\\\ &=3.7712+\frac{256}{36\cdot125}\frac1{\left(1-\frac56\right)^2}\\\\ &=3.7712+\frac{256}{125}\\\\ &=5.8192\;. \end{align*}

-
Looks very much like what I computed but must have done some mistake computing the geometric sums.. but now we got two different answers :P –  Daniel Jan 16 '13 at 21:18
@Daniel: Yes, there’s a mistake; I just caught it and am in the process of fixing it. –  Brian M. Scott Jan 16 '13 at 21:20
The second sum should be $(\frac {5}{6}) ^{k-6} \times (\frac {4}{5} )^5 \times \frac {1}{6}$ –  Calvin Lin Jan 16 '13 at 21:20
Ah! but then is exactly what I had.. strange because I think the whole sum does not give 1 (which should since it's a prob distribution) –  Daniel Jan 16 '13 at 21:25
@Calvin: I realized that almost as soon as I’d posted, but I think that your exponent of $5$ should be $4$. –  Brian M. Scott Jan 16 '13 at 21:29

Yes, if the only information we have about a roll of a die is that we did not get a $6$, then the probability we got a $5$ is $\frac{1}{5}$. For given only that we did not get a $6$, the numbers $1$ through $5$ are equally likely.

One sloppy but intuitive argument goes as follows. Suppose we toss the die $6000$ times. Then we will get roughly $1000$ of each number. (More precisely, the proportion of each is very likely to be close to $\frac{1}{6}$.)

Now concentrate attention on the about $5000$ times we did not get a $6$. About $1000$ of these times, we got a $5$, so the probability we got a $5$ given we did not get a $6$ is $\frac{1}{5}$.

-
I see. How would the conditional expectation be computed then? –  Daniel Jan 16 '13 at 21:06
Yesterday I saw the answer to your previous question. The explanation there was good. –  André Nicolas Jan 16 '13 at 21:09
You think? but the result is far from what I get from my simulations.. –  Daniel Jan 16 '13 at 21:10
Simulations for waiting time can be a little tricky, tails can be long, and mean is strongly affected by them. But nowadays computation is cheap, and a few million iterations should give very reliable results for the conditional expectation. –  André Nicolas Jan 16 '13 at 21:17
@AndréNicolas I wrote the solution yesterday and it was wrong. Have since edited it, because I didn't properly take the $Y=5$ into actual consideration. –  Calvin Lin Jan 16 '13 at 21:38

You can proceed in a straightforward manner:

$$\tag{1}\Bbb E(X|Y=5)=\sum\limits_{i=1}^5 i\cdot P[X=i|Y=5]+E(X|Y=5, X> 5)P[X>5|Y=5].$$

We have \eqalign{ \sum\limits_{i=1}^5 i\cdot P[X=i|Y=5] &=(1/5)\cdot 1+ (4/5)(1/5)\cdot 2+(4/5)^2(1/5)\cdot 3+(4/5)^3(1/5)\cdot 4+0\cr &=\textstyle{821\over625}.} and, noting that if both $Y=5$ and $X>5$, it's as if we "started over" $$E(X|Y=5, X> 5)= (\Bbb E(X)+5)=6+5= 11.$$

Computing the required sum $(1)$, using $P[X>5|Y=5]=(4/5)^4$, we obtain
$$\Bbb E(X|Y=5) =\textstyle{821\over625}+(4/5)^4\cdot11 \approx 5.8192.$$

-
I did it in the same manner as you (with the same result). –  Calvin Lin Jan 16 '13 at 21:36