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

Oliver Problem - Chapter 6 - General Question #61

Closed davidwanner-8451 closed 1 year ago

davidwanner-8451 commented 2 years ago

Brief Background

Working through this excellent book with a colleague and he noticed something interesting on the Oliver's Blood problem.

Original solution, assuming 60% of local pop have type O and 1% have type AB:

like1 = 0.01
like2 = 2 * 0.6 * 0.01

likelihood_ratio = like1 / like2
post_odds = 1 * like1 / like2
prob(post_odds) # 0.454545

The interesting point mentioned by my colleague was this:

import numpy as np

def prob(o):
    return o / (o+1)

o = 0.6 # we fix type o proportion in local pop

# iterate over various ab vals
for ab in np.linspace(0.02, 0.40, 20):
  like1 = ab
  like2 = 2 * o * ab

  assert round(prob(like1 / like2),4) == 0.4545

Clearly the ab cancel one another out in each likelihood calculation.

Curiosity

My interpretation of this is that the information on percent of local population with type AB does not matter for this problem. Is there additional insight or context you could add to this? My colleague & I were both a bit surprised, but the math is clear enough.

Another thought: Perhaps we have to assume the possibility that the proportion of O would shift as AB changes, which would indeed change the final probabilities (even though there are more blood types than O and AB)

Again, no bug found - just curious about any additional commentary on the above. We are very much enjoying the book and exercises.

AllenDowney commented 1 year ago

Interesting. Sounds like you answered your own question. Thanks for sharing it!