Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
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.// 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