-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Why are we subtracting 1 from each bowl (Chapter 2 Exercise: cookie problem) #28
Comments
Which file are you looking at? |
I am looking at 'cookie_soln.ipynb' in solutions folder. |
What I mean to state is that, there would be four different outcomes in the 2nd draw. Is it clearer? |
Yes, I see why this is confusing, but I think the solution is correct.
The first Hist represents the hypothesis that we are drawing from Bowl 1.
The second represents the hypothesis that we are drawing from Bowl 2.
When we draw the first cookie, we compute the likelihood of the data based on the old proportions.
And then we update the proportions.
When we draw the second cookie, we want to compute
P(data | both cookies are from Bowl 1)
and
P(data | both cookies are from Bowl 2)
So in both cases we should use the update proportions.
You are right that in the first scenario, Bowl 2 is unchanged.
And in the second scenario, Bowl 1 is unchanged.
But since we never refer to the proportions in the unused bowl, I didn't bother to represent it.
What do you think?
Allen
…On Sun, Jul 12, 2020, at 9:10 AM, A.Srivastava wrote:
IMG_20200712_150712 <https://user-images.githubusercontent.com/41738944/87247064-ac47c080-c451-11ea-886e-7059fcf03f77.jpg>
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#28 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAOLP3KFNDHTLD732RBLJULR3GY2VANCNFSM4OXLQ4WQ>.
|
Was the above solution confusing? I simply attempted to extend the suggested probabilities on paper. |
In the likelihood function, the data (i.e. the cookie flavor) is being subtracted from both bowl 1 and bowl 2 to obtain the new bowl/pmf data. I thought that after the first draw, there would be two scenarios.
1). The cookie was drawn from bowl 1, in which case, the data would only be subtracted from bowl 1 values.
2). The cookie was drawn from bowl 2, in which case, the data would only be subtracted from bowl 2 values.
Theses instances would then result in two different pmf data right?
1).
Hist({'vanilla': 29, 'chocolate': 10})
Hist({'vanilla': 20, 'chocolate': 20})
2).
Hist({'vanilla': 30, 'chocolate': 10})
Hist({'vanilla': 19, 'chocolate': 20})
The text was updated successfully, but these errors were encountered: