# Two similar Bayesian problems. Did I get them right?

by Fredrik
Tags: bayesian, similar
 Sci Advisor HW Helper P: 2,589 "Bayesian" comes from a guy named "Bayes", which would be pronounced like "Bays". So "Bayesian" is pronounced like "Bays-Ian". You can actually here it here. Anyways, the idea is to use the idea of conditional probability: $$P(A | B) = \frac{P(A \cap B)}{P(B)}$$ So the probability of A, given that B has occured, is equal to the probability that both A and B occur, divided by the probability that B occurs. In problem 1, you want to calculate the probability that the box chosen had 10 balls, given that the ball that was picked had 9 written on it.
 Emeritus Sci Advisor PF Gold P: 8,995 Thanks AKG. At least now I know how pronounce Bayesian. I'm not sure I understand the formula for the conditional probability though. A and B are obviously not independent in the formula. If they were, the formula would be kind of pointless, since we would have P(A|B)=P(A) and P(A and B)=P(A)*P(B). What I don't understand is what P(A and B) means when A and B are not independent. Anyway, that doesn't matter much right now, since I believe my solutions are correct. If I'm wrong, I hope someone will tell me. These are my solutions: Problem 1 There was a 1/2 probability that you picked the box with 10 balls and a 1/2 probability that you picked the box with 100 balls. If you picked the box with 10 balls, it was certain that the ball your friend picked would have a number less than 11. If you picked the box with 100 balls, there was only a 1/10 chance that he would pick a ball with a number less than 11, and a 9/10 chance that he would not. From this we get the probabilities for each possibility: . . . . . . . . . . . . . Small number . . . . . . . . . Large number Box with 10 . . . . . 1/2 * 1 = 1/2 . . . . . . . . 1/2 * 0 = 0 Box with 100 . . . . 1/2 * 1/10 = 1/20 . . . . . . 1/2 * 9/10 = 9/20 If we do this a large number of times, we will get a ball with a small number from the box with 10 balls 1/2 the times and we will get a small number 1/2 + 1/20 = 11/20 times. The probability we seek is the first of those numbers divided by the second: (1/2)/(11/20)=10/11. Problem 2 You were assigned a room that was chosen at random from a set of 110 rooms, 10 of which is in building A, so there was a 1/11 probability that you ended up in building A and a 10/11 probability that you ended up in building B. If you ended up in building A, it was certain that you would get a low room number. If you ended up in building B, there was a 1/10 probability that you would get a low room number and a 9/10 probability that you would get a high room number. From this we get the probabilities for each possibility: . . . . . . . . . . . . . Small number . . . . . . . . . Large number Building A . . . . . . 1/11 * 1 = 1/11 . . . . . . . 1/11 * 0 = 0 Building B . . . . . . 10/11 * 1/10 = 1/11 . . . . 10/11 * 9/10 = 9/11 If you do this a large number of times, you will find yourself in a room with a small number in building A 1/11 times, and you will find yourself in a room with a small number 2/11 times. The probability we seek is the first of those numbers divided by the second: (1/11)/(2/11)=1/2.
P: 31

## Two similar Bayesian problems. Did I get them right?

I would suggest that you use the formula:

$$P(A|B)= \frac{P(B)P(B|A)}{P(A)}$$

instead. In the first example $$A$$ is "the box contains 10 balls" and $$B$$ is "You pick ball number 9", we get $$P(B)= \frac{1}{2}(\frac{1}{10}+\frac{1}{100})$$, $$P(B|A)= \frac{1}{10}$$, and $$P(A)=\frac{1}{2}$$. Hence $$P(A|B)= \frac{10}{11}$$.
 Quote by DavidK I would suggest that you use the formula: $$P(A|B)= \frac{P(B)P(B|A)}{P(A)}$$