My Math Forum Probability of having one of two unknown bags

 Probability and Statistics Basic Probability and Statistics Math Forum

 January 30th, 2010, 11:38 PM #1 Senior Member   Joined: Jan 2010 Posts: 205 Thanks: 0 Probability of having one of two unknown bags Bag #1 900 red eggs 100 blue eggs Bag #2 100 red eggs 900 blue eggs You are given one of these two bags (50/50 chance) randomly. You perform a set of trials where you take out one egg randomly from your bag, note the color, then put it back in, and repeat. You drew 8 red eggs and 2 blue eggs from your bag during this trial. What is the probabilty (%) that you have Bag #1? I thought it was 50% because you could have drawn 8 red and 2 blue from bag #2 as well, since drawing eggs and putting them back does not change the bag's contents...
January 31st, 2010, 09:33 AM   #2
Math Team

Joined: Dec 2006
From: Lexington, MA

Posts: 3,267
Thanks: 407

Re: Probability of having one of two unknown bags

Hello, daigo!

I solved this at another site . . . but here it is again.

Quote:
 $\text{Bag 1: }\;\begin{array}{c}\text{900 red eggs} \\ \text{100 blue eggs}\end{array}\;\;\;\;\;\;\;\text{Bag 2: }\;\begin{array}{c}\text{100 red eggs}\\\text{900 blue eggs} \end{array}$ You are given one of these two bags randomly (50/50 chance). You perform a set of trials where you take out one egg randomly from your bag, [color=beige]. . [/color]note the color, then put it back in, and repeat. You drew 8 red eggs and 2 blue eggs from your bag during this trial. What is the probabilty (%) that you have Bag #1?

This is Conditional Probability.

$\text{Bayes' Theorem: }\;\;{(\text{Bag 1 }|\text{ 8R,2B}) \;=\;\frac{P(\text{Bag 1 }\wedge\text{ 8R,2B})}{P(\text{8R,2B})}$[color=beige] .[/color][color=blue][1][/color]

$\text{Numerator: }\;P(\text{Bag 1}) \,=\,\frac{1}{2}$

[color=beige]. . [/color]$\text{In Bag 1: }\:P(R) \,=\,\frac{9}{10},\;\;P(B)\,=\,\frac{1}{10}$

[color=beige]. . [/color]$\text{Then: }\:P(\text{8R,2B}) \;=\;{10\choose2}\left(\frac{9}{10}\right)^8\left( \frac{1}{10}\right)^2 \;=\;(45)\cdot\frac{9^8}{10^{10}}$

[color=beige]. . [/color]$\text{So: }\:P(\text{Bag 1 }\wedge\text{ 8R,2B}) \;=\;\frac{45}{2}\cdot\frac{9^8}{10^{10}}$[color=beige] .[/color][color=blue][2][/color]

$\text{Denominator: }\:P(\text{Bag 2}) \,=\,\frac{1}{2}$

[color=beige]. . [/color]$\text{In Bag 2: }\:P(R) \,=\,\frac{1}{10},\;P(B) \,=\,\frac{9}{10}$

[color=beige]. . [/color]$\text{Then: }\:P(\text{8R,2B}) \:=\:{10\choose8}\left(\frac{1}{10}\right)^8\left( \frac{9}{10}\right)^2 \;=\;(45)\cdot\frac{9^2}{10^{10}}$

[color=beige]. . [/color]$\text{So: }\:P(\text{Bag 2 }\wedge\text{ 8R,2B}) \;=\;\frac{45}{2}\cdot\frac{9^2}{10^{10}}$[color=beige] .[/color][color=red](A)[/color]

$\text{Hence: }\:P(\text{8R,2B}) \;=\;\frac{45}{2}\cdot\frac{9^8}{10^{10}}\,+\,\fra c{45}{2}\cdot\frac{9^2}{10^{10}} \;=\;\frac{45}{2}\cdot\frac{9^2}{10^{10}}\cdot\lef t(9^6\,+\,1\right)$[color=beige] .[/color][color=blue][3][/color]

Substitute [color=blue][2][/color] and [color=blue][3][/color] into [color=blue][1][/color]:

[color=beige]. . [/color]$\displaystyle{ P(\text{Bag 1 }|\text{ 8R,2B}) \;=\;\frac{\frac{45}{2}\cdot\frac{9^8}{10^{10}}} {\frac{45}{2}\cdot\frac{9^2}{10^{10}}\left(9^6\,+\ ,1\right)} \;=\;\frac{9^6}{9^6\,+\,1} \;=\;\frac{531,441}{531,442} }$

$\text{Therefore: }\;P(\text{Bag 1 }|\text{ 8R,2B}) \;=\;0.0.999998118\;\;\cdots\;\;\text{ virtually 100\%}$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

This result make sense when we consider [color=red](A)[/color].

[color=beige]. . [/color]$P(\text{Bag 2 }\wedge \text{ 8R,2B}) \;=\;\frac{45}{2}\cdot\frac{9^2}{10^{10}} \;=\;0.000000183$

If we have Bag 2, it is virtually impossible to draw 8 Reds and 2 Blues.

Thereofore, they must have come from Bag 1.

 January 31st, 2010, 11:11 AM #3 Senior Member   Joined: Jan 2010 Posts: 205 Thanks: 0 Re: Probability of having one of two unknown bags Thanks. I was shown another method where I do 100 - ([1^8 * 100] / [9^8]) but I did not understand why that was the answer. Your solution clarified it better.

 Tags bags, probability, unknown

 Thread Tools Display Modes Linear Mode

 Similar Threads Thread Thread Starter Forum Replies Last Post shunya Algebra 5 February 27th, 2014 10:07 PM zxcvbnm123 Number Theory 1 February 19th, 2014 01:26 AM dragonaut Algebra 0 March 27th, 2013 12:46 PM drunkd Algebra 8 July 31st, 2012 04:32 AM benathan Calculus 7 September 20th, 2007 05:48 PM

 Contact - Home - Forums - Cryptocurrency Forum - Top