Foundations to Frontier
Tests
A. Mathematical Foundations › A4 Probability Theory › Basics

Sample Spaces, Events and the Axioms of Probability

Probability starts with three ingredients: the set of everything that could happen (the sample space), the questions you can ask about it (events), and a rule assigning numbers to those questions that obeys three axioms. Complements, inclusion–exclusion, the union bound and Monte Carlo all follow. Bertrand's paradox and random rotations show why 'at random' must always be made precise.

Level 0: Foundation

★☆☆☆☆ Introductory⏱ 5 minGeneral audience. No mathematics required.

What could happen?

Before guessing how likely something is, list everything that could happen. Toss a coin: heads or tails. Roll a die: 1 to 6. Roll two dice: 36 possible pairs. That list is the sample space. An event is any group of outcomes you care about, like “the dice add up to 7”.

If all outcomes are equally likely, a probability is just counting:

P(event)=outcomes in the eventall outcomesP(\text{event}) = \frac{\text{outcomes in the event}}{\text{all outcomes}}

Six of the 36 dice pairs add to 7, so P(sum=7)=6/36=1/6P(\text{sum} = 7) = 6/36 = 1/6.

Two dice: 36 equally likely outcomes, and events as sets
1,11,21,31,41,51,62,12,22,32,42,52,63,13,23,33,43,53,64,14,24,34,44,54,65,15,25,35,45,55,66,16,26,36,46,56,6rows: die 1 · columns: die 2
■ A only · ■ B only · ■ A ∩ B
P(A) = 11/36 = 0.3056
P(B) = 6/36 = 0.1667
P(A ∩ B) = 1/36 = 0.0278
P(A ∪ B) = 16/36 = 0.4444
inclusion–exclusion: P(A) + P(B) − P(A ∩ B) = 11 + 6 − 1 = 16/36 ✓
P(not A) = 1 − P(A) = 25/36 = 0.6944
frequency of A ∪ B = 0.4600 vs exact 0.4444 · error 0.0156 (typical size ≈ 0.0497)
An event is just a set of outcomes. With equally likely outcomes, probability = (cells in the event)/36. The simulated frequency wanders but settles near the exact value; its typical error shrinks like 1/√n.
Why engineers care

Will a satellite’s components all survive launch? What’s the chance a self-driving car’s sensors fail together? Reliability and risk engineering begin by writing down exactly what can happen, then assigning probabilities that obey a few unbreakable rules.

📝 Quick check (Level 0)
0/3 answered
  1. 1. How many outcomes do two dice have?
  2. 2. P(a fair die shows 3) = ?
  3. 3. P(not 3) = ?

Level 1: Beginner

★★☆☆☆ Basic⏱ 15 minSecondary-school mathematics: arithmetic and elementary algebra.

Events as sets

Events combine like sets:

Words Set Picture
A or B A∪BA\cup B either region
A and B A∩BA\cap B the overlap
not A AcA^c everything else
A and B can’t both happen A∩B=∅A\cap B = \varnothing disjoint

Kolmogorov’s three axioms (1933)

  1. P(A)≥0P(A)\ge0 for every event.
  2. P(Ω)=1P(\Omega) = 1.
  3. If A1,A2,…A_1, A_2, \dots are pairwise disjoint, then P(⋃Ai)=∑P(Ai)P(\bigcup A_i) = \sum P(A_i).

Everything else follows. For example:

  • P(Ac)=1−P(A)P(A^c) = 1 - P(A);
  • P(∅)=0P(\varnothing) = 0;
  • if A⊆BA\subseteq B, then P(A)≤P(B)P(A)\le P(B);
  • P(A∪B)=P(A)+P(B)−P(A∩B)P(A\cup B) = P(A) + P(B) - P(A\cap B).
📝 Quick check (Level 1)
0/3 answered
  1. 1. P(A) = 0.3 and P(B) = 0.5, disjoint. P(A ∪ B) = ?
  2. 2. P(at least one head in 2 tosses) = ?
  3. 3. Probabilities can be negative?

Level 2: Intermediate

★★★☆☆ Intermediate⏱ 40 minUndergraduate students and practising engineers.

Tools that follow from the axioms

  • Complement rule: “at least one” is often easiest as 1−P(none)1 - P(\text{none}). For instance, P(at least one 6 in 4 rolls)=1−(5/6)4≈0.518P(\text{at least one 6 in 4 rolls}) = 1 - (5/6)^4\approx0.518. That’s the Chevalier de Méré’s 1654 puzzle, which started probability theory in letters between Pascal and Fermat.
  • Inclusion–exclusion: P(A∪B∪C)=∑P(A)−∑P(A∩B)+P(A∩B∩C)P(A\cup B\cup C) = \sum P(A) - \sum P(A\cap B) + P(A\cap B\cap C), and so on for more events.
  • Union bound (Boole): P(⋃Ai)≤∑P(Ai)P(\bigcup A_i)\le\sum P(A_i). It’s crude but always true, and it needs no independence. It’s the workhorse of reliability bounds and learning-theory proofs (B1).
  • Bonferroni lower bound: P(A∩B)≥P(A)+P(B)−1P(A\cap B)\ge P(A) + P(B) - 1.

Monte Carlo

Simulate the experiment nn times and count how often AA happens. The frequency converges to P(A)P(A) (the law of large numbers, A4.3), with typical error P(1−P)/n\sqrt{P(1-P)/n}. Getting 10× more accuracy needs 100× more samples. When outcomes aren’t equally likely or can’t be counted, which is most real problems, simulation is how you compute probabilities.

🐍 Exercise 1: a probability space you can query
Build the two-dice sample space, compute exact event probabilities with fractions, verify the axioms, disjoint additivity, inclusion–exclusion and the complement rule, and measure the 1/√n Monte Carlo error.
📝 Quick check (Level 2)
0/3 answered
  1. 1. P(A) = 0.5, P(B) = 0.4, P(A ∩ B) = 0.2. P(A ∪ B) = ?
  2. 2. The union bound requires the events to be…
  3. 3. Monte Carlo error typically shrinks like…

Level 3: Advanced

★★★★☆ Advanced⏱ 40 minGraduate level, with full derivations and proofs.

Proofs from the axioms

  • Complement. AA and AcA^c are disjoint with union Ω\Omega, so P(A)+P(Ac)=1P(A) + P(A^c) = 1. ∎
  • Monotonicity. If A⊆BA\subseteq B, then B=A∪(B∖A)B = A\cup(B\setminus A) is a disjoint union. So P(B)=P(A)+P(B∖A)≥P(A)P(B) = P(A) + P(B\setminus A)\ge P(A). ∎
  • Inclusion–exclusion (2 sets). A∪B=A∪(B∖A)A\cup B = A\cup(B\setminus A) and B=(A∩B)∪(B∖A)B = (A\cap B)\cup(B\setminus A), both disjoint unions. Subtracting gives P(A∪B)=P(A)+P(B)−P(A∩B)P(A\cup B) = P(A) + P(B) - P(A\cap B). ∎
  • Union bound. Make the events disjoint with Bi=Ai∖⋃j<iAj⊆AiB_i = A_i\setminus\bigcup_{j<i}A_j\subseteq A_i. Then P(⋃Ai)=∑P(Bi)≤∑P(Ai)P(\bigcup A_i) = \sum P(B_i)\le\sum P(A_i). ∎

σ-algebras: why not every subset is an event

For uncountable Ω\Omega, such as a dart thrown at [0,1][0,1], you can’t consistently assign a “length” to every subset: the Vitali set is a counterexample. So events form a σ-algebra F\mathcal F: a collection containing Ω\Omega and closed under complements and countable unions. A probability space is the triple (Ω,F,P)(\Omega, \mathcal F, P). Countable additivity (axiom 3) is what makes limits work, for example P(An)↑P(⋃An)P(A_n)\uparrow P(\bigcup A_n) for increasing events. Measure theory (A4.3) builds on exactly this.

“Random” needs a measure

Bertrand’s paradox (1889): “pick a random chord of a circle; what’s the chance it’s longer than the side of the inscribed equilateral triangle?” There are three natural answers, 1/3, 1/2 and 1/4. Each is correct for a different probability measure on chords (Practice Code 5). The question is incomplete until (Ω,F,P)(\Omega, \mathcal F, P) is specified.

Exercise 3.1: Show P(∅) = 0 from the axioms

Ω=Ω∪∅∪∅∪⋯\Omega = \Omega\cup\varnothing\cup\varnothing\cup\cdots is a disjoint union, so 1=1+∑P(∅)1 = 1 + \sum P(\varnothing). That forces P(∅)=0P(\varnothing) = 0.

📝 Quick check (Level 3)
0/3 answered
  1. 1. Bertrand's paradox shows that…
  2. 2. A σ-algebra is closed under…
  3. 3. Monotonicity: A ⊆ B ⇒ …

Level 4: Expert

★★★★★ Expert⏱ 45 minResearchers: original papers and open problems.

Uniformly random rotations

Robots, drones and simulators constantly need “a random orientation”. You might use random initial poses for global localization, domain randomization in sim-to-real training (Tobin et al., 2017), sampling-based planning on SO(3)SO(3) (LaValle, 2006), or rotation data augmentation. The natural “uniform” measure on rotations is the Haar measure, which is invariant under rotating everything. Choosing Euler angles uniformly is not Haar: orientations pile up near the poles. Normalizing a 4-D Gaussian to a unit quaternion is exactly Haar (Shoemake, 1992). The rotation angle θ\theta then has density (1−cos⁡θ)/π(1-\cos\theta)/\pi on [0,π][0,\pi], so small rotations are rare.

🐍 Exercise 2 (research): what does 'uniformly random rotation' mean?
Sample rotations two ways: normalized-Gaussian quaternions (Haar) and uniform ZYZ Euler angles (naive). Check the Haar sample against the exact rotation-angle law, and show that naive Euler sampling piles the rotated axis up at the poles.

Probability spaces in practice

  • Reliability engineering. NASA’s probabilistic risk assessment builds fault trees from events like “valve A fails” and “sensor B fails”. It combines them with these rules, using inclusion–exclusion and rare-event approximations, to estimate mission-loss probabilities (Stamatelatos et al., 2011, NASA PRA Procedures Guide).
  • Safety-critical ML. Certifying “probability of failure below 10−910^{-9}” by plain Monte Carlo would need around 101010^{10} samples. Rare-event methods (importance sampling, subset simulation; Au and Beck, 2001) and union bounds are used instead, for example in autonomous-vehicle validation (Corso et al., 2021).
  • Generalization proofs. “With probability ≥1−δ\ge1-\delta, every hypothesis in a finite class has small error” comes from a union bound over the class (B1).

References

  1. A. N. Kolmogorov (1933). Grundbegriffe der Wahrscheinlichkeitsrechnung. Springer. (English: Foundations of the Theory of Probability, 1950.)
  2. W. Feller (1968). An Introduction to Probability Theory and Its Applications, Vol. 1, 3rd ed. Wiley.
  3. D. Bertsekas, J. Tsitsiklis (2008). Introduction to Probability, 2nd ed. Athena Scientific.
  4. J. Bertrand (1889). Calcul des probabilités. Gauthier-Villars.
  5. K. Shoemake (1992). “Uniform random rotations.” In Graphics Gems III. Academic Press.
  6. M. Stamatelatos et al. (2011). Probabilistic Risk Assessment Procedures Guide for NASA Managers and Practitioners, 2nd ed. NASA/SP-2011-3421.
  7. S.-K. Au, J. Beck (2001). “Estimation of small failure probabilities in high dimensions by subset simulation.” Probabilistic Engineering Mechanics, 16(4).
  8. A. Corso, R. Moss, M. Koren, R. Lee, M. Kochenderfer (2021). “A survey of algorithms for black-box safety validation of cyber-physical systems.” JAIR, 72.
  9. J. Tobin et al. (2017). “Domain randomization for transferring deep neural networks from simulation to the real world.” IROS.