Question: An urn contains three balls. The number of red balls in the urn is $0,1,2$ or $3$ equally likely. A ball is drawn from the urn at random. Given that the ball drawn is red, what is the conditional expected number of red balls left in the urn?
Comment: Poorly worded question, but with it were two equations for utilization:
- Conditional expectation. $E(X\mid Y=y)$ denotes the conditional expectation of $X$ given $Y=y$
- Law of Iterated Expectations. $E(X\mid Y=y)Py(y)$
Thank you!!
You seek $\mathsf E(X\mid Y=1)$, where $X$ is the count of red balls put into the urn, and $Y$ is the indicator that the ball drawn out was red.
You know what, for any $k\in\{0,1,2,3\}$ are $\mathsf P(X=k)$ and $\mathsf P(Y=1\mid X=k)$. The probability that $k$ balls were put in the urn, and the probability that a red ball was extracted given that there were $k$ balls in the urn.
$$\begin{split}\mathsf P(X=k)&~=~\tfrac 14\mathbf 1_{x\in\{0,1,2,3\}}\\ \mathsf P(Y=1\mid X=k)&~=~\tfrac k3\mathbf 1_{k\in\{0,1,2,3\}}\end{split} $$
So you can find out $\mathsf P(Y=1,X=k)$, $\mathsf P(Y=1)$, and hence $\mathsf P(X=k\mid Y=1)$.
$$\begin{split}\mathsf P(Y=1,X=k)&~=~\phantom{\tfrac k{12}\mathbf 1_{k\in\{0,1,2,3\}}}\\\mathsf P(Y=1)&~=~\phantom{\tfrac 12}\\ \mathsf P(X=k\mid Y=1)&~=~\phantom{\tfrac k6\mathbf 1_{k\in\{0,1,2,3\}}}\end{split}$$
From which finding what is $\mathsf E(X\mid Y=1)$, is easy.
$$\mathsf E(X\mid Y=1)~=~\phantom{\tfrac 73}$$