Problem:
Given the following information:
There are 3 urns $X$, $Y$ and $Z$.
Urn $X$ contains 4 red balls and 3 black balls.
Urn $Y$ contains 5 red and 4 black balls.
Urn $Z$ contains 4 red balls and 4 black balls.
One ball is drawn from each of these urns.
What is the probability that the 3 balls drawn consist of 2 red balls and 1 black ball ?
My Approach:
Lets represent red balls as $1$ and black balls as $0$. Then there could be three possible ways by which the solution is possible.
$$XYZ \\ 0 \ 1 \ 1 \\ 1\ 0\ 1 \\ 1\ 1\ 0$$
So, the result would be the sum of probabilities of these three possible ways.
In the first case, the probability of getting red ball from $X$ is $\frac{4}{7}$ then the probability of getting black ball from $Y$ is $\frac{4}{9}$ and then the probability of getting black ball from $Z$ is $\frac{4}{8} = \frac{1}{2}$. So, the probability of the first case is $\frac{4}{7} \times \frac{4}{9} \times \frac{1}{2} = \frac{16}{126}$
For the second case, the probability is: $\frac{3}{7} \times \frac{5}{9} \times \frac{1}{2} = \frac{15}{126}$
And in the third case, it is: $\frac{3}{7} \times \frac{4}{9} \times \frac{1}{2} = \frac{12}{126}$
So, Total probability, $P = \frac{16}{126} + \frac{15}{126} + \frac{12}{126} = \frac{43}{126}$
Where did I approached wrongly?
Note:
The problem I get from Hackerrank which is a problem solving site and it is saying that my answer is wrong.
[self-study]
tag & read its wiki. $\endgroup$