Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
Kolmogorov's three axioms are the entire foundation of modern probability theory in three lines. Every theorem you will meet in this course — Bayes' rule, the law of large numbers, the central limit theorem, hypothesis testing — is downstream of them. The reason they matter to me as a builder is that I keep encountering 'probability bugs' in code and in arguments that turn out to be a quiet violation of one of the three: probabilities summing to more than 1, a negative weight assigned to an unlikely event, or 'or' being computed without checking disjointness. Memorize these three lines and you will catch a class of mistakes for the rest of your career.
A probability measure on a sample space assigns a number in to each event, subject to three axioms: non-negativity, normalisation, and countable additivity over pairwise disjoint events.
'd': 0.4 to 'd': 0.5 and re-run — the second assertion should fire. Which axiom did that violate, and why?'e': -0.1 and rebalance 'd' so the total is still 1. Now the first assertion fires. Identify which axiom that catches.// main.go
package main
import (
"fmt"
"math"
)
func main() {
// A discrete probability measure on a 4-outcome space
P := map[string]float64{"a": 0.1, "b": 0.2, "c": 0.3, "d": 0.4}
// Axiom 1: all probabilities >= 0
for _, p := range P {
if p < 0 {
panic("axiom 1 violated")
}
}
// Axiom 2: probabilities sum to 1
sum := 0.0
for _, p := range P {
sum += p
}
if math.Abs(sum-1) >= 1e-12 {
panic("axiom 2 violated")
}
prob := func(event []string) float64 {
total := 0.0
for _, w := range event {
total += P[w]
}
return total
}
fmt.Println(prob([]string{"a", "b"})) // 0.3
fmt.Println(prob([]string{"a", "b", "c", "d"})) // 1.0 — axiom 2 by example
// Axiom 3 by example: disjoint union
fmt.Println(prob([]string{"a"})+prob([]string{"b", "c"}) == prob([]string{"a", "b", "c"}))
}go run main.go