The problem statement says:
An urn contains balls numbered 1, 2, 3. First a ball is drawn from the urn, and then a fair coin is tossed the number of times as the number shown on the drawn ball. Fin the expected number of heads.
Now, what I have done so far is calculate the p.d.f for the problem as follows:
$H= $The drawn of head in all tosses of the coin
$P(X=1|H) = \frac{\text{# Of favorable cases}}{\text{# Of all cases}} = \frac{1}{3}*\frac{1}{2} = \frac{1}{6}$
$P(X=2|H) = \frac{1}{3}*\frac{1}{4} = \frac{1}{12}$
$P(X = 3 |H) = \frac{1}{3} * \frac{1}{8} = \frac{1}{24}$
Then I use the general formula for the Expected value in a discrete :
$\sum_{k = 1}^3{k*p(k)}=1*\frac{1}{6}+ 2*\frac{1}{12} + 3*\frac{1}{24} = \frac{1}{6} + \frac{1}{6} + \frac{1}{8} = \frac{11}{24}$
Now, this doesn't seem right to me, but I don't know why, I want to know what I'm doing wrong if I'm doing something wrong at all.
First of all you have to calculate the probability to obtain once head for instance:
$N:=$ Ball with number N has been drawn, $H:=$ H is the number of heads
Law of total probabilty
$P(H=1)=P(H=1|N=1)\cdot P(N=1)+P(H=1|N=2)\cdot P(N=2)+P(H=1|N=3)\cdot P(N=3)$
$=\frac{1}{2}\cdot \frac{1}{3}+\frac{2}{4}\cdot \frac{1}{3}+\frac{3}{8}\cdot \frac{1}{3}$
It might be helpful to know that in general $P(H=k|N=n)=\binom{n}{k}\cdot 0.5^n$
You calculate $P(H=2)$ and $P(H=3)$ in the same way. Finally you calculate the expected value. This is indeed
$$E(H)=\sum_{k=1}^3 k\cdot P(H=k)$$