Probability
Conditional Probability
Conditional probability $P(A\mid B)$ is the probability of $A$ given that $B$ has occurred:
$$P(A\mid B)=\frac{P(A\cap B)}{P(B)},\qquad P(B)>0.$$
Multiplication rule
Rearranging gives the probability that both events happen:
$$P(A\cap B)=P(B)\,P(A\mid B)=P(A)\,P(B\mid A).$$
Independent events
Events $A$ and $B$ are independent if one does not affect the other:
$$P(A\cap B)=P(A)\,P(B)\quad\Longleftrightarrow\quad P(A\mid B)=P(A).$$
Do not confuse independent with mutually exclusive: mutually exclusive events ($P(A\cap B)=0$) with non-zero probabilities are in fact dependent.
Even outcomes: $\{2,4,6\}$, so $P(B)=\tfrac36$. Even and $>3$: $\{4,6\}$, so $P(A\cap B)=\tfrac26$. Thus $P(A\mid B)=\dfrac{2/6}{3/6}=\dfrac{2}{3}.$
$P(A)P(B)=0.5\times0.4=0.2=P(A\cap B)$. Yes, they are independent.
$P=\dfrac{4}{52}\times\dfrac{3}{51}=\dfrac{12}{2652}=\dfrac{1}{221}.$
$P(A\cap B)=P(A)P(B\mid A)=0.6\times0.5=0.3.$
- $P(A\mid B)=\dfrac{P(A\cap B)}{P(B)}$.
- Multiplication rule: $P(A\cap B)=P(B)P(A\mid B)=P(A)P(B\mid A)$.
- Independent: $P(A\cap B)=P(A)P(B)$.
- Mutually exclusive $\ne$ independent.
Multiplication Theorem and Independence
When an outcome can arise through several mutually exclusive "causes", two results let us move between forward and reverse probabilities.
Law of total probability
If $E_1,E_2,\dots,E_n$ partition the sample space (mutually exclusive, exhaustive), then for any event $A$:
$$P(A)=\sum_{i=1}^{n} P(E_i)\,P(A\mid E_i).$$
Bayes' theorem
Bayes' theorem reverses the conditioning — from $P(A\mid E_i)$ to $P(E_i\mid A)$:
$$P(E_k\mid A)=\frac{P(E_k)\,P(A\mid E_k)}{\displaystyle\sum_{i} P(E_i)\,P(A\mid E_i)}.$$
The $P(E_i)$ are called prior probabilities and $P(E_k\mid A)$ the posterior — updated belief after observing $A$. This is the basis of medical-test and quality-control problems.
$P(\text{red})=\tfrac12\cdot\tfrac35+\tfrac12\cdot\tfrac15=\tfrac{3}{10}+\tfrac{1}{10}=\dfrac{4}{10}=\dfrac{2}{5}.$
By Bayes: $P(\text{I}\mid \text{red})=\dfrac{\tfrac12\cdot\tfrac35}{\tfrac{2}{5}}=\dfrac{3/10}{4/10}=\dfrac{3}{4}.$
The prior $P(E_i)$ is the probability of a cause before observing evidence; the posterior $P(E_i\mid A)$ is the revised probability after observing $A$.
$P(A)=0.4(0.5)+0.6(0.5)=0.2+0.3=0.5.$
- Total probability: $P(A)=\sum_i P(E_i)P(A\mid E_i)$ over a partition.
- Bayes: $P(E_k\mid A)=\dfrac{P(E_k)P(A\mid E_k)}{\sum_i P(E_i)P(A\mid E_i)}$.
- Prior = before evidence; posterior = after observing $A$.
- The $E_i$ must be mutually exclusive and exhaustive.
Bayes’ Theorem and Distributions
A random variable $X$ assigns a number to each outcome of an experiment (e.g. the number of heads in two tosses). A probability distribution lists each value $x_i$ with its probability $p_i=P(X=x_i)$.
A valid distribution
Every $p_i\ge0$ and $\displaystyle\sum_i p_i=1$. This normalisation condition is the first check (and a frequent "find $k$" question).
Mean (expectation)
The mean or expected value is the probability-weighted average:
$$E(X)=\mu=\sum_i x_i\,p_i.$$
Variance
The variance measures spread:
$$\operatorname{Var}(X)=\sum_i x_i^2 p_i-\mu^2,\qquad \text{SD}=\sqrt{\operatorname{Var}(X)}.$$
$\sum p_i=k(1+2+3)=6k=1\Rightarrow k=\dfrac16.$
$E(X)=1\cdot\tfrac16+2\cdot\tfrac26+3\cdot\tfrac36=\tfrac{1+4+9}{6}=\dfrac{14}{6}=\dfrac{7}{3}.$
$P(X=0)=\tfrac14,\ P(X=1)=\tfrac12,\ P(X=2)=\tfrac14$ (since outcomes are HH, HT, TH, TT).
$E(X)=0\cdot\tfrac14+1\cdot\tfrac12+2\cdot\tfrac14=\tfrac12+\tfrac12=1.$
- A distribution lists $x_i$ with $p_i\ge0$ and $\sum p_i=1$.
- Mean $E(X)=\sum x_i p_i$.
- Variance $=\sum x_i^2 p_i-\mu^2$; SD $=\sqrt{\text{Var}}$.
- Use $\sum p_i=1$ to find unknown constants.