Rudolf Adamkovič Personal site


Derive

  1. Let the joint distribution of the events \(A\) and \(B\) be
    \[\begin{equation*}
      \begin{array}{r|cc}
        & B & \lnot B \\ \hline
        A & s & t \\ \lnot A & u & v
      \end{array}.
    \end{equation*}
    \]
  2. Find the probabilities
    \[\begin{alignat*}{3}
      P(A)
      & = \dfrac{s + t}{s + t + u + v}
      && \qquad \text{using}
      & \qquad \begin{array}{cc} \boxed{s} & \boxed{t} \\ u & v \end{array}
      \\[0.5ex]
      \text{and} \qquad P(B)
      & = \dfrac{s + u}{s + t + u + v}
      && \qquad \text{using}
      & \quad \begin{array}{cc} \boxed{s} & t \\ \boxed{u} & v \end{array}.
    \end{alignat*}
    \]
  3. Find the conditional probabilities
    \[\begin{alignat*}{3}
      P(A|B) & = \dfrac{s}{s + u}
      && \qquad \text{using} \qquad
      & \begin{array}{cc} \boxed{s} & \bcancel{t} \\ u & \bcancel{v} \end{array}
      \\[0.5ex]
      \text{and} \qquad P(B|A)
      & = \dfrac{s}{s + t}
      && \qquad \text{using} \qquad
      & \begin{array}{cc} \boxed{s} & t \\ \bcancel{u} & \bcancel{v} \end{array}.
    \end{alignat*}
    \]
  4. See the equality
    \[\begin{align*}
      \Pr(A) \Pr(B | A)
      & \stackrel{?}{=} \Pr(B) \Pr(A | B)
      \\[1ex]
      \frac{s + t}{s + t + u + v} \cdot \frac{s}{s + t}
      & = \frac{s + u}{s + t + u + v} \cdot \frac{s}{s + u}
      \\[1ex]
      \frac{\cancel{(s + u)} s}{(s + t + u + v) \cancel{(s + u)}}
      & = \frac{\cancel{s + t) s}}{(s + t + u + v) \cancel{(s + t)}}
      \\[1ex]
      \frac{s}{s + t + u + v} & = \frac{s}{s + t + u + v}
      \\[1ex]
      1 & \stackrel{\checkmark}{=} 1.
    \end{align*}
    \]
  5. Divide by \(P(B)\) and swap sides,
    \[\begin{align*}
      \Pr(A) \Pr(B | A) & = \Pr(B) \Pr(A | B) \\[0.5ex]
      \Pr(A | B) & = \frac{\Pr(A) \Pr(B | A)}{\Pr(B)}.
    \end{align*}
    \]

    This is the Bayes’ theorem.


© 2024 Rudolf Adamkovič under GNU General Public License version 3.
Made with Emacs and the secret alien technologies of yesteryear.