Search⌘ K

Conditional Probability and Bayes Theorem

Explore the fundamentals of conditional probability and Bayes theorem to understand how probabilities update with new information. This lesson helps you calculate conditional probabilities and apply Bayes theorem to real-world problems using statistical concepts vital for data science.

Conditional probability

The probability of an event B occurring when an event A has occurred is called conditional probability. It is denoted as P(B|A), and it is read as “The probability that B occurs given A has occurred”.

It is calculated using the formula below.


P(B | A) = P (A \cap B) / P(A) given P(A) > 0


Here, P(A) is the probability of A and P(A \cap B) is the joint probability of A and B.

Example

A math teacher gave her class two tests. 25% of the class passed both tests and 45% of the class passed the first test. What percent of those who passed the first test also passed the second test?

Solution

From the above question, we can deduce the following:

  • Let A be the event that each class passed the first test. Then P(A) = 0.45

  • Let B be the event that each class passed the second test.

  • The joint probability that each class passed both tests is P(A \cap B) = 0.25.

  • P(B | A) = ?

P(B | A) = P (A ...