LFD Book Forum  

Go Back   LFD Book Forum > Book Feedback - Learning From Data > Chapter 1 - The Learning Problem

Reply
 
Thread Tools Display Modes
  #1  
Old 08-22-2015, 02:50 PM
Rotimi Rotimi is offline
Junior Member
 
Join Date: Aug 2015
Posts: 3
Default Problem 1.1

I could not use Bayes' theorem to solve Problem 1.1 but I thought of an 'alternative' method which gave me the answer 2/3. I want to know if this method is right or not. It's as follows:

Since there are 2 black balls and 1 white ball left are choosing the first black ball, the chances that the second ball is black is 2/3 since there are 3 balls left.

Is this method right or not?
Reply With Quote
  #2  
Old 08-23-2015, 11:11 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Problem 1.1

Quote:
Originally Posted by Rotimi View Post
I could not use Bayes' theorem to solve Problem 1.1 but I thought of an 'alternative' method which gave me the answer 2/3. I want to know if this method is right or not. It's as follows:

Since there are 2 black balls and 1 white ball left are choosing the first black ball, the chances that the second ball is black is 2/3 since there are 3 balls left.

Is this method right or not?
This would have been right if the question had specified that we picked the second ball from all remaining balls. However, the second ball is picked only from the same bag that produced the first (black) ball, so the logic of the problem is different.

For instance, if we changed the statement of the problem to having two bags one with two black balls and one with two white balls, and you picked a bag that produced a black ball, the second ball will be black with probability 100%, notwithstanding that the total remaining balls in both bags are two white and one black.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #3  
Old 09-09-2015, 12:48 PM
eshmrt eshmrt is offline
Junior Member
 
Join Date: Sep 2015
Posts: 2
Default Re: Problem 1.1

Can you elaborate on the hint for this problem? It seems to me that in your alternative problem you aren't using Bayes' Theorem. Wouldn't using Bays' dictate that you would say P[A|B] stands for the probability that the second ball is black assuming that the first ball is black, which in your problem would be 100% and P[B] stands for the probability that the first ball is black, which would be 50% because either the bag with two white balls or the bag with two black balls could be chosen. Therefore P[A|B]P[B] = 1/2.

I understand your result intuitively. I just don't understand how Bayes' Theorem is being applied to arrive at that result as direction by the hint in the textbook.
Reply With Quote
  #4  
Old 09-09-2015, 11:20 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Problem 1.1

Quote:
Originally Posted by eshmrt View Post
Can you elaborate on the hint for this problem? It seems to me that in your alternative problem you aren't using Bayes' Theorem. Wouldn't using Bays' dictate that you would say P[A|B] stands for the probability that the second ball is black assuming that the first ball is black, which in your problem would be 100% and P[B] stands for the probability that the first ball is black, which would be 50% because either the bag with two white balls or the bag with two black balls could be chosen. Therefore P[A|B]P[B] = 1/2.

I understand your result intuitively. I just don't understand how Bayes' Theorem is being applied to arrive at that result as direction by the hint in the textbook.
Your calculation is correct, but what you are calculating is the joint probability. What the problem asks for is the conditional probability. You got both right.

In the original problem, the conditional probability is not as straightforward to compute as in the simplified case here. One way to use Bayes' theorem in the original problem is to determine the joint P(A,B) for all combinations of A and B, and from that you can calculate all other probabilities including the conditional probability.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #5  
Old 12-07-2015, 05:28 AM
henry2015 henry2015 is offline
Member
 
Join Date: Aug 2015
Posts: 31
Default Re: Problem 1.1

Hi professor, with your example -- having two bags one with two black balls and one with two white balls.

I thought we had:
P[first ball is black] = P[B] = 1/2
P[first ball is black and second ball is back] = P[A and B] = 1/2
P[second ball is black given first ball is back] = P[A | B]
= P[A and B] / P[B] (by Bayes' Theorem)
= 1/2 / 1/2
= 1

eshmrt said "P[A|B]P[B] = 1/2" and you said the calculation is right...so I am confused.

Maybe I miss something...
Reply With Quote
  #6  
Old 12-08-2015, 02:57 AM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Problem 1.1

Quote:
Originally Posted by henry2015 View Post
Hi professor, with your example -- having two bags one with two black balls and one with two white balls.

I thought we had:
P[first ball is black] = P[B] = 1/2
P[first ball is black and second ball is back] = P[A and B] = 1/2
P[second ball is black given first ball is back] = P[A | B]
= P[A and B] / P[B] (by Bayes' Theorem)
= 1/2 / 1/2
= 1

eshmrt said "P[A|B]P[B] = 1/2" and you said the calculation is right...so I am confused.

Maybe I miss something...
I can't see the discrepancy that is confusing you. "P[A|B]P[B] = 1/2" is correct because P[B]=1/2 and P[A|B]=1, both of which you correctly arrived at.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
  #7  
Old 12-09-2015, 02:37 AM
henry2015 henry2015 is offline
Member
 
Join Date: Aug 2015
Posts: 31
Default Re: Problem 1.1

Argh, sorry, my bad. misread the symbol.

Thanks for confirming
Reply With Quote
  #8  
Old 12-09-2015, 08:01 PM
yaser's Avatar
yaser yaser is offline
Caltech
 
Join Date: Aug 2009
Location: Pasadena, California, USA
Posts: 1,477
Default Re: Problem 1.1

Quote:
Originally Posted by henry2015 View Post
Argh, sorry, my bad. misread the symbol.
No worries. Happens in the best families.
__________________
Where everyone thinks alike, no one thinks very much
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:24 AM.


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.