Cumulative distribution functions of the six discrete distributions from the previous section. An open circle β marks a value that is not attained (the left-hand limit); a filled circle β marks a value that is attained at that point (by right-continuity). For the Poisson and geometric distributions only the first few jumps are shown β further on the cdf keeps approaching 1 in small steps, but never actually equals 1 at any finite point (the support is infinite).
Probability distributions. Random variables. Expectation
This lecture note is still being edited: the text may contain typos, inaccuracies, and locally unpolished spots. If you find something, please let the author know (contact information on the course page).
1 Random variables
Many experiments have outcomes that are conveniently expressed as numbers. For example, the result of rolling a die is the number of pips on the face that comes up, from the set \(\{ 1, \ldots , 6\}\). When building a probabilistic model, this numerical outcome is put in correspondence with an elementary outcome.
A function that assigns a number to each elementary outcome, and for which one can define the probability of it landing in various (Borel) subsets of \(\mathbb {R}\), is called a random variable. Introducing this notion is an important tool in probability theory, since it allows us to:
Substantially simplify the computation of probabilities of various events,
Formulate and prove the key limit theorems.
Before giving a rigorous definition of a random variable, it is useful to recall the general notion of a measurable function.
measurability and the Borel sigma-algebrameasurability The definition of a random variable relies on the Borel sigma-algebra \(\mathscr {B}\left(\mathbb {R}\right)\), which we will rigorously construct in the chapter on systems of sets and the Borel sigma-algebra, while the systematic study of measurable functions awaits us in the chapter on measurable functions. For now, the following understanding suffices: \(\mathscr {B}\left(\mathbb {R}\right)\) contains all sets encountered in practice (all intervals and everything obtainable from them via countable unions, intersections, and complements), while measurability is a technical consistency condition linking \(X\) with the sigma-algebras, one that holds automatically for essentially every function encountered in practice. In the discrete case (\(\mathcal{F} = 2^{\Omega }\)), literally every function is measurable.
It should be noted that the measurability condition is largely of theoretical character. In real practice it is very hard to come across a non-measurable function; the overwhelming majority of functions possess measurability, i.e., are random elements (variables or vectors). All the standard functions from \(\mathbb {R}\) to \(\mathbb {R}\) that you know are Borel measurable. And in the discrete case, for instance, absolutely every function \(\Omega \mapsto \mathbb {R}\) is measurable, since \(\mathcal{F} = 2^{\Omega }\), i.e., any preimage lands in \(\mathcal{F}\).
To simplify the notation of probabilities of events related to random variables, the following notation is introduced:
\[ \begin{align} \mathbb {P}\left(\left\{ \omega : \xi (\omega ) \in B\right\} \right) & =: \mathbb {P}\left(\xi \in B\right) \\ \mathbb {P}\left(\left\{ \omega : \xi (\omega ) < x\right\} \right) & =: \mathbb {P}\left(\xi < x\right) \\ \mathbb {P}\left(\left\{ \omega : \xi (\omega ) = x\right\} \right) & =: \mathbb {P}\left(\xi =x \right) \\ \mathcal{F}_{\xi } & := \left\{ \xi ^{-1}(B) \mid B \in \mathscr {B}\left(\mathbb {R}^{n}\right)\right\} \\ \end{align} \]
Let us give the simplest examples of random variables.
The model of a coin toss with probability \(p\) of heads: \(\Omega = \left\{ \omega_{\text{H}}, \omega_{\text{T}}\right\}\), \(\mathcal{F}=2^{\Omega }\), \(\mathbb {P}\left(\left\{ \omega_{\text{H}}\right\} \right) = p\). Let, moreover,
\[ \xi : \Omega \rightarrow \left\{ 0,1\right\} , \qquad \xi \left(\omega _{\text{H}}\right)=1, \quad \xi \left(\omega _{\text{T}}\right)=0 \]
Then we have: \(\mathbb {P}\left(\xi = 1\right) = p\), \(\mathbb {P}\left(\xi = 0\right) = 1-p\).
Let \(\Omega\) be an arbitrary set, let \(\mathcal{F}\) be a \(\sigma\)-algebra on it, and let \(A \in \mathcal{F}\). The random variable \(I_{A}: \Omega \rightarrow \{ 0,1\}\), where \(I_{A}(\omega )=1\) if and only if \(\omega \in A\), is called the indicator of the event \(A\).
Note that the measurability property in the definition of random variables (more broadly, random vectors and elements) is needed in order to compute probabilities of properties tied to the values of the random variable. In other words, we are interested in the probabilities \(\mathbb {P}\left(\xi \in B\right)\), \(B \in \mathcal{E}\). It is easy to prove that the function \(\mathbf{P}_{\xi }: \mathcal{B}\left(\mathbb {R}^{n}\right) \rightarrow [0,1]\), whose values are given by
\[ \mathbf{P}_{\xi }\left(B\right) := \mathbb {P}\left(\xi \in B\right) = \mathbb {P}\left(\left\{ \omega \; : \; \xi (\omega ) \in B\right\} \right), \]
is a probability measure. In this connection the following definitions are introduced.
2 Probability distribution
The term distribution (or probability distribution), without reference to a random variable, is essentially a synonym for a probability measure (probability). The only difference is that a probability may be defined on an arbitrary measurable space \((\Omega , \mathcal{F})\), whereas a distribution is, as a rule, defined on \((\mathbb {R}, \mathscr {B}\left(\mathbb {R}\right))\) (more broadly, on \((\mathbb {R}^{n}, \mathscr {B}\left(\mathbb {R}^{n}\right))\)).
The most common types of distributions are the discrete and the absolutely continuous probability distributions. We will consider the discrete ones.
but where are the continuous distributions?densities In this chapter we deliberately restrict ourselves to discrete distributions. The familiar βcontinuousβ distributions β uniform on an interval, normal \(\mathscr {N}\left(a, \sigma^2\right)\), exponential β are specified not by masses of individual points but by a density. To honestly define what a density is, and how to compute probabilities and expectations from it, one needs the Lebesgue integral (the chapters on constructing the Lebesgue integralβon its properties) and the RadonβNikodym theorem (the chapter on signed measures). This is yet another β and perhaps the main applied β reason to build measure theory.
The support of a distribution is the smallest closed set of measure \(1\). Notation: \(\operatorname {supp}\mathbf{P}\). We have
\[ \operatorname {supp}\mathbf{P} = \bigcap _{\substack { B \subset \mathbb {R} \\ B \text{ -- closed} \\ \mathbf{P}\left(B\right) = 1}} B \]
For example, the support of Lebesgue measure on the segment \([0,1]\) is the segment \([0,1]\). The support of the Dirac measure at the point \(c\) is \(\left\{ c\right\}\) (see below).
A distribution \(\mathbf{P}\) is called discrete if its support is an at most countable set. Such a distribution is conveniently specified simply by the masses of the individual points of the support: the value \(\mathbf{P}\left(\left\{ x\right\} \right)\), \(x \in \operatorname {supp}\mathbf{P}\), is called the mass function (or probability function; the commonly used abbreviation PMF comes from the English probability mass function).
Let us give examples of discrete distributions.
The Dirac measure at the point \(c \in \mathbb {R}\): \(\delta_c\). We have \(\operatorname {supp}\delta_{c} = \left\{ c\right\}\), \(\mathbf{P}\left(\left\{ c\right\} \right) = 1\).
The discrete uniform distribution \(\operatorname {Unif}\left\{ 1,\ldots ,N\right\}\) on the set \(\{ 1, \ldots , N\}\) is defined as follows:
\[ \operatorname {supp}\operatorname {Unif}\left\{ 1,\ldots ,N\right\} = \left\{ 1, \ldots , N\right\} , \qquad \mathbf{P}\left(\left\{ k\right\} \right) = \frac{1}{N}, \quad k \in \left\{ 1, \ldots , N\right\} \]
In other words,
\[ \operatorname {Unif}\left\{ 1,\ldots ,N\right\} = \frac{1}{N}\delta _1 + \frac{1}{N}\delta _2 + \ldots + \frac{1}{N}\delta _N \]
It is easy to check that this is indeed a distribution: all masses are positive and sum to \(1\).
The Bernoulli distribution with parameter \(p \in (0,1)\): \(\operatorname {Ber}(p)\).
\[ \operatorname {supp}\operatorname {Ber}(p) = \left\{ 0,1\right\} , \qquad \mathbf{P}\left(\left\{ 0\right\} \right) = 1-p, \quad \mathbf{P}\left(\left\{ 1\right\} \right) = p \]
In other words,
\[ \operatorname {Ber}(p) = (1-p)\cdot \delta _0 + p\cdot \delta _{1} \]
Physical model: the toss of a biased coin, where heads is assigned \(1\) and tails \(0\).
The binomial distribution \(\operatorname {Bin}(n,p)\) with parameters \((n, p)\), \(n \in \mathbb {N}, p \in (0,1)\):
\[ \mathbf{P}\left(\left\{ k\right\} \right) = C_{n}^{k}p^{k}(1-p)^{n-k}, \qquad k \in \left\{ 0, \ldots , n\right\} = \operatorname {supp}\operatorname {Bin}(n,p) \]
Physical model: the number of successes in \(n\) independent Bernoulli trials.
The Poisson distribution \(\operatorname {Pois}(\lambda )\) with parameter \(\lambda >0\):
\[ \mathbf{P}\left(\left\{ k\right\} \right) = \frac{\lambda ^{k}}{k!} e^{-\lambda }, \qquad k \in \mathbb {Z}_{+} = \left\{ 0,1,2, \ldots \right\} = \operatorname {supp}\operatorname {Pois}(\lambda ) \]
Physical model: the number of successes in a sequence of independent Bernoulli trials with parameter \(\lambda / n\), where \(n \gg \lambda\).
The geometric distribution \(\operatorname {Geom}(p)\) with parameter \(p \in (0,1)\):
\[ \mathbf{P}\left(\left\{ k\right\} \right) = (1-p)^{k-1}p, \qquad k \in \mathbb {N} = \operatorname {supp}\operatorname {Geom}(p) \]
Physical model: the number of coin tosses up to and including the first heads.
Random variables \(\xi , \eta\) are called independent if the events \(\left\{ \xi \in B_1\right\}\), \(\left\{ \eta \in B_2\right\}\) are independent for arbitrary Borel sets \(B_1, B_2 \in \mathscr {B}\left(\mathbb {R}\right)\). That is,
\[ \mathbb {P}\left(\xi \in B_1, \eta \in B_2\right) = \mathbb {P}\left(\xi \in B_1\right) \cdot \mathbb {P}\left(\eta \in B_2\right), \qquad \forall \; B_1, B_2 \in \mathscr {B}\left(\mathbb {R}\right) \]
In the example above, as one can observe, although the discussion was framed in terms of a random variable, the actual object of study was not the map \(\Omega \to \mathbb {R}\) itself, but its probability distribution. This happens often in probability theory: a random variable and its distribution are used interchangeably. It is important, nonetheless, to distinguish between them. The distribution of a random variable is only one of its characteristics. Two completely different random variables (as functions) may have the same distribution.
3 From a distribution to a random variable
As we have established, every random variable has a distribution, i.e., it generates a probability measure on \((\mathbb {R}, \mathcal{B}(\mathbb {R}))\). In real problems, however, one often does not mention the underlying probability space \((\Omega , \mathcal{F}, \mathbb {P})\) at all, and simply speaks of some random variable with a given distribution \(\mathbf{P}\).
A question arises: does such a random variable exist at all, in principle? Can we construct \((\Omega , \mathcal{F}, \mathbb {P})\) and a measurable map \(X \colon \Omega \to \mathbb {R}\) such that \(\mathbf{P} = \mathbf{P}_{X}\)? The answer to this question is yes. Here is the standard construction:
\[ (\Omega , \mathcal{F}, \mathbb {P}) := (\mathbb {R}, \mathcal{B}(\mathbb {R}), \mathbf{P}), \qquad X(\omega ) := \omega \qquad \text{(i.e., $X = \operatorname {Id}$)}. \]
It can be simplified somewhat by taking, instead of \(\mathbb {R}\), only the support of the distribution \(\mathbf{P}\):
\[ \Omega := \operatorname {supp}\mathbf{P}, \qquad \mathcal{F} := \left\{ B \cap \operatorname {supp}\mathbf{P}, \; B \in \mathscr {B}\left(\mathbb {R}\right)\right\} , \qquad \mathbb {P} := \mathbf{P}|_{\operatorname {supp}\mathbf{P}} \]
4 Cumulative distribution function
Let us note the properties of the cumulative distribution function.
\(F(x)\) is a non-decreasing function;
\(\lim_{x \rightarrow -\infty } F(x)=0\), \(\lim_{x \rightarrow +\infty } F(x)=1\);
\(F(x)\) is right-continuous and has left-hand limits at every point \(x \in \mathbb {R}\).
Before going further, let us look at the graphs of the cumulative distribution functions for the discrete distributions introduced in the previous section β all three properties listed above are clearly visible on them (in particular, the jumps at the points of the support, and the fact that the filled dot is always the right-hand end of a jump).
It turns out that to specify a probability distribution it suffices to specify the probability measure only on the sets \((-\infty , x]\) for all real \(x\).
This theorem justifies introducing the following notion: any function \(F\) satisfying conditions 1)β3) is called a cumulative distribution function on the real line \(\mathbb {R}\).
a cdf determines the distribution uniquelycdf-defines-distrib The theorem above is pure measure theory, and its debt will be repaid in full. The existence of a measure corresponding to a function \(F\) is CarathΓ©odoryβs extension theorem (the chapter on outer measure and CarathΓ©odoryβs theorem), applied to the set function \((a,b] \mapsto F(b)-F(a)\); uniqueness follows from the uniqueness-of-extension theorem for \(\pi\)-systems (same chapter). The resulting construction is called the LebesgueβStieltjes measure (the chapter on Lebesgue measure).
Let us give the simplest examples of cumulative distribution functions.
Let
\[ F(x)= \begin{cases} 0, & x<0 \\ x, & 0 \leq x \leq 1 \\ 1, & x>1\end{cases} \]
In this case the corresponding probability distribution \(\lambda\) is called Lebesgue measure on the segment \([0,1]\). It is clear that for any \(a<b \in [0,1]\) we have
\[ \lambda ((a, b))=\lambda ([a, b))=\lambda ((a, b])=\lambda ([a, b])=b-a \]
Let
\[ F(x)= \begin{cases} 0, & x<c \\ 1, & x \geq c\end{cases} \]
The corresponding probability distribution:
\[ \mathbf{P}\left(A\right) = \delta _c(A) = \begin{cases} 0, & c \notin A \\ 1, & c \in A\end{cases} \]
for \(A \in \mathscr {B}\left(\mathbb {R}\right)\). That is, this distribution corresponds to a unit mass concentrated at the point \(c\). Such a probability measure is called the Dirac measure (notation: \(\delta_c\)).
5 Miscellaneous problems
6 Expectation for a discrete distribution
Expectation is, informally, the average value taken by a random variable. Thus, the average value that comes up on a die is \(3.5\), and the expectation of the random variable equal to the value shown by the die is likewise \(3.5\).
If a random variable has a discrete distribution, then the expectation is naturally defined as a weighted sum of the values of the random variable.
If the set \(X\) is infinite, then the sum in the definition of the expectation may be infinite, or may fail to exist at all. When the sum is infinite, we say that the expectation is infinite. If the sum does not exist, then the expectation does not exist either.
If \(\varphi : \mathbb {R} \rightarrow \mathbb {R}\) is an arbitrary Borel function, then by definition \(\mathbb {E}\left[\varphi (\xi )\right] = \sum_{k \in \varphi (X)} k \cdot \mathbb {P}\left(\varphi (\xi ) = k\right)\), where \(\varphi (X)\) is the range of the transformed random variable \(\varphi (\xi )\). In practice, finding the range of \(\varphi (\xi )\) and the distribution of \(\varphi (\xi )\) is often rather involved; instead, the following formula is used:
\[ \mathbb {E}\left[\varphi (\xi )\right]=\sum _{x \in X} \varphi (x) \mathbb {P}\left(\xi =x\right) \]
where \(X\) is the set of values of the random variable \(\xi\).
Properties:
Expectation is linear:
\(\mathbb {E}\left[\alpha \cdot \xi \right] = \alpha \cdot \mathbb {E}\left[\xi \right]\), \(\alpha \in \mathbb {R}\), \(\xi\) a random variable.
\(\mathbb {E}\left[\xi + \eta \right] = \mathbb {E}\left[\xi \right] + \mathbb {E}\left[\eta \right]\) for arbitrary random variables \(\xi\), \(\eta\) (provided the expectations exist).
If the random variables are independent, then expectation is multiplicative:
\[ \mathbb {E}\left[\xi \cdot \eta \right] = \mathbb {E}\left[\xi \right] \cdot \mathbb {E}\left[\eta \right] \]
However, in general, expectation is typically not multiplicative: \(\mathbb {E}\left[\xi \cdot \eta \right] \neq \mathbb {E}\left[\xi \right] \cdot \mathbb {E}\left[\eta \right]\). In particular, if \(\xi\) has some non-degenerate distribution (not a Dirac distribution), then, for example, \(\mathbb {E}\left[\xi^2\right] \neq \left(\mathbb {E}\left[\xi \right]\right)^2\).
expectation in the general caseexpectation We have defined expectation only for discrete distributions β as the sum of a series. For an arbitrary random variable, \(\mathbb {E}\left[\xi \right]\) is defined as the Lebesgue integral \(\int_{\Omega } \xi \, d\mathbb {P}\), which we will construct in the chapter on constructing the Lebesgue integral. There (and in the chapter on its properties) the properties we are already using will be honestly proved in full generality: linearity, multiplicativity for independent variables, passages to the limit. In the discrete case our definition agrees with the general one, and linearity is proved elementarily (by rearranging sums) β check this yourself.
7 Variance
Of course, from a single known average value of a random variable it is hard to judge its distribution. Additional information is provided by the mean squared deviation from the expectation, which is called the variance.
By linearity of expectation there is a convenient formula for the variance:
\[ \operatorname {Var}\left[\xi \right] = \mathbb {E}\left[\xi ^2 - 2\xi \cdot \mathbb {E}\left[\xi \right] + \left(\mathbb {E}\left[\xi \right]\right)^2\right] = \mathbb {E}\left[\xi ^2\right] - 2 \cdot \mathbb {E}\left[\xi \right] \cdot \mathbb {E}\left[\xi \right] + \left(\mathbb {E}\left[\xi \right]\right)^2 = \mathbb {E}\left[\xi ^2\right] - \left(\mathbb {E}\left[\xi \right]\right)^2 \]
Footnotes
The notation \(\operatorname {supp}(\xi + \eta )\) denotes the support of the distribution of \(\xi + \eta\), i.e., \(\operatorname {supp}(\xi + \eta ) = \operatorname {supp}\mathbf{P}_{\xi + \eta }\).β©οΈ