Elements of Probability

This section presents some probability relations that will be useful in the next section.

In the discrete case, we define the probability mass function (probability mass function, PMF) as

\begin{displaymath}
p_X(x) = P(X=x)
\end{displaymath} (2.82)

whereas, in the continuous case, $p_X(x)$ denotes the probability density function (probability density function, PDF).

Bayes' theorem (or Bayes' rule) is obtained by combining the multiplication rule with the law of total probability.

Starting from the definition of conditional probability $P(A,B)=P(A\vert B)P(B)$ (multiplication rule), we obtain:

\begin{displaymath}
P(A\vert B) = \frac{P(A,B)}{P(B)}
\end{displaymath} (2.83)

and, conversely,
\begin{displaymath}
P(B\vert A) = \frac{P(B,A)}{P(A)}
\end{displaymath} (2.84)

noting that $P(A,B)=P(B,A)$ gives
\begin{displaymath}
P(A\vert B) = \frac{P(B\vert A)P(A)}{P(B)}
\end{displaymath} (2.85)

The same reasoning can be applied to three variables:

\begin{displaymath}
P(A,B,C) = P(A\vert B,C)P(B,C)=P(B\vert A,C)P(A,C)=P(B,A,C)
\end{displaymath} (2.86)

which gives Bayes' rule
\begin{displaymath}
P(A\vert B,C) = \frac{P(B\vert A,C)P(A\vert C)}{P(B\vert C)}
\end{displaymath} (2.87)

showing how dependence on a third variable $C$ propagates.

Another important relation, used in the next chapter, is the law of total probability (law of total probability):

\begin{displaymath}
P(B)=\sum P(A_i, B) = \sum P(A_i) P(B\vert A_i)
\end{displaymath} (2.88)

or, in the continuous case,
\begin{displaymath}
p_X(x)=\int p_{X,Y}(X=x,Y=y) dy=\int p(x\vert Y=y) p(y) dy
\end{displaymath} (2.89)

the marginal density of $\mathbf{X}$.

Paolo medici
2026-10-19