combinatorics contest problem Question: Calvin has a bag containing $50$ red balls, $50$ blue balls, and $30$ yellow balls. Given that after pulling
out 65 balls at random (without replacement), he has pulled out $5$ more red balls than blue balls, what
is the probability that the next ball he pulls out is red
Solution:The only information this gives us about the number of yellow balls
left is that it is even. A bijection shows that the probability that there are $k$ yellow balls left is equal
to the probability that there are $30 − k$ yellow balls left (flip the colors of the red and blue balls, and
then switch the $65$ balls that have been picked with the $65$ balls that have not been picked). So the
expected number of yellow balls left is 15. Therefore the expected number of red balls left is $22.5.$ So
the answer is $\frac{22.5}{60}=\frac{9}{26}.$  
Now i understand all of the solution up until the point where they calculate the expectation, how do they calculate that the expected number of yellow balls is 15 from using the fact that the probability there are $k$ yellow balls is equal to the probability that there are $30-k$ yellow balls?
 A: This problem has a nice solution because of specially chosen values. Namely
1. # red = # blue
2. balls picked  = 1/2 * ( # red + # blue + # yellow)
Because of this, with any configuration of 65 balls consisting of r red balls, r-5 blue balls, 70 - 2r yellow balls, we can create a bijection to the 65 balls consisting of 55-r red balls, 50-r, 2r - 40 yellow balls. Hence, the expected number of yellow balls left is $ \frac{1}{2} [ ( 70-2r) + (2r - 40) ] = 15 $.
A: Sorry i was being silly calculating $\mathbb{E}(X)=\sum_{k} \mathbb{P}(X=k)$ rather than $\mathbb{E}(X)=\sum_{k} k\mathbb{P}(X=k)$ i blame it on a long day!!
I want to just run through the rest of their solution as they miss a lot of detail, they don't explain why the expectation divided by $65$ gives the answer.
Here is my extended solution which aims to cover all the detail.
Let $y$ be the number of yellow balls and $x$ the number of red balls. Thus we know there are $x-5$ blue balls and in total $2x-5+y=65$. We know that $y$ must be even, and so $y$ ranges from the values $0,2,4,...,30$. Consequently $x$ takes values from $35,34,33,...,20$.
It follows that $\mathbb{E}(y)=\sum_{k=0}^{15} 2k\mathbb{P}(y=2k)$ and since $\mathbb{P}(30-2k)=\mathbb{P}(2k)$ we get that $\mathbb{E}(y)=15$. Since $2\mathbb{E}(x)-5+\mathbb{E}(y)=65$ it follows that $\mathbb{E}(x)=22.5$.
Now we want to calculate the probability that the next ball is a red one. Given that the number of red balls ranges from $35,...,20$ let $A$ be the event that the next ball is red, and $B_{k}$ the event that there are $k$ red balls left in the bag. Then $A=\bigcup_{k=20}^{35} (A \cap B_{k})$ and so $\mathbb{P}(A)=\mathbb{P}(\bigcup_{k=20}^{35} (A \cap B_{k}))=\sum_{k=20}^{35} \mathbb{P}(A \cap B_{k})$ as the events are disjoint. 
Next $\mathbb{P}(A \cap B_{k})=\mathbb{P}(A|B_{k})\mathbb{P}(B_{k})$. In addition for $x=k$ it follows that $\mathbb{P}(A|B_{k})=\frac{k}{65}$. 
Hence $\mathbb{P}(A)=\sum_{k=20}^{35} \frac{k}{65}\mathbb{P}(x=k)=\frac{\mathbb{E}(x)}{65}$. 
Is this correct?
