Probability of selecting a white ball The  $i$th  box  contains  $2i$  white  balls  and $6-2i$  black  balls,  $i\in \{1,2,3\}$.A  fair  die  is cast  once.  $3$  balls  are  taken  at  random from  box  $1$,  box  $2$  or  box  $3$  according  as the  die  shows  up  face  $1$ ,  any  of  $2$  and  $3$, or  any  of  $4$, $5$  and  $6$,  respectively.  Let  $X$ denote  the  number  of white  balls  drawn. Find  $E(X)$. 
My approach was to to divide the random variable into three parts.
First was if box $1$ was selected then $X$ can take values $0,1,2$
If box $2$ is chosen then $X$ can take values $1,2,3$
If box $3$ is chosen then X can take value only $3$
Calculating each probability for each case then using $$E(X_1)=(1P(X_1=1)+2P(X_1=2))\frac {1}{6}=\frac {1}{6}$$
$$E(X_2)=(1P (X_2=1)+2P (X_2=2)+3P (X_2=3))\frac {1}{3}=\frac {2}{3}$$
$$E(X_3)=(3P(X_3=3))\frac {1}{2}=\frac {3}{2}$$
Hence $E(X)=E(X_1)+E(X_2)+E(X_3)$
I got the answer as $\frac 73$
Is it correct ? If not please help
 A: Fundamentally the thinking is right, and the numerical answer is correct. The notation is not so good. One should explicitly condition on which box we drew from. 
Let random variable $Y_1$ be the number of whites given we draw from Box 1. Define  $Y_2$ and $Y_3$ analogously. Then
$$E(X)=\frac{1}{6}E(Y_1)+\frac{2}{6}E(Y_2)+\frac{3}{6}E(Y_3)$$
Now we compute $E(Y_1)$.  There are $\binom{6}{3}$ equally likely ways to draw three balls. The probability that $Y=0$ is irrelevant for the expectation. We have $\Pr(Y_1=1)=\frac{\binom{2}{1}\binom{4}{2}}{\binom{6}{3}}=\frac{12}{20}$ and $\Pr(Y_1=2)=\frac{\binom{2}{2}\binom{4}{1}}{\binom{6}{3}}=\frac{4}{20}$, so $E(Y_1)=1$. 
A similar calculation shows that $E(Y_2)=2$, and trivially $E(Y_3)=3$. 
A: A couple of points:
First, the answer by André Nicolas is the way I would expect this problem to be solved (and I would expect his answer to be the accepted one). If you take that approach, problems like this are not too hard to do, and you will have a relatively easy time justifying your answer to anyone else.
Second, if you do want to organize the calculations as in the question,
it would pay to try to be a bit more consistent in the notation,
and it would be very important to explain clearly what you mean by it.
You can define $X_i$ as the number of white balls extract from box $i$
during the entire course of the exercise,
so that (for example) $X_3 = 3$ if box $3$ is selected,
but $X_3=0$ if another box is selected.
Then the total number of white balls drawn from all boxes is
$X = X_1 + X_2 + X_3$ (where at most one of the $X_i$ can be non-zero), 
and by linearity of expectation, you can say that
$$ E(X) = E(X_1) + E(X_2) + E(X_3).$$
So far, the notation in the question is fine, though perhaps lacking
explanation.
Now we come to the part where the notation in the question seems somewhat
inconsistent.  You say that $P(X_1=2) = \frac 15$, where $\frac15$ is the correct probability that you pull exactly two white balls from box $1$
given that you pull three balls from box $1$.
At the start of the exercise, the prior probability that $X_1=2$ is
actually $\frac 15 \times \frac16 = \frac{1}{30}$.
But you (wisely) would prefer to do the multiplication by $\frac 16$
later rather than sooner. A way to do this is to let $B_i$ be the event
that you pull three balls from box $i$, so that you can write
\begin{align}
E(X_1)
 &= E(X_1\mid B_1)P(B_1) + E(X_1\mid B_2)P(B_2) + E(X_1\mid B_3)P(B_3)\tag1\\
 &= (1\cdot P(X_1 = 1\mid B_1) + 2\cdot P(X_1 = 2\mid B_1))P(B_1) \tag2\\
 &= \left(1\cdot \frac35 + 2\cdot \frac15\right)\left(\frac16\right) \\
 &= \frac16,
\end{align}
since of course $E(X_1\mid B_2) = E(X_1\mid B_3) = 0$.
In fact I think that for purposes of showing your work you could
probably get away with skipping the right-hand side of line $(1)$
in the above set of equations,
and instead immediately setting $E(X_1)$ equal to line $(2)$.
But writing $P(X_1=1)$ when you really mean $P(X_1=1\mid B_1)$
obscures the fact that the $E(X_1)$ that you calculate here
is not $E(X_1\mid B_1)$.
By the way, using the notation of this answer, André Nicolas's answer
simply computes
$$
E(X) = E(X\mid B_1)P(B_1) + E(X\mid B_2)P(B_2) + E(X\mid B_3)P(B_3),
$$
where of course $E(X\mid B_i) = E(X_i\mid B_i)$. 
I think on the whole, that calculation is easier to explain
(which is important!) as well as a little easier to organize.
