Explain bayes theorem of probability with example

Mathematics

ScanSolve AI Answer

Bayes' theorem is a fundamental concept in probability theory that describes how to update the probability of a hypothesis based on new evidence. It's expressed as:

P(A∣B)=P(B∣A)P(A)P(B)P(A|B) = \frac{P(B|A)P(A)}{P(B)}

Where:

  • P(A∣B)P(A|B) is the posterior probability: the probability of hypothesis A given evidence B.
  • P(B∣A)P(B|A) is the likelihood: the probability of evidence B given hypothesis A.
  • P(A)P(A) is the prior probability: the initial probability of hypothesis A before observing evidence B.
  • P(B)P(B) is the probability of the evidence: the overall probability of observing evidence B.

Example:
Suppose a medical test for a rare disease is 99% accurate (meaning it correctly identifies 99% of people who have the disease and correctly identifies 99% of people who don't have the disease). The disease affects 0.1% of the population. If a person tests positive, what is the probability they actually have the disease?

Let A be the event that a person has the disease, and B be the event that the person tests positive.

  • P(A)=0.001P(A) = 0.001 (prior probability of having the disease)
  • P(B∣A)=0.99P(B|A) = 0.99 (probability of testing positive given you have the disease - true positive rate)
  • P(not A)=0.999P(\text{not } A) = 0.999 (prior probability of not having the disease)
  • P(B∣not A)=0.01P(B|\text{not } A) = 0.01 (probability of testing positive given you don't have the disease - false positive rate)

We need to find P(A∣B)P(A|B). First, calculate P(B)P(B):
P(B)=P(B∣A)P(A)+P(B∣not A)P(not A)P(B) = P(B|A)P(A) + P(B|\text{not } A)P(\text{not } A)
P(B)=(0.99×0.001)+(0.01×0.999)P(B) = (0.99 \times 0.001) + (0.01 \times 0.999)
P(B)=0.00099+0.00999=0.01098P(B) = 0.00099 + 0.00999 = 0.01098

Now, apply Bayes' theorem:
P(A∣B)=P(B∣A)P(A)P(B)=0.99×0.0010.01098=0.000990.01098≈0.09016P(A|B) = \frac{P(B|A)P(A)}{P(B)} = \frac{0.99 \times 0.001}{0.01098} = \frac{0.00099}{0.01098} \approx 0.09016

So, even with a positive test, the probability of actually having the disease is only about 9.02%, due to the rarity of the disease.

Was this helpful?

Still stuck on this one?

Ask a follow-up, and the answer starts from this question.

Got a different question?Ask your own question