Rudolf Adamkovič Personal site


Bayes’ Theorem

Define

The conditional probability

\[\begin{equation*}
  P(A | B) = \frac{P(A) \, P(B | A)}{P(B)}
\end{equation*}
\]

given \(P(B) \neq 0\).

N.B. If some probability, such as \(P(B)\) is unknown,

the law of total probability might help.

Prove

  1. Define probabilities of events \(A\) and \(B\) as
    \[\begin{equation*}
      \begin{array}{r|cc}
        & B & \lnot B \\ \hline
        A & s & t \\ \lnot A & u & v
      \end{array}
    \end{equation*}
    \]
  2. Multiply by \(P(B)\) and swap sides, so
    \[\begin{align*}
      P(A | B) = \frac{P(A) \, P(B | A)}{P(B)} \iff
      P(A) \, P(B | A) = P(B) \, P(A | B).
    \end{align*}
    \]
  3. Substitute \(s, t, u, v\) into
    \[\begin{equation*}
      \begin{array}{ccccccc}
        P(A) & \cdot & P(B|A) & = & P(B) & \cdot & P(A|B)
        \\[3ex]
        \begin{array}{cc} \boxed{s} & \boxed{t} \\ u & v \end{array}
        & \cdot & \begin{array}{cc} \boxed{s} & t \\ \bcancel{u} & \bcancel{v} \end{array}
        & = & \begin{array}{cc} \boxed{s} & t \\ \boxed{u} & v \end{array}
        & \cdot & \begin{array}{cc} \boxed{s} & \bcancel{t} \\ u & \bcancel{v} \end{array}
        \\[3ex]
        \dfrac{s + t}{s + t + u + v} & \cdot &
        \dfrac{s}{s + t} & = &
        \dfrac{s + u}{s + t + u + v} & \cdot &
        \dfrac{s}{s + u}
      \end{array}
    \end{equation*}
    \]
  4. Verify the equality
    \[\begin{align*}
      \frac{s + t}{s + t + u + v} \cdot \frac{s}{s + t}
      & \stackrel{?}{=} \frac{s + u}{s + t + u + v} \cdot \frac{s}{s + u}
      \\[2ex]
      \frac{\cancel{(s + u)} s}{(s + t + u + v) \cancel{(s + u)}}
      & = \frac{\cancel{s + t) s}}{(s + t + u + v) \cancel{(s + t)}}
      \\[2ex]
      \frac{s}{s + t + u + v} & = \frac{s}{s + t + u + v}
      \\[2ex]
      1 & \stackrel{\checkmark}{=} 1.
    \end{align*}
    \]

\(\blacksquare\)

Use

See the law of total probability.



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