Multi sided dice probability with Bernoulli 
We have a four sided dice. One of them has one blue, two red, and one green face, the other dice has all green faces. We pick one dice at random and roll it four times

*

*Find the probability that green face comes up exactly two times.

*Knowing that green face came up twice, evaluate the probability that we selected the green-colored dice.


Visualizing the dices, they look something like this
 
With the first dice having 1 -blue, 2 - red and 1 - green side, whereas die 2 is all green. Considering G = Green color shows up, with $D_1$ being dice 1 and $D_2$ being dice 2, we can create the following equations,
$$P(D_1) = P(D_2) = \frac{1}{2}$$
$$P(G|D_1) = P(X=2) = {4 \choose 2}(\frac{1}{4})^4 \cdot (\frac{3}{4})^2$$
$$P(G|D_2) = 1$$
Hence the probability of getting all greens twice on throwing the dice 4 times can be calculated by total probability as follows:
$$P(G) = P(G|D_1)\cdot P(D_1) + P(G|D_2) \cdot P(D_2)$$
As for part 2, we can do the following:
$$P(D_2|G) = \frac{P(G|D_2) \cdot P(D_2)}{P(G|D_1) \cdot (D_1) + P(G|D_2) \cdot P(D_2)}$$
I'm not sure if this is the correct way to solve this problem, suggestions would be appreciated.
 A: We could easilly compute the probability $p$ of getting the green side and $q$ of getting the other colour:
$$p=.5\cdot 1 + .5\cdot .25=.625$$
$$q=1-p=.375$$
Now, after Bernoulli, we could compute the probability of getting the green side exactly 2 times in 4 attempts:
$$P_4(2)=\binom{4}{2}p^2q^{4-2}=6\cdot.390625\cdot.140625=.32958984375$$
Now we can declare two situations:


*

*$A$ - we obtain green side exactly 2 times

*$B$ - the green dice was picked exactly 2 times


Of course $P(A)=.32958984375$
Probabilty of picking the green dice is $.5$, thus again after Bernoulli we have
$$P(B)=\binom{4}{2}\cdot.5^2 \cdot .5^{4-2}=0.375$$
We can also easilly compute the probabilty of getting exactly 2 green sides under the assumption, that the green dice was picked two times - it's just probability, that from the colorful dice we obtain non-green side in both throws.
$$P(B|A)=.75^2=.5625$$
After Bayes we have:
$$P(A|B)=\frac{P(B|A)P(A)}{P(B)}=\frac{.5625\cdot .32958984375}{0.375}=0.494384765625$$
