Probability

Go to Problems

Bayes Theorem

The Bayes’ theorem describes the probability of an event based on prior knowledge of the conditions that might be relevant to the event. It tells us how to invert conditional probabilities, i.e. to find P(B|A) from P(A|B).

 

The formula for Bayes’ Theorem:

 

Example 1:

 

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.

So let's put that in the formula:

 

P(Rain|Cloud) = P(Rain) x P(Cloud|Rain) / P(Cloud)

P(Rain|Cloud) = 0.1 x 0.5 / 0.4 = 0.125

 

Or a 12.5% chance of rain. Not too bad, let's have a picnic!

 

Example 2 :

 

Imagine there is a drug test that is 98% accurate, meaning 98% of the time it shows a true positive result for someone using the drug, and 98% of the time it shows a true negative result for nonusers of the drug. Next, assume 0.5% of people use the drug.

 If a person selected at random tests positive for the drug, the following calculation can be made to see whether the probability the person is actually a user of the drug.

 

(0.98 x 0.005) / [(0.98 x 0.005) + ((1 - 0.98) x (1 - 0.005))] = 0.0049 / (0.0049 + 0.0199) = 19.76%

 

Bayes' theorem shows that even if a person tested positive in this scenario, it is actually much more likely the person is not a user of the drug.

 

Serious about Learning Data Science and Machine Learning ?

Learn this and a lot more with Scaler's Data Science industry vetted curriculum.
Conditional probability
Problem Score Companies Time Status
Probability of Raining 30
10:23
How can he win? 30
BCG
8:14
White Marble Probability 30 3:42
Boy or girl paradox 30
5:34
Is it a queen? 30
4:45
Bayes theorem
Normal and continuous distribution
Problem Score Companies Time Status
Distribution Percentage 30 5:44
Random variables
Problem Score Companies Time Status
Product probability 30
12:43
Random variable's probability 30
7:05
New variance 30
8:11
Toss random variable 30
2:24
Probability distributions
Problem Score Companies Time Status
Standard deviation 30
3:02
Probability Distribution 50
18:06