Q#35: Christmas M&Ms

Suppose you have two different bags of M&Ms, one is a special Christmas edition while the other is a standard bag of M&Ms. The Christmas edition contains only red, green, and white M&Ms while the standard bag contains the full color offering. The distributions of drawing a given color are below:

Christmas bag of M&Ms

  • Green: 30%
  • Red: 40%
  • White: 30%

Standard bag of M&Ms

  • Green: 20%
  • Orange: 19%
  • Blue: 19%
  • Red: 15%
  • Yellow: 14%
  • Brown: 13%

You are given an M&M from each bag, but you do not know which M&M came from which bag. One M&M is Red and one is Green. What is the probability that the Red M&M came from the Standard bag?
-Credit to:
team@interviewqs.com

TRY IT YOURSELF

ANSWER

This question tests our understanding of probability/statistics, specifically Bayes’ Theorem.

Bayes’ Theorem stems from conditional probability where the likelihood of an outcome is governed by pre-existing information. Often described as the probability of an event given another thing occurred. Here we are asked to find the probability that a red M&M came from the standard bag given that of the two M&Ms chosen one came from each bag. The standard Bayes’ formula is P(A|B) = P(B|A) * P(A) / P(B).

Therefore the P(Red M&M | Standard Bag) = P(Standard Bag | Red M&M) * P(Red M&M)/P(Standard Bag). We know P(Standard Bag | Red M&M) is equal to .15 (given the 15% Red in standard bags information above). We also know P(Standard Bag) is equal to 0.5, given there are only two options. Thus we only need the P(Red M&M) given the two different bags are sampled together. The overall probability of red can be calculated as the the sum of the probabilities of the occurrence from the standard bag and the occurrence from the Christmas bag , P(Red M&M) = 0.5*0.4 + 0.5*0.15 = 0.275.

The probability therefore is, P(Red M&M | Standard Bag) = P(Standard Bag | Red M&M) * P(Red M&M)/P(Standard Bag) = 0.15 * 0.275/0.5 = 0.0825.

--

--