# Conditional Probability
## Define
$P(A|B) = \frac{P(A \cap B)}{P(B)}$
- $P(A)$ the **prior** probability of A
- $(A|B)$ the **posterior** probability of A
## Bayes' rule & the law of total probability
$P(A \cap B) = P(B)P(A|B) = P(A)P(B|A)$
$P(A_1,A_2,..A_n) =P(A_1)P(A_2|A_1)...P(A_n|A_1,..,A_{n-1})$
### Bayes' rule
$P(A|B) = \frac{P(B|A)P(A)}{P(B)}$
### Law of total probability
$P(B) = \sum_{i=1}^{n} P(B|A_i)P(A_i)$
subject:
$A_1,A_2,...,A_n$ is a partition of the sample space.
### Independence of two events
Event A & B are independent if
$P(A \cap B) = P(A)P(B)$