Bayes’ Theorem

Bayes Theorem annotated.

Bayes' Theorem is a way of finding a probability when we know certain other probabilities.

Here you will find my attempt to offer an intuitive explanation of Bayesian Theorem and reasoning.

// x: prior probability
// y: probability of occurrence, given hypothesis is true
// z: probability of occurrence, given hypothesis is false
bayes = (x, y, z) => (x * y) / ((x * y) + z * (1 - x))

You come home to find another person's underwear on your bed. is your spouse cheating?

cheating = 0.29

cheating = bayes(0.04, 0.5, 0.05)

Chance you have breast cancer if you get a positive mammogram in your 40s

mammogram40s = 0.0962

mammogram40s = bayes(0.014, 0.75, 0.1)

Probability the first 9/11 plane was a terrorist attack

first911 = 0.3846

first911 = bayes(0.00005, 1, 0.00008)

Probability the second 9/11 plane was a terrorist attack

second911 = 0.999

second911 = bayes(first911, 1, 0.00008)