Compute the probability mass function of X There are two bags A and B. Bag A has 2 green marbles and 3 red marbles. Bag B has 2 green marbles and 3 blue marbles. Two marbles are drawn without replacement from bag A and put in bag B. Then two marbles are drawn without replacement from bag B and put in bag A. Let X be the number of green marbles in bag A after the above operations. Compute the probability mass function of X.
My attempt:
$X=\{0,1,2,3,4\}$
$X=0$: take all green from A and put non-greens back = $\frac{2}{5}\cdot\frac{1}{4}+\frac{3}{7}\cdot\frac{2}{6}=\frac{17}{70}$
$X=1$: take all green from A and put one green back + take 1 green and put non-greens back = $\left(\frac{2}{5}\cdot\frac{1}{4}+\frac{4}{7}\cdot\frac{3}{6}\right)+\left(\frac{2}{5}\cdot\frac{3}{4}+\frac{4}{7}\cdot\frac{3}{7}\right)=\frac{228}{245}$
Then we continue on with $X=2,3,4$. My concern is that if we add up $\mathbb{P}(X=0)$ and $\mathbb{P}(X=1)$, we get a value that is greater than $1$, which should not be the case because everything should sum to $1$. Can someone tell me what I am doing wrong and possibly how I would approach this problem differently to get the right answer? Thank you.
 A: You wrote:

take all green from A and put non-greens back

First sight first error found...
$$\mathbb{P}[X=0]=\frac{2}{5}\cdot\frac{1}{4}\cdot\frac{3}{7}\cdot\frac{2}{6}=\frac{1}{70}$$
At present I did not check the rest
A: Answers
f(X=0)=.0143
f(X=1)=.2281
f(X=2)=.5116
f(X=3)=.229
f(X=4)=.0143

Method:
In this method, blue and red balls are collectively labeled R because it makes no difference. Create a tree and keep track of number of marbles in each bag at each branch of tree, as well as what you take out of the appropriate bag.
$$\left(\begin{matrix}2G\\3R\end{matrix}\right)\left(\begin{matrix}2G\\3R\end{matrix}\right)\begin{cases}1G1R\left(\begin{matrix}1G\\2R\end{matrix}\right)\left(\begin{matrix}3G\\4R\end{matrix}\right)\begin{cases}1G1R(2)\\2G(3)\\2R(1)\end{cases}\\
2G\left(\begin{matrix}0G\\3R\end{matrix}\right)\left(\begin{matrix}4G\\3R\end{matrix}\right)\begin{cases}1G1R(1)\\2G(2)\\2R(0)\end{cases}\\
2R\left(\begin{matrix}2G\\1R\end{matrix}\right)\left(\begin{matrix}2G\\5R\end{matrix}\right)\begin{cases}1G1R(3)\\2G(4)\\2R(2)\end{cases}\end{cases}$$
This bizarre-looking table tells you

*

*The starting configuration of balls in Box A and Box B, respectively

*The combination of balls drawn from Box A

*The configuration of balls at this stage in Box A and Box B, respectively

*The combination of balls drawn from Box B

*The number of green balls in Box A

Simply compute each of the nine probabilities and then add the entries for X=0, X=1, ..., X=5 (these are in the little parentheses at the end of each stem) together to obtain their probabilities, e.g. for X=3 you'll have to add 2 probabilities together. For example, the very first of the nine rows has probability
$$\frac{{2\choose 1}{3 \choose 1}}{{5\choose 2}}*\frac{{3\choose 1}{4 \choose 1}}{{7\choose 2}}=.34\\
\text{or}\\
\frac 2 5 * \frac 3 4 * 2 * \frac 3 7 * \frac 4 6 * 2=.343$$
where you multiply the probability of picking 1 green 1 red from Box A in stage 1 (2G3R pot) with the probability of from picking 1G1R from Box B in stage 2 (3G4R pot).
