LFD Book Forum

LFD Book Forum (http://book.caltech.edu/bookforum/index.php)
-   Homework 1 (http://book.caltech.edu/bookforum/forumdisplay.php?f=130)
-   -   *ANSWER* Homework1 - Q3 (http://book.caltech.edu/bookforum/showthread.php?t=4167)

fredcommo 04-07-2013 09:37 AM

*ANSWER* Homework1 - Q3
 
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 11:45 AM

Re: *ANSWER* Homework1 - Q3
 
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 02:03 PM

Re: *ANSWER* Homework1 - Q3
 
Thanks Rahul.
Unfortunately, 1/2 was a wrong answer here...

leduran 04-07-2013 07:54 PM

Re: *ANSWER* Homework1 - Q3
 
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 11:43 PM

Re: *ANSWER* Homework1 - Q3
 
Agreed. I missed that bit. :bow:

Elroch 04-08-2013 05:13 PM

Re: *ANSWER* Homework1 - Q3
 
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 02:46 AM

Re: *ANSWER* Homework1 - Q3
 
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 05:35 AM

Re: *ANSWER* Homework1 - Q3
 
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 02:15 PM

Re: *ANSWER* Homework1 - Q3
 
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:
  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.

Wow, that does make sense and it's way easier than my Bayesian solution!

Juahn 04-01-2015 02:13 AM

Re: *ANSWER* Homework1 - Q3
 
Quote:

Originally Posted by leduran (Post 10215)
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


leduran's reply doesn't have enough parentheses, which has to be corrected


All times are GMT -7. The time now is 07:38 PM.

Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
The contents of this forum are to be used ONLY by readers of the Learning From Data book by Yaser S. Abu-Mostafa, Malik Magdon-Ismail, and Hsuan-Tien Lin, and participants in the Learning From Data MOOC by Yaser S. Abu-Mostafa. No part of these contents is to be communicated or made accessible to ANY other person or entity.