Open this lesson in your favourite AI. It'll walk you through the why, explain the demo, and quiz you on the try-it list.
The multiplication rule is just the conditional formula rearranged, but it is the workhorse for compound events: 'first this, then that.' Its companion, independence — the statement that — is one of the most casually-assumed and most often-wrong assumptions in applied stats. Builders assume IID samples, independent failure modes, independent feature dimensions, independent A/B test arms, and the assumption fails silently. Knowing exactly what independence asserts (and what it does not — pairwise vs mutual, conditional vs marginal) is how you avoid producing confidently wrong numbers.
Two events are independent iff knowing one does not change the probability of the other. The multiplication rule then collapses: the joint factorises into the marginals. For more than two events, mutual independence requires the factorisation to hold for every sub-collection — pairwise is not enough.
True for AB, AC, BC, but the triple prints False. This is the canonical example of pairwise-but-not-mutually-independent. Stare at it until it stops feeling weird.w[2] == 1 (third flip is H). Verify all four checks now print True — independent flips are mutually independent.Use these three in order. Each builds on the one before.
In one paragraph, explain the multiplication rule and define independence in plain English. Give one everyday example where independence holds and one where people *assume* it holds but it does not (e.g., consecutive emails being spam).
Walk me through the proof that $A \perp B$ implies $A^c \perp B$ and $A \perp B^c$. Then explain why pairwise independence does not imply mutual independence using the three-coin parity example.
In a system with $n$ components that are claimed to fail independently, you observe an empirical correlation in failures. Outline three concrete reasons the independence assumption could fail (shared cause, sequential dependence, common environment) and how you would diagnose each from data.
// main.go
package main
import "fmt"
// omega is the sample space: all 3-flip outcomes (3 fair coin flips)
var omega [][3]int
func init() {
for a := 0; a <= 1; a++ {
for b := 0; b <= 1; b++ {
for c := 0; c <= 1; c++ {
omega = append(omega, [3]int{a, b, c})
}
}
}
}
func prob(event func([3]int) bool) float64 {
count := 0
for _, w := range omega {
if event(w) {
count++
}
}
return float64(count) / float64(len(omega))
}
func main() {
A := func(w [3]int) bool { return w[0] == 1 } // flip 1 = H
B := func(w [3]int) bool { return w[1] == 1 } // flip 2 = H
C := func(w [3]int) bool { return (w[0]+w[1]+w[2])%2 == 0 } // even number of H
pAB := prob(func(w [3]int) bool { return A(w) && B(w) })
fmt.Printf("P(A)P(B) = %g P(A and B) = %g\n", prob(A)*prob(B), pAB)
pAC := prob(func(w [3]int) bool { return A(w) && C(w) })
fmt.Printf("Pairwise AC: %v\n", pAC == prob(A)*prob(C))
pBC := prob(func(w [3]int) bool { return B(w) && C(w) })
fmt.Printf("Pairwise BC: %v\n", pBC == prob(B)*prob(C))
pABC := prob(func(w [3]int) bool { return A(w) && B(w) && C(w) })
fmt.Printf("Triple ABC : %v\n", pABC == prob(A)*prob(B)*prob(C))
}
go run main.go