# Classical Probability

#### yifang

##### New Member
Greetings from new comer!
Here is my question I could not figure it out by myself:

There are two types of bags H and R in a single box (black box and you can't see through!). The number of the two types of bags are more than 10,000 that can be treated as infinite. In bag type H there are red (3/4) and white (1/4) balls (infinite number), in bag type R there are only white balls (also infinite number). Also I know the chance to pick bag type H is 2/3 and bag R is 1/3 from the box. Now I have randomly picked 16 balls from one bag, the 16 balls are all white. How much is the probability that these 16 balls are from bag of type R? How much is the probability that all these balls are from bag of type H.

This seems to me a Bayesian posterior probability question, but not quite sure. Intuitively these balls must be from a R type bag, as the chance to get them from the bag of type H is very low, but I need a formal calculation to address this question which is quite common in classic probability. Any help is appreciated!
Thanks!

Yifang

#### BGM

##### TS Contributor
Yes this is a classical elementary problem about the Bayes Theorem. Just directly apply the theorem and done.

#### Dason

You are correct in that this is an application of Baye's Theorem. You have priors on the probabilities for each bag and you have the probability of getting the data for each bag - you want the probability that it is a certain bag given the data. Apply bayes theorem and you've got your probabilities.

#### yifang

##### New Member
Yes this is a classical elementary problem about the Bayes Theorem. Just directly apply the theorem and done.
But my problem is the 16 balls altogether, I am not sure the calculation for the probability. Thanks!

#### Dason

If you have 1/4 of the H contains white balls and you essentially have an infinite population then this is just a binomial experiment with probability of success = 1/4. For the other bag the only outcome is all white balls so given that you're in that bag the probability of all white balls is just 1.

#### yifang

##### New Member
Thanks Dason and BGM!

The are two situations. 1) Take one ball at a time for 16 times, 2) take 16 balls at once. Apparently 1) does not apply to the question.
Here I tried to do the calculation. Please correct me if I mistake any part.

1) Take a single ball out of the box, the ball happens to be white.
P(R)=1/3 prob of R bag,
P(H)=2/3 prob of H bag,
P(w|R)=1, prob white ball from R bag,
P(w|H)=1/4 prob of white ball from H bag
-----------------
P(R|w)=[P(w|R)*P(R)]/[P(w|H)*P(H) + P(w|R)*P(R) ]=[1*1/3]/[1/4*2/3 + 1*1/3] = 2/3
which means, randomly pick one ball that is white, it happens to be from R bag at 2/3, this is the same as the chance to get the R bag. But this is not the situation for my question.

2) Take 16 balls all at once from one bag out of the box
P(R)=1/3 prob of R bag,
P(H)=2/3 prob of H bag,
P(w-16|R)=1, prob white ball from R bag,
P(w-16|H)=(1/4)^16=2.328306e-10, prob of white ball from H bag
-----------------
P(R|w-16)=[P(w-16|R)*P(R)]/[P(w-16|H)*P(H) + P(w-16|R)*P(R) ]
=[1*1/3]/[(1/4)^16*2/3 + 1*1/3]
= 0.333333333333333/0.333333333566164
= 0.999999999301508

Is this right for my question?