# Bayes' rule

Last edited: 2026-01-28

# Statement

Bayes’ rule

For two events $A$ and $B$, we have the following equality on their conditional probabilities :

$$\mathbb{P}[A \vert B] = \frac{\mathbb{P}[B \vert A] \cdot \mathbb{P}[A]}{\mathbb{P}[B]}$$

# Proof

This follows from the definition of conditional probability

$$ \begin{aligned} \mathbb{P}[A \vert B] = & \frac{\mathbb{P}[A \cap B]}{\mathbb{P}[B]} & \mbox{from the definition of } \mathbb{P}[A \vert B]\\ = & \frac{\mathbb{P}[B \vert A] \cdot \mathbb{P}[A]}{\mathbb{P}[B]} & \mbox{as } \mathbb{P}[B \vert A] = \frac{\mathbb{P}[A \cap B]}{\mathbb{P}[A]}. \end{aligned} $$