The Detective Story of Probability
Welcome, future engineer. Today, we are not just solving a probability problem; we are stepping into the shoes of a detective.
In probability, we often deal with 'forward' problems—where we know the cause and calculate the effect. But today, we are going to do something more thrilling: we are going to work backward from an effect to find its most likely cause.
This is the essence of Bayes' Theorem, and it is a tool that will serve you for the rest of your career.
Phase 1
The Setup
Imagine two urns sitting on your desk. Urn U1 is rich, holding 3 white and 2 red balls. Urn U2 is humble, holding only 1 white ball.
We are about to perform an experiment, but the rules of this experiment are dictated by the flip of a fair coin. This coin toss is our 'branching point.'
If it lands on Heads, we transfer 1 ball. If it lands on Tails, we transfer 2. This is the foundation of our entire calculation.
Phase 2
The Head Path
Let us explore the universe where the coin shows Heads. The probability of this is P(H)=21.
If we are in this universe, we draw 1 ball from U1. The probability of drawing a white ball is 53, and a red ball is 52.
Now, look at U2. If we transferred a white ball, U2 now contains 2 white balls and 0 red balls. The probability of drawing a white ball from U2 is now 1.
If we transferred a red ball, U2 contains 1 white and 1 red, making the probability 21. Combining these, the conditional probability P(W∣H) is:
P(W∣H)=(53⋅1)+(52⋅21)=54
Phase 3
The Tail Path
Now, let us step into the second universe: the Tail path. Here, we transfer 2 balls.
We must use combinations. The total ways to pick 2 balls from 5 is (25)=10.
The probability of picking 2 white balls is 10(23)=103. The probability of picking 2 red balls is 10(22)=101. The probability of picking 1 white and 1 red is 10(13)⋅(12)=106.
Now, we check U2 again. If 2 white balls were transferred, U2 has 3 white balls (P(W)=1). If 2 red balls were transferred, U2 has 1 white and 2 red (P(W)=31). If 1 of each was transferred, U2 has 2 white and 1 red (P(W)=32).
Summing these gives us P(W∣T):
P(W∣T)=(103⋅1)+(101⋅31)+(106⋅32)=1511
Phase 4
The Law of Total Probability
We have two universes. To find the total probability of drawing a white ball, we merge them using the Law of Total Probability:
P(W)=P(H)P(W∣H)+P(T)P(W∣T)
Substituting our values, we get:
P(W)=(21⋅54)+(21⋅1511)=52+3011=3023
This is the probability that, regardless of the coin toss, you will draw a white ball from U2.
Phase 5
The Detective Work (Bayes' Theorem)
Finally, we are told the ball drawn is white. We want to know: was it a Head? This is P(H∣W).
Bayes' Theorem tells us:
We have all the pieces. The numerator is 21⋅54=52. The denominator is 3023.
Dividing these, we get:
And there it is. We have successfully traced the effect back to its cause. The final probability is 2312.