I derived Bayes’ Theorem and the basic rule for conditional probabilities today while trying to find the answer to a question.
I had seen Bayes’ Theorem before, but never really understood it and certainly had never memorized it. The only relevant knowledge I had was:
That the syntax for “probability of A given B” is p(A|B)
That you can multiply independent probabilities to do AND, but aren’t allowed to do that if they are dependent
I was surprised at how it followed directly from intuition and the last bullet point above. I put together a toy problem involving the probability that I go outside depending on if it’s raining or not and was able to derive Bayes’ Theorem essentially from first principles. Not a groundbreaking accomplishment or anything, but I know I’ll never forget any of it now!
The line of reasoning was really simple once I was able to distill it:
I can simulate the probability that I’m outside given that it’s raining by first rolling a die to see if it’s raining, and if it is, then rolling another die to see if I’m outside, since I already know it’s raining.
These are clearly independent events, so I should be able to multiply their probabilities to get the probability of their conjunction.
What does the conjunction mean? Intuitively, I’m outside and it’s raining exactly when each of those die rolls turned up True, so this multiplication must give the probability that I’m outside and it’s raining: p(outside|raining) * p(raining) = p(outside AND raining)
And if that works, then symmetrically, this same probability p(outside AND raining) should also be equal to the probability that it’s raining given that I’m outside times the probability that I’m outside.
Isolate p(outside|raining) on one side of the equation and Boom: Bayes’ Theorem.
I derived Bayes’ Theorem and the basic rule for conditional probabilities today while trying to find the answer to a question.
I had seen Bayes’ Theorem before, but never really understood it and certainly had never memorized it. The only relevant knowledge I had was:
That the syntax for “probability of A given B” is p(A|B)
That you can multiply independent probabilities to do AND, but aren’t allowed to do that if they are dependent
I was surprised at how it followed directly from intuition and the last bullet point above. I put together a toy problem involving the probability that I go outside depending on if it’s raining or not and was able to derive Bayes’ Theorem essentially from first principles. Not a groundbreaking accomplishment or anything, but I know I’ll never forget any of it now!
The line of reasoning was really simple once I was able to distill it:
I can simulate the probability that I’m outside given that it’s raining by first rolling a die to see if it’s raining, and if it is, then rolling another die to see if I’m outside, since I already know it’s raining.
These are clearly independent events, so I should be able to multiply their probabilities to get the probability of their conjunction.
What does the conjunction mean? Intuitively, I’m outside and it’s raining exactly when each of those die rolls turned up True, so this multiplication must give the probability that I’m outside and it’s raining: p(outside|raining) * p(raining) = p(outside AND raining)
And if that works, then symmetrically, this same probability p(outside AND raining) should also be equal to the probability that it’s raining given that I’m outside times the probability that I’m outside.
Isolate p(outside|raining) on one side of the equation and Boom: Bayes’ Theorem.
p(A|B) p(B) = p(A & B) = p(B|A) p(A)
p(A|B) p(B) = p(B|A) p(A)
p(A|B) = [p(B|A) * p(A)] / p(B)