LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   Homework 1 (http://book.caltech.edu/bookforum/forumdisplay.php?f=130)

 fredcommo 04-07-2013 08:37 AM

I'm a little bit confused here, and quite upset about bugging on such simple probabilistic problem !! :clueless:

Since we are supposed to pick the 2nd ball in the same bag we picked the first one, which was black, there are 2 possible outcomes:
Either I picked a black ball from the bag with 2 black balls, and in that case the 2nd will be black, or I picked the black ball from the bag which contained a black and a white ball, and in that case I'll pick a white ball.
So the probability of picking a black ball, given that I have to pick from the same bag, should be 1/2.
It would be 2/3 if I would have the choice of picking the 2nd ball from any of the 2 bags.

What did I miss here ?

 Rahul Sinha 04-07-2013 10:45 AM

Nothing! Your line of reasoning is correct.
So, P(B|B) can be obtained as the P(choosing a bag)*P(getting a black ball)*P(getting the second black ball). If we choose the BB bag, this evaluates as 1/2*1*1. If we choose the BW bag, the values are 1/2*1/2*0 = 0.

 fredcommo 04-07-2013 01:03 PM

Thanks Rahul.
Unfortunately, 1/2 was a wrong answer here...

 leduran 04-07-2013 06:54 PM

Hi, think of this problem in the following way: if the first ball withdrawn was black , then for the second ball to be also black it must come from the bag containing the two black balls. So this problem is equivalent to finding the probability that the bag with the two black balls was choosen given that the first withdrawn ball was black.

Call Bag1 the event of choosing the bag with the 2 black balls, and B the event that the first ball is black, then:

P(bag1|B) = P(B|bag1)*P(bag1)/P(B) = P(B|bag1)*P(bag1)/P(B|bag1)*P(bag1)+P(B|bag2)*P(bag2)

= (1)(0.5)/(1)(0.5)+(0.5)(0.5)=2/3

Hope it helps

 Rahul Sinha 04-07-2013 10:43 PM

Agreed. I missed that bit. :bow:

 Elroch 04-08-2013 04:13 PM

Quote:
 Originally Posted by fredcommo (Post 10198) I'm a little bit confused here, and quite upset about bugging on such simple probabilistic problem !! :clueless: Since we are supposed to pick the 2nd ball in the same bag we picked the first one, which was black, there are 2 possible outcomes: Either I picked a black ball from the bag with 2 black balls, and in that case the 2nd will be black, or I picked the black ball from the bag which contained a black and a white ball, and in that case I'll pick a white ball. So the probability of picking a black ball, given that I have to pick from the same bag, should be 1/2. It would be 2/3 if I would have the choice of picking the 2nd ball from any of the 2 bags. What did I miss here ?
The key point is that although you do have two possible situations where you have a black ball, one is twice as likely as the other. You are implicitly assuming the two are equally likely.

 purshe 04-09-2013 01:46 AM

One can solve this problem intuitively without applying formulas

Note that we are calculating the probability after the first ball is drawn.
We know there are 4 possible scenarios are possible at the time of drawing the first ball
1: (Bag1, Black1),
2: (Bag1, Black2),
3: (Bag2, Black)
4: (Bag2, White)

Since we have already drawn the first ball & know it is black, we deduce that the 4th option has not occurred. So, we narrow down the possible scenario list to 3

Given this, we need to determine if the second ball will also be black. Out of the three shortlisted options, two of those options will give us the required scenario (option 1 & 2).

Hence probability = 2/3

 jcmorales1564 04-09-2013 04:35 AM

Hello. This is my first post in the forum. I am trying very hard to maintain the pace in this course. I lost interest at first since I thought that I needed to have the book to participate in the forum :confused: but I received an email from the instructor that indicated the answer to the login question (thanks!). I finished the Data Analysis course in Coursera (Dr. Jeff Leek) a couple of weeks ago (that is where I became interested in Machine Learning) and the forum was one of the highlights. I am glad that I have finally been able to join this forum.

At any rate, in this problem I initially thought that p = 1/2 but this answer kept bugging me... I kept recalling the famous Monty Hall three-door scenario where p = 2/3. Then I recalled the concept of sample space, i.e., the set of all possible outcomes, and I was able to finally visualize the problem properly.

Define the bags and the balls as follows:

B = Black Ball
W = White Ball
BBbag = bag with 2 black balls
BWbag = bag with one black and one white ball

There are three actions that take place:
1. Select a bag
2. Select the first ball from the bag
3. Select the second ball from the bag

Separating each action by a hyphen, then the set of possible outcomes or Sample Space is:
1. BWbag - W - B
2. BWbag - B - W
3. BBbag - B - B
4. BBbag - B - B

The condition set by the problem is that the first ball that is chosen must be black so only the last three cases in the sample space apply. Of these three cases, only two meet the outcome (second ball is black).

So, defining probability as the ratio of the number of equally likely outcomes that produce a given event to the total number of possible outcomes that meet our condition, then the probability that the second ball is black is 2/3.

 silvrous 04-09-2013 01:15 PM

Quote:
 Originally Posted by jcmorales1564 (Post 10267) Hello. This is my first post in the forum. I am trying very hard to maintain the pace in this course. I lost interest at first since I thought that I needed to have the book to participate in the forum :confused: but I received an email from the instructor that indicated the answer to the login question (thanks!). I finished the Data Analysis course in Coursera (Dr. Jeff Leek) a couple of weeks ago (that is where I became interested in Machine Learning) and the forum was one of the highlights. I am glad that I have finally been able to join this forum. At any rate, in this problem I initially thought that p = 1/2 but this answer kept bugging me... I kept recalling the famous Monty Hall three-door scenario where p = 2/3. Then I recalled the concept of sample space, i.e., the set of all possible outcomes, and I was able to finally visualize the problem properly. Define the bags and the balls as follows: B = Black Ball W = White Ball BBbag = bag with 2 black balls BWbag = bag with one black and one white ball There are three actions that take place: 1. Select a bag 2. Select the first ball from the bag 3. Select the second ball from the bag Separating each action by a hyphen, then the set of possible outcomes or Sample Space is: BWbag - W - B BWbag - B - W BBbag - B - B BBbag - B - B The condition set by the problem is that the first ball that is chosen must be black so only the last three cases in the sample space apply. Of these three cases, only two meet the outcome (second ball is black). So, defining probability as the ratio of the number of equally likely outcomes that produce a given event to the total number of possible outcomes that meet our condition, then the probability that the second ball is black is 2/3.
Wow, that does make sense and it's way easier than my Bayesian solution!

 Juahn 04-01-2015 01:13 AM