# Statistics For Programmers - Bayes Theorem

Bayes Theorem is a fundamental concept in statistics and probability theory. It provides a way to update the probability of a hypothesis based on new evidence or information. It's particularly useful in situations where have some knowledge about the efficacy of a test or the prevalence of a condition in a population.

Bayes Theorem is expressed as follows:

\[ P(A|B) = \frac{P(B|A) \times P(A)}{P(B)} \]

Where:

- \( P(A|B) \) is the probability of event A given event B
- \( P(B|A) \) is the probability of event B given event A
- \( P(A) \) is the prior probability of event A
- \( P(B) \) is the prior probability of event B

Let's take a look at an example,

A population is experiencing an outbreak of a condition that affects 1% of the total population. In response, a test has been developed that correctly identifies the condition 95% of the time. However, the test incorrectly flags healthy individuals as having the condition 3% of the time.

Given this information, what is the probability that an individual has the condition if they test positive?