· · ·
Probability Series
· · ·
Conditional Probability
The probability of event X given that Y has already occurred is denoted by \(P(XY)\)

If X and Y are independent: \(P(XY) = P(X)\) because event X is not dependent on event Y.

If X and Y are mutually exclusive: \(P(XY) = 0\) because X and Y are disjoint events.
Product Rule
From \eqref{1}, following can be concluded,
 \(X \subseteq Y\) implies \(P(XY) = P(X)/P(Y)\) because \(X \cap Y = X\)
 \(Y \subseteq X\) implies \(P(XY) = 1\) because \(X \cap Y = Y\)
The distributive, associative and De Morgan’s laws are valid for conditional probability.
\[P(X \cup YZ) = P(XZ) + P(YZ)  P(X \cap YZ)\] \[P(X^{c}Z) = 1P(XZ)\]
Chain Rule
Bayes’ Theorem
Where \(P(X) = P(X \cap Y) + P(X \cap Y^{c})\) from the sum rule.
Derivation of Bayes’ Theorem
From \eqref{1},
Using the commutative law,
From \eqref{2}, \eqref{3} and, \eqref{4},
Hence,
EXAMPLE
 \(p_ot\) is probability of reaching on time when no car trouble.
 \(p_ct\) is probability of car trouble.
 Commute by train if car trouble occurs.
 N is the number of trains available.
 Only 2 of the N trains would reach on time.

What is the probability of reaching on time.
 Explaination:
 \(O\): reach on time
 \(C^c\): car not working
 \(P(O) = P(O \cap C) + P(O \cap C^c)\)
 \(P(O \cap C) = P(OC) * P(C) \text{ where } P(C) = 1  P(C^c)\)
 \(P(O \cap C^c) = P(OC^c) * P(C^c) \text{ where } P(OC^c) = 2/N\)
p_ct = float(input()) # P(Car Trouble)
p_ot = float(input()) # P(On Time  No Car Trouble)
N = float(input()) # Number of trains
p_rt = 2.0/N # P(Correct Train)
p_o = p_ct * p_rt + (1p_ct) * p_ot # P(On Time)
print("%.6f" % p_o)
REFERENCES:
· · ·