AllenDowney / ThinkBayes2

Text and code for the forthcoming second edition of Think Bayes, by Allen Downey.
http://allendowney.github.io/ThinkBayes2/
MIT License
1.8k stars 1.49k forks source link

I have problem in Cookie solution #19

Open jaffreyzhao opened 4 years ago

jaffreyzhao commented 4 years ago

In the Update function, I thought at next round, pmf[hypo] should be fixed at 0.5, because the prior won't change no matter how many cookies have been taken out

but in your solution, I saw the pmf[hypo] keeping change every time, am I wrong about Bayes's theorem in this situation?

ricardoV94 commented 4 years ago

I think you are confusing 1) the prior for the hypothesis of which bowl was selected (which should be updated with each observation) and 2) the prior probability of taking a type of cookie from each bowl (which in this problem is kept fixed). The latter is not even an hypothesis, its just given by the problem setting.