Exercise on Conditional probability I'm doing the following exercise:
You have 2 boxs filled with balls. In the first box you have 30% white, 30% black, 20% green and 20% blu balls. In the second box you have 25% white, 25% black, 25% green and 25% blu balls.(I assume that the quantity of balls are the same, for example 100 in the first one and 100 in the second one)
Calculate:


*

*The probability of have extracted a blue ball, from a random box

*if you extracted a blue ball, what is the probability that you extracted it from the first box?

*If you take a random ball from the first box and a random ball from the second box, what is the probability that the ball are the same?


That's what I did:
1) $B=$probability of a blu ball, $A$=first box, $\neg A$= second box
$$P(B)=P(B|A)P(A)+P(B|\neg A)P(\neg A)=20\%*\frac{1}{2}+25\%*\frac{1}{2}=22.5\%$$
2) $B=$probability of a blu ball, $A=$first box
$$P(A|B)=\frac{P(B|A)P(A)}{P(B)}=\frac{20\%*\frac{1}{2}}{22.5\%}=0.88$$
I think that what I did until now is right. But know I dont know how to calculate the third point. 
Can you give me some hits?
EDIT:
I just noticed that on the 2nd point if I switch the box A
with the box ¬A I get 0.55 (for the first) 0.88 (for the second). Isn't it strange? in the first box you have less of that kind of ball (20%) in the second you have more(25%). Shouldn't I get an highter probability if I use ¬A instead of A?
 A: You will need to use weighted probabilities to solve this. Weighted probabilities work as follows. Suppose each event $A_i$ has probability $P(A_i)$ and $B$ has probability $P(B|A_i)$ for each $A_i$, (that is, $B$ is dependent on $A_i$) and only one of the $A_i$ can happen. Then the probability that $B$ happens is
$$P(A_1)P(B|A_1)+ P(A_2)P(B|A_2)+...+ P(A_n)P(B|A_n)$$
Thus, in this case, we have that $A_1$ is the event of getting a white ball from the first box, $A_2$ is for black balls, $A_3$ for green balls, and $A_4$ for blue ones. Then the probability of drawing a matching ball is
$$0.3P(B|A_1)+0.3P(B|A_2)+0.2P(B|A_3)+0.2P(B|A_4)$$
Given the ball percentages for box $2$, we can find each $P(B|A_i)$:
$$0.3(0.25)+0.3(0.25)+0.2(0.25)+0.2(0.25)$$
and that should be your answer, once you simplify it.
A: Part 1 looks alright. For part 2, there seems to be small mistake as $P(B|A)$ is $20\%$.
For part 3, 
$P(balls\ of\ same\ color) = \sum P(C_1 \cap C_2) = \sum (P(C_1)*P(C_2)) \ \ \ \forall\  colors\ C$
$ \ \ \ \ \ \ \ \  = 0.30*0.25 + 0.30*0.25+0.20*0.25+0.20*0.25$
$ \ \ \ \ \ \ \ \ =0.25 = 25\%$
$C_1 \cap C_2$ means that ball is drawn of color $C$ from both bags. Since the balls are drawn independently, the probabilities for individual bags get multiplied.
Since the events of drawing balls of same color are mutually exclusive for different colors, these probabilities get added.
A: It will be $(.2)(.25)+(.2)(.25)+(.3)(.25)+(.3)(.25)=.25$. Or more simply, no matter what ball is taken out of the first box,  $\frac{1}{4}$ of the balls in the second box are a match.
A: For the third point, you can either pick
1)white and white(0.3*0.25)
2)black and black(0.3*0.25)
3)green and green(0.2*0.25)
4)blue and blue(0.2*0.25)
The answer is the sum of all these probabilities which is 0.25
