

\(A\) and \(A^c\) always form a partition of sample space \(\Omega\).
Let \(A_1, A_2, \cdots, A_n\) form a partition of sample space \(\Omega\).

Then, for any event \(B\), we have
\[ B = (A_1 \cap B) \cup (A_2 \cap B) \cup \cdots \cup (A_n \cap B) \]

In fact, \(H_1, H_2, \cdots, H_5\) have \(L_1\) as a prerequisite.
Now how many different curricula are possible?

\[ \small{ \begin{aligned} B =\;& (A_1 \cap B) \cup (A_2 \cap B) \cup \cdots \cup (A_n \cap B) \\ \\ \text{P}(B) =\;& \text{P}\big((A_1 \cap B) \cup (A_2 \cap B) \cup \cdots \cup (A_n \cap B)\big)\\ =\;& \text{P}(A_1 \cap B) + \text{P}(A_2 \cap B) + \cdots + \text{P}(A_n \cap B)\\ =\;& \text{P}(A_1)\text{P}(B \mid A_1) + \text{P}(A_2)\text{P}(B \mid A_2) + \cdots + \text{P}(A_n)\text{P}(B \mid A_n) \\ \end{aligned} } \]
Divide and conquer
You enter a tennis tournament.
Your probability of winning a game is
You play a game against a randomly chosen opponent.
What is the probability of you winning the game?
def monty(switch=False):
# Generate a random door number that has the car
import random
car_door = random.randint(1, 3)
# Get keyboard input for a player's initial pick
init_pick = int(input('Which door would you pick?'))
if switch:
if init_pick == car_door:
print(f'You lose! The car is behind door {car_door} but you switched.')
else:
print(f'You win! You switched to door {car_door} which has the car.')
else:
if init_pick == car_door:
print(f'You win! The car is indeed behind door {car_door}.')
else:
print(f'You lose! The car is behind door {car_door}')