Step 1: Identify the partition (causes/sources) Common setups: multiple bags, machines, factories, or coin types. These are the B_i events.
Step 2: Assign prior probabilities P(B_i) Often given directly (e.g., "bag chosen with probability 1/3") or derived from proportions.
Step 3: Determine likelihoods P(A|B_i) The probability of the observed event given each cause. E.g., P(red|Bag 1) = 3/7.
Step 4: Compute total probability P(A) P(A) = sum P(A|B_i)*P(B_i). This is the denominator.
Step 5: Apply Bayes' formula P(B_i|A) = P(A|B_i)*P(B_i)/P(A)
Example template: Three machines produce 20%, 30%, 50% of items with defect rates 5%, 3%, 2%.
- P(B_1)=0.2, P(B_2)=0.3, P(B_3)=0.5
- P(D|B_1)=0.05, P(D|B_2)=0.03, P(D|B_3)=0.02
- P(D) = 0.01+0.009+0.01 = 0.029
- P(B_1|D) = 0.01/0.029 = 10/29
Common traps:
- Confusing P(A|B) with P(B|A) — direction matters
- Forgetting to use total probability for the denominator
- Not partitioning the sample space correctly