Random Variables
Fall 2025
Instructor:
Ajit Rajwade
1
Topic Overview
2
Random variable
3
Random variable
4
Value of X (Denoted as x) where X = sum of 2 dice throws | P(X=x) |
2 | 1/36 |
3 | 2/36 |
4 | 3/36 |
5 | 4/36 |
6 | 5/36 |
7 | 6/36 |
8 | 5/36 |
9 | 4/36 |
10 | 3/36 |
11 | 2/36 |
12 | 1/36 |
This is called the probability mass function (pmf) table of the random variable X. If S is the sample space, then
P(S) = P(union of all events of the form X = x) = 1 (verify from table).
Random variable: Notation
5
Random variable: discrete
6
Random variable: continuous
7
0
1
4
Random variable: continuous
8
Random variable: continuous
9
Random variable: continuous - example
FX (x) = 0 for x ≤ 0, and
FX (x) = 1-exp(-x2) otherwise
10
Probability Density Function (pdf)
11
12
The area beneath the blue curve in between the lines x = a and x = b is the cumulative interval measure P(a < X ≤ b) = FX (b) -FX (a ).
fX(a)dx = probability that the random variable X takes on values between a and a+dx.
a
b
x
fX(x)
dx
Probability Density Function
13
Examples: Popular families of PDFs
14
Examples: Popular families of PDFs
15
Expected Value (Expectation) of a random variable
16
Expected Value (Expectation) of a random variable
17
xm and α are parameters of the pdf for the Pareto distribution. Verify this result for E(X) on your own.
Expected Value (Expectation) of a random variable
18
See here.
See here.
Expected Value: examples
19
20
A Game of Roulette
Expected value of a function of random variable
21
Proof: Law of the Unconscious Statistician
22
We are starting with a conventional definition, which actually requires rigorous proof. We will show on the next slide that this is equal to the expected value of Y based on the fundamental definition of expectation.
Proof (continued): Law of the Unconscious Statistician
23
This justifies the previous formula for E(g(X)). Most textbooks just gloss over the formula, ignoring the fact that it requires proof. We have established that the accepted expression obeys the rigorous definition of expectation.
This step assumes that g is a strictly increasing function. There is a fix to this, if g were strictly decreasing. What is it?
Properties of expected value
24
This property is called the linearity of the expected value. In general, a function f(x) is said to be linear in x is f(ax+b) = af(x)+f(b) where a and b are constants. In this case, the expected value is not a function but an operator (it takes a function as input). An operator E is said to be linear if
E(af(x) + b) = a E(f(x)) + E(b). This is equal to aE(f(x)) + b for the expectation operator.
Properties of expected value
25
ai, bi are scalars
Properties of expected value
26
Suppose you want to predict the value of a random variable with a known mean. On an average, what value will yield the least squared error?
The expected value is the value that yields the least mean squared prediction error!
The median
27
The median
28
In this derivation, we are assuming that the two definite integrals of q(x) exist! This proof won’t go through otherwise.
The median
29
This is the median – by definition and it minimizes J(c). We can double check that J’’(c) >= 0. Notice the peculiar definition of the median for the continuous case here! This definition is not conceptually different from the discrete case, though. Also, note that the median will not be unique if FX is not differentiable at c. This happens when FX is not strictly increasing in some interval – say K = [c,c+ε] or [c-ε,c]. In such cases, all y ϵ K will qualify as medians and all of them will produce the same value of J(y). This is because fx(y) = 0 for y ϵ K.
What cost function does a quantile minimize?
30
Variance
31
Existence?
32
Variance: Alternative expression
33
Variance: properties
34
Probabilistic inequalities
35
Probabilistic inequalities
36
Markov’s inequality
37
Markov’s inequality
38
Chebyshev’s inequality
39
40
Andrey Andreyevich Markov[a] (14 June [O.S. 2 June] 1856 – 20 July 1922) was a Russian mathematician celebrated for his pioneering work in stochastic processes. Among his teachers were Yulian Sokhotski (differential calculus, higher algebra), Konstantin Posse (analytic geometry), Yegor Zolotarev (integral calculus), Pafnuty Chebyshev (number theory and probability theory), Aleksandr Korkin (ordinary and partial differential equations), Mikhail Okatov (mechanism theory), Osip Somov (mechanics), and Nikolai Budajev (descriptive and higher geometry).
Chebyshev’s inequality: another form
41
Back to counting money! ☺
42
Back to the expected value
43
Back to the expected value: weak law of large numbers
45
Back to the expected value: weak law of large numbers
46
Empirical (or sample) mean
Comments on weak law of large numbers
47
The strong law of large numbers
48
(The incorrect) Law of averages
49
(The incorrect) Law of averages
50
Joint distributions/pdfs/pmfs
51
Jointly distributed random variables
52
Joint CDFs
53
I’ll explain this a few slides further down
Joint PMFs
54
Why?
Joint PMFs: Example
55
Joint PDFs
56
57
X
Y
The joint probability that (X,Y) belongs to any arbitrary-shaped region in the XY-plane is obtained by integrating the joint pdf of (X,Y) over that region (eg: region C)
C
Joint and marginal PDFs
58
Independent random variables
i.e., the joint pdf is equal to the product of the marginal pdfs.
59
Try proving this yourself!
Independent random variables
i.e., the joint pdf is equal to the product of all n marginal pdfs.
60
Independent random variables
61
Independent random variables
62
Concept of covariance
63
Concept of covariance: properties
64
Concept of covariance: properties
65
Try proving this yourself! Along similar lines as the previous one.
Concept of covariance: properties
66
Notice that the variance of the sum of random variables is not equal to the sum of their individual variances. This is quite unlike the mean!
Concept of covariance: properties
67
Concept of covariance: properties
68
Conditional pdf/cdf/pmf
69
see next slide to understand what happens to the interval of Y values from y to y+𝛿
Conditional pdf/cdf/pmf
70
Conditional mean and variance
71
Example
72
In both cases, consider 0 < y < 1.
Moment Generating Functions
73
Definition
74
Why is it so called?
75
Key property
76
Other properties
77
Uniqueness
78
Vectors with n elements
Matrix of size n x n
Uniqueness: Another proof
79
Uniqueness: Continuous case
80
Chernoff’s bound
81
Chernoff’s bounds
82
MGFs and two-sided Laplace Transforms
83