What is Bayes Theorem used for?
Answers
Answer:
Bayes’ Theorem is a way of finding a probability when we know certain other probabilities.
The formula is:
P(A|B) = P(A) P(B|A)P(B)
Which tells us: how often A happens given that B happens, written P(A|B),
When we know: how often B happens given that A happens, written P(B|A)
and how likely A is on its own, written P(A)
and how likely B is on its own, written P(B)
Let us say P(Fire) means how often there is fire, and P(Smoke) means how often we see smoke, then:
P(Fire|Smoke) means how often there is fire when we can see smoke
P(Smoke|Fire) means how often we can see smoke when there is fire
So the formula kind of tells us "forwards" P(Fire|Smoke) when we know "backwards" P(Smoke|Fire)
Example:
dangerous fires are rare (1%)
but smoke is fairly common (10%) due to barbecues,
and 90% of dangerous fires make smoke
We can then discover the probability of dangerous Fire when there is Smoke:
P(Fire|Smoke) = P(Fire) P(Smoke|Fire)P(Smoke)
= 1% x 90%10%
= 9%
So it is still worth checking out any smoke to be sure.
picnic
Example: Picnic Day
You are planning a picnic today, but the morning is cloudy
Oh no! 50% of all rainy days start off cloudy!
But cloudy mornings are common (about 40% of days start cloudy)
And this is usually a dry month (only 3 of 30 days tend to be rainy, or 10%)
What is the chance of rain during the day?
We will use Rain to mean rain during the day, and Cloud to mean cloudy morning.
The chance of Rain given Cloud is written P(Rain|Cloud)
So let's put that in the formula:
P(Rain|Cloud) = P(Rain) P(Cloud|Rain)P(Cloud)
P(Rain) is Probability of Rain = 10%
P(Cloud|Rain) is Probability of Cloud, given that Rain happens = 50%
P(Cloud) is Probability of Cloud = 40%
P(Rain|Cloud) = 0.1 x 0.50.4 = .125
Or a 12.5% chance of rain. Not too bad, let's have a picnic!
Just 4 Numbers
Imagine 100 people at a party, and you tally how many wear pink or not, and if a man or not, and get these numbers:
bayes table
Bayes' Theorem is based off just those 4 numbers!
Let us do some totals:
bayes table totals
And calculate some probabilities:
the probability of being a man is P(Man) = 40100 = 0.4
the probability of wearing pink is P(Pink) = 25100 = 0.25
the probability that a man wears pink is P(Pink|Man) = 540 = 0.125
the probability that a person wearing pink is a man P(Man|Pink) = ...
puppy rips
And then the puppy arrives! Such a cute puppy.
But alll your data is ripped up! Only 3 values survive:
P(Man) = 0.4,
P(Pink) = 0.25 and
P(Pink|Man) = 0.125
Can you discover P(Man|Pink) ?
Imagine a pink-wearing guest leaves money behind ... was it a man? We can answer this question using Bayes' Theorem:
P(Man|Pink) = P(Man) P(Pink|Man)P(Pink)
P(Man|Pink) = 0.4 × 0.1250.25 = 0.2
Note: if we still had the raw data we could calculate directly 525 = 0.2
Step-by-step explanation: