Skip to content
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

Open
akshat1995-sc opened this issue Jul 11, 2020 · 7 comments

Comments

@akshat1995-sc
Copy link

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})

@akshat1995-sc akshat1995-sc changed the title Why are we subtracting 1 from each bowl Why are we subtracting 1 from each bowl (Chapter 2 Exercise: cookie problem) Jul 11, 2020
@AllenDowney
Copy link
Owner

Which file are you looking at?

@akshat1995-sc
Copy link
Author

I am looking at 'cookie_soln.ipynb' in solutions folder.

@akshat1995-sc
Copy link
Author

IMG_20200712_150712

@akshat1995-sc
Copy link
Author

akshat1995-sc commented Jul 12, 2020

What I mean to state is that, there would be four different outcomes in the 2nd draw.
P(B1 | Choc, A_1), P(B2 | Choc, A_1), P(B1 | Choc, B_2), P(B2 | Choc, B_2).
with the notations as follows:
A: Vanilla draw from bowl 1
B: Vanilla draw from bowl 2
A_1 : Event A in draw no.1
A_2 : Event A in draw no. 2
B1: current draw from bowl 1
B2: current draw from bowl 2

Is it clearer?

@AllenDowney
Copy link
Owner

AllenDowney commented Jul 12, 2020 via email

@akshat1995-sc
Copy link
Author

akshat1995-sc commented Jul 13, 2020

I attempted to evaluate the following values using the aforementioned table (i.e the updated content of bowls) in picture above.
P(data | both cookies are from Bowl 1), and
P(data | both cookies are from Bowl 2)

The result is quite different from the ones obtained in 'cookie_soln.ipynb'. Please check the image. Do you think I am missing something?
IMG_20200713_090514

@akshat1995-sc
Copy link
Author

akshat1995-sc commented Jul 22, 2020

Was the above solution confusing? I simply attempted to extend the suggested probabilities on paper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants