Find the conditional expected number of rolls in the game of craps given that (a)the game does not end on the first roll; (b)the player wins,but not in the first roll
The game of craps is begun by rolling an ordinary pair of dice. If the sum of dice is 2,3 or 12,the player loses. If it is 7 or 11, the player wins. If it is any other number i, the player continues to roll the dice until the sum is either 7 or i. If it is 7,the player loses; if it is i, the player wins
ANS:
If we let $P_i$ denote the probability that the sum of the dice is i,then
$P_i=P_{14-i}=\frac{i-1}{36}$ where i=2,...,7
To compute E(R),condition on S,the initial sum.This gives
$$E(R)=\sum_{i=2}^{12}E[R|S=i]P_i$$ However, the game doesn't end on the first roll if the sum is a value i and dice will continue to be rolled until the sum is either i or 7 and the number of rolls until this occurs is a geometric random variable with parameter$P_i+P_7$
$E[R|S=i]=1+\frac1{P_i+P_7}$
$$E(R)=1+2\sum_{i=4}^{6}\frac{P_i}{P_i+P_7}=1+2\left(\frac39+\frac4{10}+\frac5{11}\right)=3.37575$$Now let us solve part(b) of this question
To determine E[R|win], we calculate p, the probability that the player wins.Given that S=i yields
$$p=\sum_{i=2}^{12}P[win|S=i]P_i =P_7+P_{11}+2\sum_{i=4}^{6}\frac{P_i^2}{P_i+P_7}=0.493$$
Now, we calculate conditional probability of S given that player wins Letting$Q_i$ =P[S=i|win], we get $Q_i=0,$ $i=2,3,12 $
$Q_7=\frac{P_7}{p}$
$Q_{11}=\frac{P_{11}}{p}$
$Q_i=\frac{P_i^2}{p(P_i+P_7)} i=4,5,6,8,9,10$
Hence
$$E[R|win]=\sum_i E[R|win,S=i]Q_i$$
$$=\sum_i E[R|S=i]Q_i$$
$$=1+2\sum_{i=4}^6 \frac{Q_i}{P_i+P_7}
=2.938$$
Define events:
\begin{eqnarray*} A &=& \text{First roll was neither win nor lose} \\ A_i &=& \text{First roll was $i,\;$ for}\; i=2,3,\ldots,12 \end{eqnarray*} and r.v.
$$R = \text{#rolls in the game}$$
and set
$$I=\{4,5,6,8,9,10\}.$$
(a) We want to find $E(R\mid A)$.
\begin{eqnarray*} E(R\mid A) &=& \sum_{i\in I}{E(R\mid A_i \cap A)P(A_i\mid A)} \qquad\text{by the Law of Total Expectation.} \\ &=& \sum_{i\in I}{E(R\mid A_i)P(A_i\mid A)} \qquad\qquad\qquad (1) \\ \end{eqnarray*}
Now we need some basic probabilities:
$$P(A) = P(\text{First roll is one of $4,5,6,8,9,10$}) = \dfrac{3+4+5+5+4+3}{36} = \dfrac{2}{3}.$$
For $i=2,\ldots,12$,
$$P(A_i) = \dfrac{6-\vert 7-i\vert}{36}.$$
Therefore, for $i\in I$,
$$P(A_i\mid A) = \dfrac{P(A_i\cap A)}{P(A)} = \dfrac{P(A_i)}{P(A)} = \dfrac{6-\vert 7-i\vert}{36}\bigg/ \dfrac{2}{3} = \dfrac{6-\vert 7-i\vert}{24}.$$
Next, for $i\in I$, and with the obvious notation for the result of the second roll,
\begin{eqnarray*} E(R\mid A_i) &=& E(R\mid 7\cap A_i)P(7\mid A_i) + E(R\mid i\cap A_i)P(i\mid A_i) \\ && \quad + E(R\mid (7\cup i)^c \cap A_i)(1 - P(7\mid A_i) - P(i\mid A_i)) \\ && \\ &=& 2P(A_7) + 2P(A_i) + (1+E(R\mid A_i))(1 - P(A_7) - P(A_i)) \\ && \\ (P(A_7) + P(A_i))E(R\mid A_i) &=& 1 + P(A_7) + P(A_i) \\ && \\ E(R\mid A_i) &=& \dfrac{1 + P(A_7) + P(A_i)}{P(A_7) + P(A_i)} \\ && \\ &=& \dfrac{1 + \dfrac{6}{36} + \dfrac{6-\vert 7-i\vert}{36}}{\dfrac{6}{36} + \dfrac{6-\vert 7-i\vert}{36}} \\ && \\ &=& \dfrac{48-\vert 7-i\vert}{12-\vert 7-i\vert}. \end{eqnarray*}
So, returning to Equation $(1)$, we have,
\begin{eqnarray*} E(R\mid A) &=& \sum_{i\in I}{\dfrac{48-\vert 7-i\vert}{12-\vert 7-i\vert} \cdot \dfrac{6-\vert 7-i\vert}{24}} \\ && \\ &=& 2\left( \dfrac{45}{9}\dfrac{3}{24} + \dfrac{46}{10}\dfrac{4}{24} + \dfrac{47}{11}\dfrac{5}{24} \right) \\ && \\ &=& \dfrac{251}{55} \approx 4.56. \\ \end{eqnarray*}
$$\\$$
(b) Now define event
$$B = \text{"The player wins but not on the first roll".}$$
So here we want $E(R\mid B)$. We use to a similar approach as in part (a).
\begin{eqnarray*} E(R\mid B) &=& \sum_{i\in I}{E(R\mid A_i \cap B)P(A_i\mid B)} \qquad\qquad\qquad (2) \\ \end{eqnarray*}
Now, for $i\in I$, and conditioning on the second roll,
\begin{eqnarray*} P(B\mid A_i) &=& P(B\mid i\cap A_i)P(i\mid A_i) + P(B\mid 7\cap A_i)P(7\mid A_i) \\ && \quad + P(B\mid (i\cup 7)^c \cap A_i)(1 - P(i\mid A_i) - P(7\mid A_i)) \\ && \\ &=& 1\cdot P(A_i) + 0 + P(B\mid A_i)(1-P(A_i)-P(A_7)) \\ && \\ \therefore\quad P(B\mid A_i) &=& \dfrac{P(A_i)}{P(A_i)+P(A_7)} \\ && \\ &=& \dfrac{6 - \vert 7-i \vert}{12 - \vert 7-i \vert}. \\ && \\ \therefore\quad P(A_i\mid B) &=& \dfrac{P(B\mid A_i)P(A_i)}{\sum_{j\in I}{P(B\mid A_j)P(A_j)}} \qquad\text{ by Bayes' Theorem} \\ && \\ &=& \dfrac{\dfrac{6 - \vert 7-i \vert}{12 - \vert 7-i \vert} \cdot \dfrac{6 - \vert 7-i \vert}{36}}{\sum_{j\in I}{\dfrac{6 - \vert 7-j \vert}{12 - \vert 7-j \vert} \cdot \dfrac{6 - \vert 7-j \vert}{36}}} \\ && \\ &=& \dfrac{(6 - \vert 7-i \vert)^2\bigg/ (12 - \vert 7-i \vert)}{\sum_{j\in I}{(6 - \vert 7-j \vert)^2\bigg/ (12 - \vert 7-j \vert)}} \\ && \\ &=& \dfrac{55(6 - \vert 7-i \vert)^2}{536(12 - \vert 7-i \vert)} \qquad\qquad\text{by evaluating the sum.} \\ && \\ \end{eqnarray*}
Next, we find $E(R\mid A_i\cap B)$, again conditioning on the second roll,
\begin{eqnarray*} E(R\mid A_i\cap B) &=& E(R\mid i\cap A_i\cap B)P(i\mid A_i\cap B) + E(R\mid 7\cap A_i\cap B)P(7\mid A_i\cap B) + E(R\mid (i\cup 7)^c \cap A_i\cap B)(1 - P(i\mid A_i\cap B) - P(7\mid A_i\cap B)) \\ && \\ &=& 2P(i\mid A_i\cap B) + 0 + (1 + E(R\mid A_i\cap B))(1 - P(i\mid A_i\cap B)) \\ && \\ \therefore\quad E(R\mid A_i\cap B) &=& \dfrac{1 + P(i\mid A_i\cap B)}{P(i\mid A_i\cap B)} \qquad\qquad\qquad (3) \\ && \\ \text{For $i\in I,\;\;$} P(i\mid A_i\cap B) &=& \dfrac{P(i\cap A_i\cap B)}{P(A_i\cap B)} = \dfrac{P(i\cap A_i)}{P(A_i\cap B)} = \dfrac{P(A_i)^2}{P(B\mid A_i)P(A_i)} = \dfrac{P(A_i)}{P(B\mid A_i)} \\ && \\ &=& \dfrac{6 - \vert 7-i\vert}{36} \bigg/ \dfrac{6 - \vert 7-i\vert}{12 - \vert 7-i\vert} = \dfrac{12 - \vert 7-i\vert}{36}. && \\ && \\ \therefore\quad\text{From $(3)$ we have,}\quad E(R\mid A_i\cap B) &=& \dfrac{1 + \dfrac{12 - \vert 7-i\vert}{36}}{\dfrac{12 - \vert 7-i\vert}{36}} \\ && \\ &=& \dfrac{48 - \vert 7-i\vert}{12 - \vert 7-i\vert}. \end{eqnarray*}
So, returning to Equation $(2)$, we have
\begin{eqnarray*} E(R\mid B) &=& \dfrac{55}{536} \sum_{i\in I}{\dfrac{(48 - \vert 7-i\vert) (6 - \vert 7-i\vert)^2}{(12 - \vert 7-i\vert)^2}} \\ && \\ &=& \dfrac{55}{268} \left( \dfrac{45\cdot 9}{81} + \dfrac{46\cdot 16}{100} + \dfrac{47\cdot 25}{121} \right) \\ && \\ &=& \dfrac{16691}{3685} \approx 4.53. \end{eqnarray*}