# Conditional Expected value of number of rolls in a die

A die is rolled repeatily. Let $X$ be the random variable that denotes the number of rolls to get a 4 and $Y$ be the random variable that denotes the number of rolls to get a 1. What is $E[X|Y=7]? My thoughts were$\dfrac{1}{\dfrac{1}{6}} + 7$since the expected value for rolling a 4 is 6 and we are given that we rolled 7 times (but we know on the 7th roll we did not get a 4)) but I know the answer is not right. Since we must factor in the probabilites of rolling a 4 in the first 6 rolls. How do I do this? • Is$X$the number of rolls needed to obtain a 4? similarly, for$Y$? – Nana Dec 18 '13 at 6:20 • ahhh yes I misworded – adam Dec 18 '13 at 6:23 ## 3 Answers Hint: Note that$X$is a geometric random variable.$Y=7$implies that rolls one through to 6 was not a$1$. So we can consider two cases:$X \le 6$and$X\gt 7By definition \begin{align*} E(X \, | \, Y = 7) & = \sum_{k=1}^{\infty} \, k \,P(X = k \, | \, Y = 7)\\ & = E(X \, | \, Y = 7, X\lt 7) \cdot P(X \le 6 \, | \, Y = 7) \\ &\,\,\,\,\,\,\,\,\,\,\,+ E(X \, | \, Y = 7, X\gt 7) \cdot P(X \gt 7 \, | \, Y = 7) \end{align*} Can you take it from here? • is this bayes theorem or what is this – adam Dec 18 '13 at 7:31 • I just want to know what property we used to come to this conclusion need a little more explanation as to how you come to this equation. I get that you need to consider the two cases. But the means on how you consider them is confusing – adam Dec 18 '13 at 7:44 • @adam: I used the so called partition theorem which says that ifA_n$is a partition of a sample space the$E(Z) = \sum_{n}E(Z|A_n)P(A_n) $for a random variable$Z$. – Nana Dec 18 '13 at 7:57 • ahhh ok thanks. And the commas in the equation? what do they represent? the constraints on$X$how would I read this in plain english – adam Dec 18 '13 at 8:09 • the stuff after the comma, represent another conditioning term. you'd read it in the usual way; e.g. expectation of x given that y=7 and x is less the 7...etc – Nana Dec 18 '13 at 8:53 Your figure of$6+7$is the expected number given that there is no$1$in the first seven rolls. The probability of this given the seventh roll is a$4$and the previous rolls are not$4$is$\left(\frac45\right)^6$. You also need to consider the possibility that earlier rolls are$1$. So I suspect the answer is $$13 \times \left(\frac45\right)^6+1\times \frac{1}{5}+2\times \frac{4^1}{5^2}+3\times \frac{4^2}{5^3}+4\times \frac{4^3}{5^4}+5\times \frac{4^4}{5^5}+6\times \frac{4^5}{5^6}$$ • does this include for the case that$X>7$? So I need to consider the case in which one of these rolls is a 1 and the other case that none of these rolls are a 1. But why 13 though? – adam Dec 18 '13 at 7:54 • Your$\dfrac{1}{\tfrac{1}{6}} + 7 =13 = E[X|X\gt 7]$– Henry Dec 18 '13 at 7:56 • ahhhh I see because If we didn't roll a 1 in 7 rolls than those rolls are "wasted" thus we just add$E[X]$to however many times we rolled. I find nana's answer a little complicated im not sure what intution she used though I would like to know the theoretical way of seeing this problem so I may generalize it to$k$rolls – adam Dec 18 '13 at 8:05 • looking at your geometric sum is there a better way to express it? The series is arithmetic but at the same time geometric. Or do I have to use brute force – adam Dec 18 '13 at 8:30 • @adam: here it is easier to do the calculation. In general consider the derivative of a geometric series$a+ax+ax^2+ax^3+\cdots$– Henry Dec 18 '13 at 8:33 Rolling a die is a statistically independent event. The odds of getting any number from$1$to$6$is always$1/6$. And the expected value is always$3.5\$.

But I think that is not what you are asking. I don't understand your question.

• I thought the same way but we rolled 7 times but we do not know anything about the other 6 rolls. They have probabilites that have not been factored. – adam Dec 18 '13 at 6:05