Lesson 2 of 15
Probability Axioms & Addition Rule
Kolmogorov's Axioms
Every probability measure must satisfy three axioms:
- Non-negativity: for all events
- Normalization:
- Countable additivity: if , then
These three axioms are all you need to derive all of probability theory.
The Addition Rule
For any two events (not necessarily disjoint):
The term corrects for double-counting outcomes in both and .
# Drawing a card: P(heart or face card)
p_heart = 13/52 # P(A)
p_face = 12/52 # P(B)
p_both = 3/52 # P(A ∩ B): face cards that are hearts
p_union = p_heart + p_face - p_both
print(round(p_union, 4)) # 0.4231
Mutually exclusive events () simplify to .
Your Task
Implement union_probability(p_a, p_b, p_ab) that returns , rounded to 4 decimal places.
Pyodide loading...
Loading...
Click "Run" to execute your code.