Probability review

We will go through a review of probability concepts over here, all of review the material have been adapted from CS229 Probability Notes.

1. Elements of probability

In order to define a probability on a set we need a few basic elements,

Sample space Ω: The set of all the outcomes of a random experiment. Here, each outcome can be thought of as a complete description of the state of the real world at the end of the experiment.

Set of events (or event space) F: A set whose elements (called events) are subsets of Ω (i.e., A ⊆ Ω is a collection of possible outcomes of an experiment)

Probability measure: A function that satisfies the following properties * , for all * If , , . . . are disjoint events , then
* .

These three properties are called the Axioms of Probability.

Example: Consider the event of tossing a six-sided die. The sample space is Ω = {1, 2, 3, 4, 5, 6}. We can define different event spaces on this sample space. For example, the simplest event space is the trivial event space F = {∅, Ω}. Another event space is the set of all subsets of Ω. For the first event space, the unique probability measure satisfying the requirements above is given by P(∅) = 0, P(Ω) = 1. For the second event space, one valid probability measure is to assign the probability of each set in the event space to be where is the number of elements of that set; for example, and .

Properties:

1.1 Conditional probability and independence

Let B be an event with non-zero probability. The conditional probability of any event A given B is defined as In other words, is the probability measure of the event A after observing the occurrence of event B. Two events are called independent if and only if (or equivalently, ). Therefore, independence is equivalent to saying that observing B does not have any effect on the probability of A.

2. Random variables

Consider an experiment in which we flip 10 coins, and we want to know the number of coins that come up heads. Here, the elements of the sample space Ω are 10-length sequences of heads and tails. For example, we might have . However, in practice, we usually do not care about the probability of obtaining any particular sequence of heads and tails. Instead we usually care about real-valued functions of outcomes, such as the number of heads that appear among our 10 tosses, or the length of the longest run of tails. These functions, under some technical conditions, are known as random variables.

More formally, a random variable is a function . Typically, we will denote random variables using upper case letters or more simply (where the dependence on the random outcome is implied). We will denote the value that a random variable may take on using lower case letters .

Example: In our experiment above, suppose that is the number of heads which occur in the sequence of tosses ω. Given that only 10 coins are tossed, can take only a finite number of values, so it is known as a discrete random variable. Here, the probability of the set associated with a random variable X taking on some specific value is .

Example: Suppose that is a random variable indicating the amount of time it takes for a radioactive particle to decay. In this case, takes on a infinite number of possible values, so it is called a continuous random variable. We denote the probability that X takes on a value between two real constants a and b (where a < b) as .

2.1 Cumulative distribution functions

In order to specify the probability measures used when dealing with random variables, it is often convenient to specify alternative functions (CDFs, PDFs, and PMFs) from which the probability measure governing an experiment immediately follows. In this section and the next two sections, we describe each of these types of functions in turn. A cumulative distribution function (CDF) is a function which specifies a probability measure as, \begin{equation} F_X(x) = P(X \leq x) \end{equation} By using this function one can calculate the probability of any event.

Properties:

2.2 Probability mass functions

When a random variable X takes on a finite set of possible values (i.e., X is a discrete random variable), a simpler way to represent the probability measure associated with a random variable is to directly specify the probability of each value that the random variable can assume. In particular, a probability mass function (PMF) is a function such that .

In the case of discrete random variable, we use the notation V al(X) for the set of possible values that the random variable X may assume. For example, if X(ω) is a random variable indicating the number of heads out of ten tosses of coin, then V al(X) = {0, 1, 2, . . . , 10}.

Properties:

2.3 Probability density functions

For some continuous random variables, the cumulative distribution function FX(x) is differentiable everywhere. In these cases, we define the Probability Density Function or PDF as the derivative of the CDF, i.e.,

\begin{equation} f_X(x) = \frac{dF_X(x)}{dx}. \end{equation}

Note here, that the PDF for a continuous random variable may not always exist (i.e., if FX(x) is not differentiable everywhere).

According to the properties of differentiation, for very small ∆x,

.

Both CDFs and PDFs (when they exist!) can be used for calculating the probabilities of different events. But it should be emphasized that the value of PDF at any given point is not the probability of that event, i.e., . For example, can take on values larger than one (but the integral of fX(x) over any subset of R will be at most one).

Properties:

2.4 Expectation

Suppose that is a discrete random variable with PMF and is an arbitrary function. In this case, can be considered a random variable, and we define the expectation or expected value of as:

\begin{equation} E[g(X)] = \sum_{x \in Val(X)} g(x)p_X(x). \end{equation}

If X is a continuous random variable with PDF , then the expected value of g(X) is defined as,

\begin{equation} E[g(X)] = \int^{\infty}_{-\infty} g(x)f_X(x)dx \end{equation}.

Intuitively, the expectation of g(X) can be thought of as a “weighted average” of the values that g(x) can taken on for different values of x, where the weights are given by or . As a special case of the above, note that the expectation, E[X] of a random variable itself is found by letting g(x) = x; this is also known as the mean of the random variable X.

Properties:

2.5 Variance

The variance of a random variable X is a measure of how concentrated the distribution of a random variable X is around its mean. Formally, the variance of a random variable X is defined as

Using the properties in the previous section, we can derive an alternate expression for the variance:

\begin{equation} E[(X − E[X])^2]
= E[X^2 − 2E[X]X + E[X]^2]
= E[X^2] − 2E[X]E[X] + E[X]^2
= E[X^2] − E[X]^2 \end{equation}

where the second equality follows from linearity of expectations and the fact that is actually a constant with respect to the outer expectation.

Properties:

Example Calculate the mean and the variance of the uniform random variable X with PDF elsewhere.

Example : Suppose that for some subset . What is ?

Discrete case:

\begin{equation} E[g(X)] = \sum_{x \in Val(X)} 1{x \in A}P_X(x)dx = \sum_{x \in A} P_X(x)dx = P(x \in A) \end{equation}

Continuous case:

2.6 Some common random variables

Discrete random variables

∼ Bernoulli(p) (where ): one if a coin with heads probability p comes up heads, zero otherwise.

∼ Binomial(n, p) : the number of heads in n independent flips of a coin with heads probability p. \begin{equation} p(x) = \binom{n}{x} \cdot p^x q^{n-x} \end{equation} • ∼ Geometric(p) : the number of flips of a coin with heads probability p until the first heads. \begin{equation} p(x) = p(1 − p)^{x-1} \end{equation} • ∼ Poisson(λ) (where λ > 0): a probability distribution over the nonnegative integers used for modeling the frequency of rare events. \begin{equation} p(x) = e^{\lambda} \frac{\lambda^x}{x!} \end{equation}

Continuous random variables

∼ Uniform(a, b) (where ): equal probability density to every value between a and b on the real line.

∼ Exponential(λ) (where λ > 0): decaying probability density over the nonnegative reals.

∼ Normal(, ): also known as the Gaussian distribution \begin{equation} \frac{1}{\sqrt{2\pi}\sigma}e^{-\frac{1}{2\sigma^2}(x-\mu)^2} \end{equation}

3.1 Joint and marginal distributions

Suppose that we have two random variables X and Y . One way to work with these two random variables is to consider each of them separately. If we do that we will only need and . But if we want to know about the values that X and Y assume simultaneously during outcomes of a random experiment, we require a more complicated structure known as the joint cumulative distribution function of X and Y , defined by \begin{equation}F_{XY} (x, y) = P(X \leq x, Y \leq y)\end{equation}

It can be shown that by knowing the joint cumulative distribution function, the probability of any event involving X and Y can be calculated.

The joint CDF FXY (x, y) and the joint distribution functions FX(x) and FY (y) of each variable separately are related by \begin{equation}F_X(x) = lim_{y \rightarrow \infty} F_{XY} (x, y)dy
F_Y(y) = lim_{x \rightarrow \infty} F_{XY} (x, y)dx \end{equation} Here, we call and the marginal cumulative distribution functions of .

Properties:

3.2 Joint and marginal probability mass functions

If X and Y are discrete random variables, then the joint probability mass function is defined by \begin{equation} p_{XY}(x, y) = P(X = x, Y = y). \end{equation} Here, for all and .

How does the joint PMF over two variables relate to the probability mass function for each variable separately? It turns out that \begin{equation} p_X(x) = \sum_y p_{XY} (x, y). \end{equation} and similarly for . In this case, we refer to as the marginal probability mass function of X. In statistics, the process of forming the marginal distribution with respect to one variable by summing out the other variable is often known as “marginalization.”

3.3 Joint and marginal probability density functions

Let X and Y be two continuous random variables with joint distribution function . In the case that is everywhere differentiable in both x and y, then we can define the joint probability density function,

\begin{equation} f_{XY}(x, y) = \frac{∂^2F_{XY}(x, y)}{∂x∂y} \end{equation}

Like in the single-dimensional case, , but rather \begin{equation} \int \int_{x \in A} f_{XY} (x, y)dx dy = P((X, Y ) \in A). \end{equation} Note that the values of the probability density function f_{XY}(x, y) are always nonnegative, but they may be greater than 1. Nonetheless, it must be the case that

Analagous to the discrete case, we define

as the marginal probability density function (or marginal density) of X, and similarly for .

3.4 Conditional distributions

Conditional distributions seek to answer the question, what is the probability distribution over Y, when we know that X must take on a certain value x? In the discrete case, the conditional probability mass function of X given Y is simply \begin{equation} p_{Y \mid X} (y \mid x) = \frac{p_{XY}(x, y)}{p_X(x)}, \end{equation} assuming that .

In the continuous case, the situation is technically a little more complicated because the probability that a continuous random variable X takes on a specific value x is equal to zero. Ignoring this technical point, we simply define, by analogy to the discrete case, the conditional probability density of Y given X = x to be \begin{equation} f_{Y \mid X}(y \mid x) = \frac{f_{XY} (x, y)}{f_X(x)} \end{equation} provided .

3.5 Bayes’s rule

A useful formula that often arises when trying to derive expression for the conditional probability of one variable given another, is Bayes’s rule.

In the case of discrete random variables X and Y ,

If the random variables X and Y are continuous,

3.6 Independence

Two random variables X and Y are independent if for all values of x and y. Equivalently, - For discrete random variables, for all , . - For discrete random variables, whenever for all . - For continuous random variables, for all . - For continuous random variables, whenever for all .

Informally, two random variables and are independent if “knowing” the value of one variable will never have any effect on the conditional probability distribution of the other variable, that is, you know all the information about the pair by just knowing and . The following lemma formalizes this observation:

Lemma 3.1. If and are independent then for any subsets , we have, \begin{equation} P(X \in A, Y \in B) = P(X \in A)P(Y \in B) \end{equation} By using the above lemma one can prove that if is independent of then any function of X is independent of any function of Y.

3.7 Expectation and covariance

Suppose that we have two discrete random variables and is a function of these two random variables. Then the expected value of g is defined in the following way, \begin{equation} E[g(X,Y)] = \sum_{x \in Val(X)} \sum_{y \in Val(Y)} g(x, y)p_{XY}(x, y). \end{equation}

For continuous random variables X, Y , the analogous expression is

We can use the concept of expectation to study the relationship of two random variables with each other. In particular, the covariance of two random variables X and Y is defined as

Using an argument similar to that for variance, we can rewrite this as,

Here, the key step in showing the equality of the two forms of covariance is in the third equality, where we use the fact that and are actually constants which can be pulled out of the expectation. When , we say that and are uncorrelated.

Properties:

Probability Review - Volodymyr Kuleshov