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

Example 6-8 number of Outperforming Portfolios #53

Closed Joseph-L-Morgan closed 1 year ago

Joseph-L-Morgan commented 2 years ago

First of all thank you for writing this book. It's been an informative read and the examples are fun and challenging.

That being said I believe there is a typo in Example 6-8: 312 outperforming portfolios must mean there are 430.5 honest members of congress. It is quite funny to say that there is a half-honest politician, but 313 outperforming portfolios does result in a whole number of honest and dishonest members of congress who add up to 538. So it makes more sense if the number of outperforming portfolios is 313.

Joseph-L-Morgan commented 2 years ago

In the likely event that I am incorrect here is how I reached that conclusion.

Total members of congress = 538 op = number of outperforming porfolios = 312 hc = honest chance = 50% or 0.5 dc = dishonest chance = 90% or 0.9 hm + dm = 538 or honest members + dishonest members = 538 (honest members honest chance) + (dishonest members dishonest chance) = 312

(honest members honest chance) + (dishonest members dishonest chance) + 226 = 538 (hm hc) + (dm dc) + 226 = hm + dm (hm hc) + [(538 - hm) dc] + 226 = (538 - hm) + hm (hm * 0.5) + [0.9(538 - hm)] + 226 = 538 0.5hm + 484.2 - 0.9hm = 312 -0.4hm = -172.2 hm = 430.5

AllenDowney commented 1 year ago

I'm not positive I understand the question, but it sounds like you are bothered by the fact that the mean of the posterior distribution is not an integer. I think that's normal. Like the average value if you roll a six-sided die is 3.5. But maybe I'm missing your point.