0.1. Probability Review
0.1. Probability Review
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 A ∈ F (called events) are subsets of Ω
(i.e., A ⊆ Ω is a collection of possible outcomes of an expectation)
Probability measure: A function P : F 7→ R that satisfies the following properties
– P(A) ≥ 0 for all A ∈ F
– P(Ω) = 1
P
– If A1 , A2 , . . . are disjoint events (i.e. Ai ∩ Aj = ∅ if i ̸= j), then P(∪i Ai ) = i P(Ai ).
We interpret P(A ∪ B) as the probability of A or B happening, and P(A ∩ B) as the probability of A
and B happening.
Example 1. Consider the event of tossing a six-sided die. The sample space is Ω = {1, 2, . . . , 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 i/6, where i is the number of elements of the set; for example, P({1, 2, 3, 4}) = 4/6
and P({1, 2, 3}) = 3/6.
Definition 1 (Conditional probability). Let B be an event with non-zero probability. The conditional
probability of any event A given B is defined as
That is, P(A|B) is the probability measure of the event A after observing the occurrence of the event
B.
Definition 2 (Independency). We say A and B are independent if P(A ∩ B) = P(A)P(B) (or equiv-
alently, P(A|B) = P(A)). 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
ω = (H, H, T, H, T, H, H, T, T, T ) ∈ Ω.
1
2 RANDOM VARIABLES
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 X is a function X : Ω 7→ R. Typically, we will denote random
variables using upper case letters X(ω) or more simply X (where the dependence on the random
outcome ω is implicit). We will denote the value that a random variable may take on using lower case
letters x.
Example 2. In our experiment above, suppose that X(ω) is the number of heads which occur in the
sequence of tosses ω. Given that only 10 coins are tossed, X(ω) 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 k is
Example 3. Suppose that X(ω) is a random variable indicating the amount of time it takes for a
radioactive particle to decay. In this case, X(ω) takes on an 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
P a ≤ X ≤ b := P {ω : a ≤ X(ω) ≤ b} .
In the case of discrete random variable, we use the notation Val(X) for the set of possbile values that
the random variable X can take. For example, if X(ω) is a random variable indicating the number of
heads out of ten tosses of coin, then Val(X) = {0, 1, . . . , 10}. It is clear that
X
PX (x) = P(X ∈ A).
x∈A
2
2 RANDOM VARIABLES
2.4 Expectation
Suppose that X is a discrete random variable with PMF pX (x) and g : R 7→ R is an arbitrary
function. In this case, g(X) can be considered as a random variable, and we define the expectation as
X
E[g(X)] := g(x)pX (x).
x∈Val(X)
If X is a continuous random variable with PDF fX (x), then the expected value of g(X) is defined as
Z ∞
E[g(X)] := g(x)fX (x)dx.
−∞
Intuitively, the expectation of g(X) can be thought of as a “weighted average” of the values that g(x)
can take on for different values of x, where the weights are given by pX (x) or fX (x).
Below we list some useful properties
E[af (X)] = aE[f (X)] for any constant a ∈ R.
(Linearity of expectation): E[f (X) + g(X)] = E[f (X)] + E[g(X)]
For a discrete random variable X, E[I[X = k]] = P(X = k), where I[·] is an indicator function,
taking value 1 if the event happens and 0 otherwise.
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
Var[X] := E[(X − E[X])2 ].
We can give an alternate expression for the variance
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 .
For any constant a ∈ R, we know that Var[af (X)] = a2 Var[f (X)].
Example 4. Calculate the mean and the variance of the uniform random variable X with PDF
fX (x) = 1, ∀x ∈ [0, 1] and 0 otherwise. Then
Z ∞ Z 1
E[X] = xfX (x)dx = xdx = 1/2,
−∞ 0
Z ∞ Z 1
E[X 2 ] = x2 fX (x)dx = x2 dx = 1/3
−∞ 0
1 1 1
Var[X] = E[X 2 ] − (E[X])2 = − = .
3 4 12
3
3 TWO RANDOM VARIABLES
FX (x) = lim FXY (x, y)dy, FY (y) = lim FXY (x, y)dx.
y→∞ x→∞
4
3 TWO RANDOM VARIABLES
3.5 Independence
Two random variables X and Y are independent if FXY (x, y) = FX (x)FY (y) for all values of x
and y. For discrete random variables, this is equivalent to saying that
Informally, two random variables X and Y 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 (X, Y ) by just knowing f (x) and f (y). The following lemma
formalizes this observation.
Lemma 1. If X and Y are independent, then for any subsets A, B ⊂ R we have
Sometimes we also talk about conditional independence, meaning that if we know the value of a
random variable (or more generally, a set of random variables), then some other random variables will
be independent of each other. Formally, we say “X and Y are conditionally independent given Z” if
pX|Z (x|z) = pX|Y,Z (x|y, z) ⇐⇒ pX,Y |Z (x, y|z) = pX|Z (x|z)pY |Z (y|z).
5
3 TWO RANDOM VARIABLES
Properties
(Linearity of expectation) E[f (X, Y ) + g(X, Y )] = E[f (X, Y )] + E[g(X, Y )]