20

A fair 6-sided die is rolled repeatedly in till a 6 is obtained. Find the expected number of rolls conditioned on the event that none of the rolls yielded an odd number

I had tried to figure out what will be the conditional distribution of $\frac{X}{Y}$ but I can't solved it yet Where $X $ is the face numbered 6 is obtained and $Y$ is the event only even number is occured

user561527
  • 393
  • 1
  • 2
  • 7

4 Answers4

14

Call $E_k$ the event "the first $k-1$ throws gave even results", and call $E$ the event "the first $6$ exists and is preceded by even numbers only".

I'll skip the clever answer from Mike Earnest's link and try to give an understandable scholar way.

The definition of a conditional expectation is $$\Bbb E(X|E)=\sum_{k=1}^\infty k\cdot\Bbb P(X=k\ |\ E)$$

Now $$\Bbb P(X=k\ |\ E)=\frac{\Bbb P((X=k)\cap E)}{\Bbb P(E)}$$ Note that the event $(X=k)\cap E$ is equal to the event $(X=k)\cap E_k$. $$\Bbb P((X=k)\cap E_k)=\left(\frac26\right)^{k-1}\cdot \frac16$$ as you have to independently get $2$s or $4$s at each of the $k-1$ first throws, and then get a $6$.

On the other hand, \begin{align*}\Bbb P(E)&=\sum_{k=1}^\infty \Bbb P(E\cap(X=k))\\&=\sum_{k=1}^\infty \left(\frac26\right)^{k-1}\cdot \frac16\\&=\frac16\cdot \frac{1}{1-\frac26}\\&=\frac14\end{align*}

Putting it all together: \begin{align*}\Bbb E(X|E)&=\sum_{k=1}^\infty k\cdot4\cdot \left(\frac26\right)^{k-1}\cdot \frac16\\&= \frac46 f'\left(\frac26\right)\\\end{align*} where $$f(x)=\sum_{k=0}^\infty x^k=\frac 1{1-x}\qquad\text{and}\qquad f'(x)=\sum_{k=1}^\infty k\cdot x^{k-1}=\frac 1{(1-x)^2}$$

Finally $$\Bbb E(X|E)=\frac23\cdot \frac1{\left(1-\frac26\right)^2}=\frac32.$$

10

We are throwing a die until we obtain neither $2$ nor $4$. The expected number of throws then is ${3\over2}$, by the formulas for a geometric random variable. If the closing throw is $1$, $3$, or $5$, we don't count the experiment and start afresh. If the closing throw is a six it's a success.

  • 1
    Could you give a bit more details on how you get $3\over 2$? The exponential distribution belongs to a continuous framework, so I guess that is not exactly what you meant? – Arnaud Mortier May 13 '18 at 21:36
  • 1
    @ArnaudMortier $\frac32$ is the reciprocal of $\frac46=\frac{|{1,3,5,6}|}{|{1,2,3,4,5,6}|}$ – Henry Jul 24 '23 at 17:40
  • How is the solution to this question (reworded as) "What is the expected number of times you can roll only 2 and 4's until you roll any other number given that number is a 6?" different than saying "What is the expected number of times you can roll only 2 and 4's until you roll any other number?" Saying we are throwing a die until we obtain neither 2 nor 4 makes me think that we are ignoring the condition about the 6. – user2330624 Jun 23 '24 at 14:26
4

First a way to make things more clear.

Keep throwing a fair die again and again resulting in an endless string like $$32464344162634521466326...$$

Now have a look at the substrings that end with a $6$, do not contain another $6$, contain only even digits and are of maximal length.

That gives in my example the substrings $246$, $6$, $26$, $46$, $6$, $26$.

Now the question can be interpreted as:

What is the average length of substrings like these?

Finding this comes to the same as finding the expectation of the number of throws needed to arrive at $1,3,5$ or $6$.

If we denote that expectation by $\mu$ then we have the equality:$$\mu=\frac23\cdot1+\frac13(1+\mu)=1+\frac13\mu$$or equivalently: $$\mu=\frac32$$


P.S.

When I saw this problem for the first time (in a question that is now marked as a duplicate of this question) I was completely wrong in my thinking and the answer based on my intuition was $3$.

drhab
  • 153,781
  • Why are you saying that the real expectation (with strings ending in 6 only) is same as finding the expectation of the number of throws needed to arrive at 1,3,5  or 6? – Prof. Shanku Aug 09 '19 at 03:25
  • 1
    @Prof.Shanku Well, you can split the strings in "successes" (i.e. ending on $6$) and "failures" (i.e. ending at $1$, $3$ or $5$) and then focus on successes (see the answer of Christian). But if it comes to expectation of length this focus is not needed. This because the expectation of length of failures ending (e.g. on $1$) is the same is the expectation of length of successes ending on $6$. – drhab Aug 09 '19 at 06:43
  • Why is it not $\mu = \frac{1}{3} \cdot 1 + \frac{2}{3}(1+ \mu)$? You stop when you role a six which is 1 of the 3 even numbers. – user2330624 Apr 07 '24 at 23:09
  • 1
    @user2330624 That would be the answer if the dice only had three sides, or if you failed to count the other three sides when they appear. But here you would have to ignore the whole sequence, and that gives a different answer. – Henry Apr 07 '24 at 23:27
  • I think I am not understanding the conditional probability... What exactly does it mean when we say given you only rolled even numbers? – user2330624 Apr 08 '24 at 01:36
  • @user2330624 It is well-formulated in the question. If $X$ denotes the number of trials needed to arrive at a six and $A$ is the event that the first $X$ trials only result in even numbers then to be found is $\mathbb E[X|A]=\mathbb EX1_A/P(A)$. This is exactly what you meet in the answer of Henry. – drhab Apr 08 '24 at 07:04
  • What is confusing to me is that $E = 2/3(1) + 1/3(E+1)$. The 2/3 is the probability that you role a 1,3,5,6. But why are we including 1,3,5 because we ignore sequences that don't start with an even number and end with a 6. – user2330624 Apr 10 '24 at 22:56
  • @user2330624 For this see my comment on the comment of Prof.Shanku. – drhab Apr 11 '24 at 07:07
2

The probability of rolling a 6 is $\frac16$ and of a 2 or 4 is $\frac26$.

The conditional expectation is therefore $$\dfrac{1\times \frac16+2 \times \frac16\left(\frac26\right)^1 +3 \times \frac16\left(\frac26\right)^2+4 \times \frac16\left(\frac26\right)^3+\cdots }{\frac16+\frac16\left(\frac26\right)^1 +\frac16\left(\frac26\right)^2+\frac16\left(\frac26\right)^3+\cdots} =\dfrac{\frac38}{\frac14}=\dfrac{3}{2}.$$

Henry
  • 169,616