Bayes Theorem in Probability Theory
Bayes Theorem in Probability Theory
In probability theory, Bayes’ Theorem is a fundamental concept used to determine the likelihood of an event based on prior knowledge of related conditions. It helps update the probability of a hypothesis as more evidence or information becomes available. Bayes’ Theorem plays a key role in statistical inference, decision-making, and artificial intelligence.
Bayes’ Theorem allows us to reverse conditional probabilities. It provides a way to update our belief or probability about an event, after taking new evidence into account. It is based on the concept of conditional probability, which is the probability of an event occurring given that another event has already occurred.
Mathematical Formula
The formula for Bayes’ Theorem is as follows:
P(A | B) = [ P(B | A) × P(A) ] / P(B)
Where:
- P(A | B): Probability of event A occurring given that B is true (posterior probability)
- P(B | A): Probability of event B occurring given that A is true (likelihood)
- P(A): Probability of event A occurring (prior probability)
- P(B): Probability of event B occurring (marginal probability)
Uses of Bayes’ Theorem
Some of the uses are as follows:
- Medical testing: Estimating the likelihood of a disease given a positive test result
- Spam filtering: Identifying whether an email is spam based on word frequencies
- Machine learning: Updating predictions and models based on new data
- Finance: Risk analysis and decision-making under uncertainty
- Legal reasoning: Evaluating the probability of guilt based on presented evidence
Basic Example
Imagine a factory that has two machines, Machine A and Machine B. Machine A produces 60% of the total products, and Machine B produces 40%. However, 1% of the products from Machine A are defective, while 2% from Machine B are defective.
If a randomly selected product from the factory is found to be defective, what is the probability that it was produced by Machine B?

Let:
- A: Product is from Machine A
- B: Product is from Machine B
- D: Product is defective
We are given:
- P(A) = 0.6
- P(B) = 0.4
- P(D | A) = 0.01
- P(D | B) = 0.02
First calculate P(D):
P(D) = P(D | A) × P(A) + P(D | B) × P(B)
P(D) = (0.01 × 0.6) + (0.02 × 0.4) = 0.006 + 0.008 = 0.014
Now apply Bayes’ Theorem:
P(B | D) = (P(D | B) × P(B)) / P(D)
P(B | D) = (0.02 × 0.4) / 0.014 = 0.008 / 0.014 ≈ 0.5714
Therefore, if a product is found to be defective, there is approximately a 57.14% chance that it came from Machine B.