# Evaluation of sample space (Bayes' Theorem)

This question is solved one - but I am trying to find flaw in my understanding of the situation. The question is as follows:

The blue M&M was introduced in 1995. Before then, the color mix in a bag of plain M&Ms was (30% Brown, 20% Yellow, 20% Red, 10% Green, 10% Orange, 10% Tan). Afterward it was (24% Blue , 20% Green, 16% Orange, 14% Yellow, 13% Red, 13% Brown).

A friend of mine has two bags of M&Ms, and he tells me that one is from 1994 and one from 1996. He won't tell me which is which, but he gives me one M&M from each bag. One is yellow and one is green. What is the probability that the yellow M&M came from the 1994 bag?

==================================================================

I am trying to find the sample space first, and it seems there is flaw in my understanding of the problem. Need help in understanding that flaw and if possible please let me know how you would solve it (with or without Bayes' Theorem). I am a beginner (not a student though) and want to understand different aspects from which this problem can be viewed. 2-3 approaches should suffice. I know that this will call extra pain - I want to thank you in advance.

Let B1 (1994) and B2 (1996) are two bags. The sample space should comprise of following events -

1. B1 x B2 = 36 events - That is an ordered pair containing first M&M from B1 and the other from B2.
2. B2 x Tan (from B1) = 6 events
3. B1 x Blue (from B2) = 6 events

So in total we have 48 possible events. (Please confirm)

However since the weight of each event varies because of difference in frequency of each colour the probability of each of these 48 events is not equally likely. Sum of the probability of all these events should be unity though.

P(Y/B1) . P(G/B2) = .04

What should I do from here on ?

• This question has no clear answer, since it does not specify how the yellow and green ones were selected. – Paul Aug 11 '17 at 19:00
• Ok, What is the ambiguity? – ultimate cause Aug 11 '17 at 19:01
• "What is the ambiguity" two extreme cases: "oh, i remember 1994, that's when that hit song yellow came out on the radio... how about i open this bag of m&m's from '94 and specifically take a yellow one to show my friend. oh, lets take a green one from the '96 bag since thats when the green mile aired in theatres" Second case, the exact opposite. If we knew our friend was thinking one of these two things, then we can know with absolute certainty which came from what bag. You'll need to specify the assumption that he grabbed an m&m uniformly and independently at random from each bag. – JMoravitz Aug 11 '17 at 20:28

You don't have 48 combination events, just 36, since there are only 6 colour options in each case. Of course blue or tan will not have a reverse case to compare with, giving certainty. Alternatively, to preserve symmetry you could have 49 options across the total of 7 colours, with zeroes as appropriate for blue in older and tan in newer bags.

You do not need to calculate out the whole grid though. You can be mathematically certainly that the distributive law holds, giving a net sum of $1$. So just calculate the probabilities for $(yellow, green)$ and $(green, yellow)$ options and work from there. Calculating those probabilities is where any non-random selection process, noted in comments, will take effect.

• Thanks Joffan. A query is why calculate (green, yellow) ? We just want to know the probability that yellow is from B1 and Green from B2. What is that I am missing? – ultimate cause Aug 12 '17 at 2:23
• Either of those are potential ways to see a yellow and green. Their relative sizes will give you the probability of each way. – Joffan Aug 12 '17 at 2:55
• Thanks. So if I got both probabilities. Is it legal to multiply them? They are mutually exclusive. What to do further with them? This is the thing I think I am missing. Since we already found the probability of the desired pair from 36 possible events, why do we look for anything else? – ultimate cause Aug 12 '17 at 3:33
• @ultimatecause You're looking for a conditional probability: $\mathsf P(B_1{=}Y\cap B_2{=}G\mid (B_1{=}Y\cap B_2{=}G)\cup (B_1{=}G\cap B_2{=}Y)) = \dfrac{\mathsf P(B_1{=}Y)\,\mathsf P(B_2{=}G)}{\mathsf P(B_1{=}Y)\,\mathsf P(B_2{=}G)+\mathsf P(B_1{=}G)\,\mathsf P(B_2{=}Y)}$ – Graham Kemp Aug 12 '17 at 5:44
• Thanks everyone due to your persistent support I could understand the problem and answered it own my own so that any beginner can understand all the important points. Please comment for issues or if you are satisfied with my understanding. – ultimate cause Aug 12 '17 at 12:53

Few points to consider before actually working out the solution.

1. We are not told about which bag is which. This is an important point.

2. For every pair there could be two possibilities. 1st color may come from 1994 bag or from 19996 bag. (x,y) or (y,x)

3. We don't know which color came from where. We have to find the numerical value for the possibility.

# Evaluating Sample Space

There are six colors in each set and thus we have 36 different possibilities. Points 2 and 3 in the question do not matter because the order does not matter.

B1 x B2 = (b1 from B1 and b2 from B2) All colors are common in both bags except two, viz Tan and Blue.

Since Tan is only present in B1, only (Tan, b2) is possible similarly only (b1,Blue) is possible and not the reverse.

# Apply Conditional probability (Bayes' Theorem)

The friend gave me a yellow and green M&M and there are two ways of getting them. (Y,G) and (G,Y). I don't know which is from where. Since I am only looking for yellow from 1994 bag, there are two different events as to how bags can be chosen.

E1 = B1, the first bag from which first M&M was drawn was 1994 bag and the other one was from 1996.

E2 = B1, the first bag from which first M&M was drawn was 1996 bag and the other one was from 1994.

In addition let I be the event of us getting a yellow M&M and a green M&M irrespective of choice of bags.

Now, we apply Bayes' Theorem as below.

P(E1 | I ) = P(I ∣ E1).P(E1) / P(I) ......Eq (1)

Evaluating P(I ∣ E1) we get .04 Evaluating P(E1) we get .5

The denominator of Eq. (1) is a harder than above ones.

P(I) = P(I ∩ (E1 ∪ E2))= P[(I ∩ E1) ∪ (I ∩ E2)]

= P[(I ∩ E1) ∪ (I ∩ E2)] =

= P (E1). P(I ∣ E1) + P (E2). P(I ∣ E2)

Now filling in the values here :

= (1/2). (.04) + (1/2).(0.014)

= 0.027

To compute the final answer it is just matter of substituting final values in Eq (1)

P(E1 | I ) = (0.04) (1/2) / (0.027)

= 0.741 (approx)