Probability Theory Module

Probability Axioms & Measure Foundations

Rigorous foundations of probability theory: sample spaces, sigma-algebras, Kolmogorov axioms, continuity of probability, and union bounds.

1. The Anatomy of Uncertainty

At its mathematical foundation, probability theory is a specialized branch of measure theory. Prior to Andrey Kolmogorov's formalization in 1933, probability suffered from logical paradoxes (such as Bertrand's paradox) because it lacked a rigorous axiomatic framework.
Modern probability defines an experiment through a formal probability space, known as a Probability Triple:
$$(\Omega, \mathcal{F}, P)$$
text
+-----------------------------------------------------------------------------------------+
|                                  THE PROBABILITY TRIPLE                                 |
+-----------------------------------------------------------------------------------------+
|                                                                                         |
|       +-------------------------------------------------------------------------+       |
|       | SAMPLE SPACE (Omega)                                                    |       |
|       | Set of ALL conceivable elementary outcomes omega.                        |       |
|       | Example: Omega = {000, 001, 010, 011, 100, 101, 110, 111}               |       |
|       |                                                                         |       |
|       |     +-------------------------------------------------------------+     |       |
|       |     | SIGMA-ALGEBRA (F)                                            |     |       |
|       |     | Collection of measurable subsets (events A in F).           |     |       |
|       |     | Closed under complements and countable unions.              |     |       |
|       |     |                                                             |     |       |
|       |     |     +-------------------------------------------------+     |     |       |
|       |     |     | PROBABILITY MEASURE (P)                         |     |     |       |
|       |     |     | Function P: F -> [0, 1]                         |     |     |       |
|       |     |     | Assigns weight satisfying Kolmogorov's axioms.   |     |     |       |
|       |     |     +-------------------------------------------------+     |     |       |
|       |     +-------------------------------------------------------------+     |       |
|       +-------------------------------------------------------------------------+       |
+-----------------------------------------------------------------------------------------+

2. Formal Definitions

2.1 The Sample Space ($\Omega$)

The sample space $\Omega$ is the set of all possible fundamental outcomes $\omega$ of a random experiment:
  • Discrete Sample Space: Finite or countably infinite. $$\Omega_{\text{coin}} = {H, T}, \quad \Omega_{\text{packets}} = {0, 1, 2, 3, \dots} = \mathbb{N}$$
  • Continuous Sample Space: Uncountably infinite (e.g., continuous server request latency). $$\Omega_{\text{latency}} = [0, \infty) \subset \mathbb{R}$$

2.2 The $\sigma$-Algebra ($\mathcal{F}$)

An event $A$ is a subset of $\Omega$ ($A \subseteq \Omega$). However, when $\Omega$ is uncountable (such as the real line $\mathbb{R}$), treating every arbitrary subset as an event leads to mathematical impossibilities (such as the Banach-Tarski paradox and non-measurable sets via the Axiom of Choice).
Therefore, events must belong to a $\sigma$-algebra (or $\sigma$-field) $\mathcal{F}$, which is a collection of subsets of $\Omega$ satisfying three conditions:
  1. Contains the whole space: $$\Omega \in \mathcal{F}$$
  2. Closed under complementation: $$A \in \mathcal{F} \implies A^c = (\Omega \setminus A) \in \mathcal{F}$$
  3. Closed under countable unions: $$A_1, A_2, A_3, \dots \in \mathcal{F} \implies \bigcup_{i=1}^{\infty} A_i \in \mathcal{F}$$
Key Consequence: By De Morgan's laws ($\bigcap_i A_i = (\bigcup_i A_i^c)^c$), a $\sigma$-algebra is also automatically closed under countable intersections. For continuous domains $\mathbb{R}$, we use the Borel $\sigma$-algebra $\mathcal{B}(\mathbb{R})$, generated by all open intervals $(a, b)$.

3. The Kolmogorov Axioms

A probability measure is a function $P: \mathcal{F} \to [0, 1]$ satisfying Kolmogorov's three axioms:

Axiom 1: Non-Negativity

For every event $A \in \mathcal{F}$: $$P(A) \ge 0$$

Axiom 2: Normalization (Unit Measure)

The probability of the entire sample space is 1: $$P(\Omega) = 1$$

Axiom 3: Countable Additivity ($\sigma$-Additivity)

If ${A_i}_{i=1}^{\infty}$ is a countable collection of pairwise disjoint events ($A_i \cap A_j = \emptyset$ for all $i \neq j$):
$$P\left(\bigcup_{i=1}^{\infty} A_i\right) = \sum_{i=1}^{\infty} P(A_i)$$

4. Fundamental Theorems & Properties

From these three simple axioms, all classical laws of probability can be deduced with strict deductive logic:

Theorem 4.1: Probability of the Empty Set

$$P(\emptyset) = 0$$
Proof: Let $A_1 = \Omega$, and $A_i = \emptyset$ for all $i \ge 2$. All $A_i$ are pairwise disjoint. By Axiom 3: $$P(\Omega) = P\left(\bigcup_{i=1}^{\infty} A_i\right) = P(\Omega) + \sum_{i=2}^{\infty} P(\emptyset)$$ Since $P(\Omega) = 1$, subtracting 1 yields $\sum_{i=2}^{\infty} P(\emptyset) = 0$. Since $P(\emptyset) \ge 0$ by Axiom 1, $P(\emptyset) = 0$. $\blacksquare$

Theorem 4.2: Complement Rule

$$P(A^c) = 1 - P(A)$$
Proof: $\Omega = A \cup A^c$, and $A \cap A^c = \emptyset$. By Axioms 2 and 3: $$1 = P(\Omega) = P(A \cup A^c) = P(A) + P(A^c) \implies P(A^c) = 1 - P(A) \quad \blacksquare$$

Theorem 4.3: Monotonicity

If $A \subseteq B$, then $P(A) \le P(B)$.
Proof: We can decompose $B$ into disjoint components: $B = A \cup (B \setminus A)$ where $A \cap (B \setminus A) = \emptyset$. $$P(B) = P(A) + P(B \setminus A)$$ Since $P(B \setminus A) \ge 0$ (Axiom 1), it follows that $P(B) \ge P(A)$. $\blacksquare$

Theorem 4.4: Continuity of Probability

Probability measures are continuous from below and from above:
  1. Continuity from below: If $A_1 \subseteq A_2 \subseteq A_3 \subseteq \dots$ and $\lim_{n \to \infty} A_n = \bigcup_{n=1}^\infty A_n = A$, then: $$\lim_{n \to \infty} P(A_n) = P(A)$$
  2. Continuity from above: If $B_1 \supseteq B_2 \supseteq B_3 \supseteq \dots$ and $\lim_{n \to \infty} B_n = \bigcap_{n=1}^\infty B_n = B$, then: $$\lim_{n \to \infty} P(B_n) = P(B)$$

5. Union Bounds: Boole's and Bonferroni's Inequalities

In theoretical computer science and randomized algorithm analysis, computing exact probabilities for unions of non-disjoint events is often intractable. We rely on Union Bounds.

Boole's Inequality (First Union Bound)

For any countable collection of events $A_1, A_2, \dots$:
$$P\left(\bigcup_{i=1}^n A_i\right) \le \sum_{i=1}^n P(A_i)$$
text
Venn Diagram Visualization:
+-------------------------------+
| Omega                         |
|      +----------+             |
|     /    A1      \            |
|    |      +-------+----+      |
|    |      | A1 n A2    |      |  Overlapping area is counted
|     \    +-------+----+       |  twice by sum(P(Ai)).
|      +--/-------+             |  Therefore: P(A1 u A2) <= P(A1) + P(A2)
|        /    A2   \            |
|       +----------+            |
+-------------------------------+

Bonferroni's Generalized Bounds

By alternating additions and subtractions of multi-way intersections:
$$P\left(\bigcup_{i=1}^n A_i\right) \ge \sum_{i} P(A_i) - \sum_{i < j} P(A_i \cap A_j)$$
$$P\left(\bigcup_{i=1}^n A_i\right) \le \sum_{i} P(A_i) - \sum_{i < j} P(A_i \cap A_j) + \sum_{i < j < k} P(A_i \cap A_j \cap A_k)$$

6. Real-World Engineering Application: Microservice SLA Availability

Consider a distributed system with $k = 50$ microservices, where each microservice fails independently in a given hour with probability $p_i = 0.001$ ($99.9%$ reliability). Let $E_i$ be the failure event of microservice $i$. The entire platform suffers a system outage if at least one service fails:
$$\text{Outage Event} = \bigcup_{i=1}^{50} E_i$$
Using Boole's union bound: $$P(\text{Outage}) \le \sum_{i=1}^{50} P(E_i) = 50 \times 0.001 = 0.05 \quad (5% \text{ upper bound})$$
Because services are independent, the exact outage probability is: $$P(\text{Outage}) = 1 - \prod_{i=1}^{50} (1 - P(E_i)) = 1 - (1 - 0.001)^{50} = 1 - 0.9512 = 0.0488 \quad (4.88%)$$
Boole's union bound provides a safe, conservative estimate ($5% \text{ vs } 4.88%$) requiring zero assumptions about mutual independence.

7. Python Implementation: Verifying Measure Axioms & Bounds

python
import numpy as np

def verify_kolmogorov_axioms(trials: int = 1_000_000):
    """
    Monte Carlo verification of Kolmogorov axioms and Boole's inequality
    using simulated distributed cache nodes with correlated failures.
    """
    rng = np.random.default_rng(seed=42)
    
    # 3 cache nodes with correlated failure events
    # Background latency spike causes cross-node correlated failures
    spike = rng.random(trials) < 0.03
    fail_a = spike | (rng.random(trials) < 0.02)
    fail_b = spike | (rng.random(trials) < 0.02)
    fail_c = spike | (rng.random(trials) < 0.01)
    
    # Empirical probabilities
    p_a = np.mean(fail_a)
    p_b = np.mean(fail_b)
    p_c = np.mean(fail_c)
    
    # Union: at least one node fails
    any_failure = fail_a | fail_b | fail_c
    p_union = np.mean(any_failure)
    
    # Boole's upper bound
    boole_upper = p_a + p_b + p_c
    
    # Pairwise intersections for Bonferroni lower bound
    p_ab = np.mean(fail_a & fail_b)
    p_ac = np.mean(fail_a & fail_c)
    p_bc = np.mean(fail_b & fail_c)
    bonferroni_lower = boole_upper - (p_ab + p_ac + p_bc)
    
    print(f"P(Node A Fail)       = {p_a:.5f}")
    print(f"P(Node B Fail)       = {p_b:.5f}")
    print(f"P(Node C Fail)       = {p_c:.5f}")
    print(f"----------------------------------------")
    print(f"Bonferroni Lower     = {bonferroni_lower:.5f}")
    print(f"True P(Any Failure)  = {p_union:.5f}")
    print(f"Boole's Upper Bound  = {boole_upper:.5f}")
    
    assert bonferroni_lower <= p_union <= boole_upper, "Axiomatic bounds violated!"
    print("Verification Successful: Bonferroni <= P(Union) <= Boole holds unconditionally.")

if __name__ == "__main__":
    verify_kolmogorov_axioms()

8. Summary & Key Takeaways

  1. Probability Triple: Every experiment is formalized as $(\Omega, \mathcal{F}, P)$, where $\Omega$ is the outcome space, $\mathcal{F}$ is a $\sigma$-algebra closed under complement and countable union, and $P$ maps events to $[0, 1]$.
  2. Kolmogorov's Three Axioms: Non-negativity ($P(A) \ge 0$), Unit measure ($P(\Omega) = 1$), and Countable additivity ($P(\bigcup A_i) = \sum P(A_i)$ for disjoint events).
  3. Continuity of Measure: Probabilities of monotonic sequences of events converge to the probability of their limit event.
  4. Union Bounds: Boole's inequality gives an unconditional upper bound $P(\bigcup A_i) \le \sum P(A_i)$ that holds even when events are arbitrarily correlated or dependent.