Probability and Statistics Fundamentals
Probability and Statistics Fundamentals
Lecture 1
Data → Analysis → Utilizing Data
We begin by considering two primary modelling approaches:
• Deterministic Models: No uncertainty is involved. Examples include:
V = IR, F = ma
w = f (u) + ϵ
1. Reduce error
2. Increase accuracy
1 Statistics
Statistics can be divided into three broad categories:
1
1.2 Predictive Statistics
• Analyzing historical data for prediction
• Using a mathematical structure for prediction to understand the behaviour of the
entire population
Population
Sample
2 Probability Theory
Favourable outcomes
Total outcomes
2
2.3 Random Experiment
• Number of possible outcomes is fixed.
• In a deterministic experiment, the number of outcomes is fixed and known.
• For a random experiment, the set of outcomes is fixed, but the actual outcome is not
fixed.
• Repetition under identical conditions is possible.
2.5 Events
Definition 3. An Event is any subset of the sample space S. The empty set ∅ is also an
event.
1. P (S) = 1
2. If A ∩ B = ∅, then:
P (A ∪ B) = P (A) + P (B)
3
If |S| = ∞, then:
|P(S)| = 2∞ = ∞
4
Lecture 2
P : F → [0, 1]
1. P (S) = 1
1. ∅ ∈ P(S)
2. S ∈ P(S)
5
2.11 Sigma Algebra
Definition 5. A sigma algebra F is a set of subsets of S such that:
1. ∅ ∈ F
2. If A ∈ F, then Ac ∈ F
3. If A, B ∈ F, then A ∪ B ∈ F
Remark 2 (De Morgan’s Law). Union and complement closure imply intersection closure:
A ∩ B = (Ac ∪ B c )c ∈ F
Proposition 1. The power set P(S) is maximal sigma algebra.
Example 4. S = {1, 2, . . . , 6}, throwing a die. Let A = {1, 3, 5}. Define F = {∅, S, A, Ac }.
Example 5. S = {1, 2, 3, 4, 5, 6}, A = {2, 4, 6}, B = {3, 6}. Find the smallest sigma algebra
F containing A and B.
Example 6. F = {∅, S} is the minimal sigma algebra.
6
2.14 Independence and Conditional Probability
If A and B are independent:
P (A ∩ B) = P (A)P (B)
If dependent:
P (A ∩ B) = P (A)P (B|A)
where P (B|A) is the conditional probability of B given A.
• The process of conditioning reduces the sample space. For example, searching for a
student in IITJ given that the student is in the Lecture Hall Complex (LHC).
Lecture 3
where:
P (A) = Probability of A, P (A|B) = Probability of A given B.
Given more and more information, uncertainty reduces. The process of updating information
is called conditioning.
7
2.18 Axioms for Conditional Probability
Check if P (A|B) satisfies probability axioms:
1. P (S|B) = 1
2. If A1 and A2 are mutually exclusive then P (A1 ∪ A2 | B) = P (A1 | B) + P (A2 | B)
1 2 3
We can compute:
P (0 received) = P (0 received | 0 transmitted)P (0) + P (0 received | 1 transmitted)P (1)
8
2.20 Bayes’ Theorem
If an item is found defective, we can ask: “Where did it come from?” — the place of
maximum likely.
P (I ∩ D) P (D|I)P (I)
P (I|D) = =P
P (D) i P (D|Ii )P (Ii )
which implies:
P (A)P (B|A)
P (A|B) =
P (B)
Lecture 4
Bayes’ Theorem:
P (A ∩ B) P (A) · P (B | A)
P (A | B) = =
P (B) P (B)
Bayes’ theorem requires knowledge of priors and likelihoods.
9
Example: Manufacturing Defects from Multiple Units
Let:
D : Defective item found
I1 , I2 , I3 : Events that the item came from Unit I, II, III respectively
Given:
P (I1 ) = 0.6, P (I2 ) = 0.1, P (I3 ) = 0.3
P (D | I1 ) = 0.01, P (D | I2 ) = 0.10, P (D | I3 ) = 0.20
Step 1: Compute Total Probability of Defect (Using the law of total probability)
3
X
P (D) = P (Ii ) · P (D | Ii )
i=1
10
• P (D): Marginal probability of data
Applications include:
• Bayesian Networks
• Naive Bayes Classifier
• Email spam filtering
4 Independence of Events
Two events A and B are sain to be independent if:
P (A ∩ B) = P (A) · P (B)
If not independent:
P (A ∩ B) = P (A) · P (B | A) = P (B) · P (A | B)
Alternatively:
P (B | A) = P (B)
11
Examples:
{H, T }, {Even, Odd}, {1, 2, 3, 4, 5, 6}
6 Random Variables
A Random Variable (RV) is:
X:S→R
Example: Coin Toss
S = {H, T }, X(H) = 0, X(T ) = 1
1 1
P (X = 0) = , P (X = 1) =
2 2
Lecture 5
7 Random Variable
The sample space, defined as the set of all possible outcomes of an experiment, represents
the set of uncertainty.
Depending upon the underlying random experiment, we can have different types of sample
spaces:
• S is finite.
• S is countably infinite.
• S is uncountable.
12
Examples
1. Number of games to win the first match:
• Minimum: 1
• Maximum: Unknown upper limit
X:S→R
Support of a random variable: The set of values of the random variable, corresponding
to which we have non-zero probability.
Can X = 3?
Yes, but with probability P = 0.
13
Probability Distribution of X
X 0 1 2
PX 14 12 14
Here,
P (X = 0) = P (TT) = P (1st toss T ∩ 2nd toss T)
Since the tosses are independent:
P (TT) = P (T ) · P (T )
In general:
P (A ∩ B) = P (A) · P (B)
Remark
If we map elements from S to R, the resulting function is a random variable.
Conditions:
14
1. pi ≥ 0, ∀i
n
X
2. pi = 1
i=1
Example
India vs England – 5 matches. Let X = number of wins by India:
X ∈ {0, 1, 2, 3, 4, 5}
15
7.5 Experiments and Data Collection
Consider an experiment: “How many successes in n trials?” We can determine probabilities:
• From historical data (statistics)
• From simulation
• By processing experimental observations
In practice, we have:
X: x1 , x2 , . . . , xn (observations)
P : p1 , p2 , . . . , pn (probabilities)
FX (x) = P (X ≤ x)
Graphical Representation
The CDF is a step function with jumps at each point xi where P (X = xi ) > 0.
• Jumps correspond to the probability mass function (PMF).
• Maximum jump size = 1
• Minimum jump size = 0
16
7.7 Properties of CDFs
1. lim FX (x) = 0, lim FX (x) = 1
x→−∞ x→+∞
2. FX (x) is non-decreasing.
3. FX (x) is right-continuous:
FX (x) = FX (x+ )
It may have left-hand limits (LHL) but is not necessarily left-continuous (for discrete
RVs, it has jumps).
Points of Discontinuity
For a discrete random variable X, the points of discontinuity of the cumulative distribu-
tion function (CDF) correspond to the values in the support of X.
Example:
Points of discontinuity: 0, 1, 2
1 1 1
PX (0) = , PX (1) = , PX (2) =
2 4 4
17
CDF ↔ Probability Distribution
Given the CDF FX (x), the probability mass function (PMF) for a discrete random variable
can be obtained as:
pX (x) = FX (x+ ) − FX (x− )
where:
• FX (x+ ) = limt→x+ FX (t) (right-hand limit)
• FX (x− ) = limt→x− FX (t) (left-hand limit)
These jumps in the CDF correspond to the probabilities P (X = x).
18
Lecture 6
Random Variables and Distribution Functions
Types:
If:
X ∈ {0, 1, 2}
with:
1 1 1
P (X = 0) = , P (X = 1) = , P (X = 2) =
3 3 3
The CDF will be a step function with jumps at x = 0, 1, 2.
19
4. Properties of CDF F (x):
1. limx→−∞ F (x) = 0, limx→∞ F (x) = 1
2. F (x) is non-decreasing.
3. F (x) is right-continuous.
4. For a discrete R.V.:
P (X = x) = F (x) − F (x− )
(Point probability or PMF)
Summary Table:
Feature Discrete R.V. Continuous R.V.
Values Finite / Countable Infinite (measurable)
PMF Yes No
PDF No Yes
P (X = x) > 0 possible Always 0
CDF Type Step function Continuous function
20
Probability Density Function (PDF)
We replace the Probability Mass Function (PMF) for discrete variables with the Prob-
ability Density Function for continuous variables.
and Z ∞
f (x) dx = 1
−∞
Example
2x, 0 < x < 1,
f (x) =
0, otherwise.
Here f (x) is a valid PDF.
Probability between k1 and k2 :
Z k2
P (k1 ≤ X ≤ k2 ) = 2x dx
k1
Example:
1 3 Z 3/4
P <X< = 2x dx
4 4 1/4
21
From PDF to CDF
Z x
FX (x) = f (t) dt
−∞
22
Lecture 7
Example
0 < x < 1,
x,
3
f (x) = kx , 1 ≤ x ≤ 2,
0, otherwise.
Solution: Using the definition of PDF, we have
Z ∞
f (x)dx = 1
−∞
Z 1 Z 2
2
xdx + kx3 dx = 1 =⇒ k =
0 1 15
Now CDF is
0, x < 0,
x2 ,
0 ≤ x ≤ 1,
FX (x) = 12 1 4
2
+ 30 (x − 1), 1 ≤ x ≤ 2,
1, otherwise.
X:0 1 2 3
1 3 3 1
PX :
8 8 8 8
What is the probability distribution of Y = g(X)?.
Let Y = X 2
Y :0 1 4 9
1 3 3 1
PY :
8 8 8 8
Consider the following distribution
X : −1 1 1
1 1 1
PX :
3 3 3
Let Y = X 2
Y :0 1
23
1 2
PY :
3 3
Let X be a Continuous Random Variables with probability density function fX (x) then what
is the pdf of Y = g(X)?
FY (y) = P (Y ≤ y) = P g(X) ≤ y .
Can we convert it into known distribution fX (x)?
FY (y) = P X ≤ g −1 (y) (is g invertible?)
= FX (g −1 (y)).
d
fY (y) = FY (y).
dy
Since FY (y) = FX (g −1 (y)), we have
d −1
fY (y) = fX g −1 (y) · g (y) (is g differentiable?)
dy
Example
1, 0 < x < 2,
2
fX (x) =
0, otherwise.
Let Y = X 2 , find fY (y)?.
Solution:
FY (y) = P (Y ≤ y)
= P X2 ≤ y
√
=P X≤ Y .
√
Here FY (y) = FX ( Y ). Now, we get
d √
FX ( Y )
fY (y) =
dY
√ 1
= fX ( y). √
2 Y
1
= √ , 0 < y < 4.
4 Y
Theorem 3. Let X be a continuous random variable with probability density function fX (x)
and Y = g(X) be a monotonic and differentiable function. Then the probability density
function of Y is given by
d −1
fY (y) = fX g −1 (y) g (y) , y ∈ R.
dy
24
Proof. Since g(X) is one-to-one and continuous, it is either strictly monotonically increasing
or decreasing. Assume that it is strictly monotonic increasing. The cdf of Y is given by
Example
We consider fX (x) = 21 , 0 < x < 2 and Y = eX , then find fY (y)?.
25
Lecture 8
Example
Consider fX (x) = 1, 0 < x < 1 and Y = X 3 , then find fY (y)?.
Solution: Here, Y is a strictly increasing and differentiable function in the given domain.
Then from theorem 3, we have
d −1 1 1
fY (y) = fX g −1 (y) · g (y) = fX (y 1/3 ) · y −2/3 , = 2/3 , 0 < y < 1.
dy 3 3y
1
Verification: To check whether fY (y) = y −2/3 is a valid pdf or not.
3
To verify this
1. Total probability: Z 1
fY (y) dy = 1.
0
Here 1
Z 1 Z 1
1 −2/3 1
fY (y) dy = y dy = 3y 1/3 = 1.
0 0 3 3 0
Result: Let X be a continuous random variable with pdf fX (x). Suppose Y = g(X) be
piecewise monotonic function of X. If g1 , g2 , · · · , gn are piecewise monotonic component of
g such that they all map to same range of Y . Then
n
d −1
fX (gi−1 (y))|
X
fY (y) = (g (y))|
i=1 dy i
Example
Let fX (x) = 21 , −1 < x < 1 and Y = X 2 .
Solution: Y = X 2 is neither increasing nor decreasing in (−1, 1). From −1 < x < 1, this
maps to 0 ≤ y < 1. For a given Y (which is positive), we have two inverse images:
√ √
x = − y, −1 < x < 0 and x = + y, 0 < x < 1.
26
So, if we consider two portions of the domain, both are mapped to same range. So, the
idea here is that in each part of the domain, the function will be one-to-one i.e. if we are
√ √
considering only one inverse image say + y or − y) then the function is either increasing
or decreasing. Therefore, we calculate the density in each region separately and add it. So,
we have
√ d√ √ d √
fY (y) = fX ( y)| y| + fX (− y)| (− y)|
dy dy
1 1 1 1
= √ + √
22 y 22 y
1
= √ , 0 < y < 1.
2 y
Example
1
Let fX (x) = , −1 < x < 2 and Y = X 2 .
3
Solution:
From above results, we have
√ d√ √ d √
fX ( y) y + fX (− y) (− y) , 0 < y < 1,
dy dy
fY (y) =
√ d√
fX ( y) y , 1 < y < 4.
dy
1 d√ 1
Since fX (x) = and y = √ , we get
3 dy 2 y
1
Example
Let fX (x) = π1 , 0 < x < π and Y = sin X.
27
Lecture 9
Example
1. Let the random variable X of the discrete type have the pmf given by
X:0 1 2 3
1 3 3 1
PX :
8 8 8 8
we have
1 3 3 1 3
E(X) = (0 × ) + (1 × ) + (2 × ) + (3 × ) = .
8 8 8 8 2
2. Let the random variable X of the continuous type have the pdf given by
Then Z 1
3
E(X) = x · 3x2 dx = .
0 4
Definition 7. Suppose XR is a continuous random variable with pdf fX (x) and let Y = g(X)
∞
for some function g. If −∞ |g(x)|fX (x)dx < ∞, then the expectation of Y exists and it is
given by Z ∞
E(g(X)) = g(x)fX (x)dx.
−∞
28
• Case:1 If g(X) = X r , then rth moment about the origin is
n
E(X r ) = xri pi ,
X
(for discrete random variable)
i=1
Z ∞
r
E(X ) = xr f (x)dx, (for continuous random variable)
−∞
or h i Z ∞
2
E (X − E(X)) = (x − µ)2 f (x)dx.
−∞
Variance
h i
The variance (measure of randomness) of X is defined to be E (X − E(X))2 . It is denoted
by σ 2 or by Var(X).
h i h i
Var(X) = E (X − E(X))2 = E (X 2 − 2E(X)X + (E(X))2 ) ;
So, 2
Var(X) = E(X 2 ) − E(X) .
Note: Var(X) ≥ 0.
29
Example
X : −1 0 1
1 1 1
PX : .
3 3 3
By solving this E(X) = 0 and E(X 2 ) = 32 . Therefore
2
Var(X) = σ 2 = .
3
Standard Deviation
q
σ= Var(X).
Convex Function
A function h : R → R is said to be convex on an interval I ⊆ R if
h λx + (1 − λ)y ≤ λf (x) + (1 − λ)f (y),
Jensen’s Inequality
Let h : R → R be a convex function, and let X be a random variable. Then
h E(X) ≤ E(h(X)).
Note: In general,
h(E(X)) ̸= E(h(X)).
Examples:
1 1
X E(X)
E(e ) ̸= e , E ̸= .
X E(X)
30
Lecture 10
Properties of Expectation
1. For constants a, b ∈ R,
E[aX + b] = a E[X] + b.
2. For constants a, b ∈ R,
2
Var(aX + b) = E[(aX + b)2 ] − E[aX + b] = a2 Var(X).
Moments
• The first moment is the expectation:
E[X].
Var(X).
Existence of Moments
If E[X r ] exists for some r, then E[X s ] also exists for all s ≤ r.
31
Example 1
X : −1, 0, 1
PX : 14 , 14 , 1
2
Mean:
1
E(X) =
4
Second Moment:
3
E(X 2 ) =
4
Variance: 2
3 1 11
Var(X) = − =
4 4 16
MX (t) = e−t · 1
4
+ e0·t · 1
4
+ e1·t · 1
2
1 1 1
MX (t) = e−t + + et
4 4 2
The pdf is
1, 0 < x < 2,
f (x) = 2
0, otherwise.
The MGF is Z 2
1
MX (t) = etx · dx.
0 2
#2
1 etx
" !
1 e2t − 1
MX (t) = · = , t ̸= 0.
2 t 0
2 t
Thus,
e2t − 1
MX (t) = , t ̸= 0.
2t
32
Example 2
The pdf is
f (x) = e−x , x > 0.
The MGF is Z ∞ Z ∞
MX (t) = e−x etx dx = e−(1−t)x dx.
0 0
t2
MX (t) = 1 + t E[X] + E[X 2 ] + · · ·
2!
From the series expansion,
d
E[X] = MX (t) ,
dt t=0
dn
E[X n ] = MX (t) .
dtn t=0
Result
If X and Y are two random variables such that
MX (t) = MY (t),
then X and Y are identically distributed, that is, both X and Y follow same probability
distribution.
33
Example
Let
X : −1, 0, 1, P (X) = 13 , 31 , 13 .
Then,
E[X] = (−1) · 31 + 0 · 13 + (1) · 1
3
= 0.
The moment generating function (MGF) may not exist for all values of t. For some
distributions, the integral Z ∞
MX (t) = etx f (x) dx
−∞
Property
Since |eitx | = 1, Z ∞ Z ∞
|φX (t)| ≤ |eitx |f (x) dx = f (x) dx = 1.
−∞ −∞
Hence,
|φX (t)| ≤ 1 for all t.
Note:
• MGFs may not exist always.
• Characteristic functions always exist.
34
Lecture 11
Property of MGF
If
MX (t) = MY (t),
then X and Y are identically distributed.
Basic Properties
1. MX (0) = 1
Z ∞
φX (t) = eitx f (x) dx
−∞
From inversion,
1 Z ∞ −itx
f (x) = e φX (t) dt
2π −∞
For X ∼ Exp(1),
1
MX (t) = , t < 1.
1−t
Thus,
1
φX (t) = MX (it) = .
1 − it
This CF can be inverted to recover the pdf of the exponential random variable.
We had earlier:
1 Z∞ 1
f (x) = e−ixt dt
2π −∞ 1 − it
35
Moment Inequalities
Example:
Suppose the salary of people is a random variable X, but the exact distribution is unknown.
If the average salary is given as E[X], then
E[X]
P (Salary ≥ 50, 000) ≤ .
50, 000
Proof
Z ∞
E[h(X)] = h(x)f (x) dx
−∞
Note that the second integral is always non-negative, and for the first integral, since h(x) ≥ ε,
Z
h(x)f (x) dx ≥ ε P (h(X) ≥ ε).
h(x)≥ε
Thus,
E[h(X)] ≥ ε P (h(X) ≥ ε).
E[h(X)]
=⇒ P (h(X) ≥ ε) ≤ .
ε
This proves Markov’s Inequality.
We know: Z
E[h(X)] ≥ h(x)f (x) dx
h(x)≥ε
36
=⇒ E[h(X)] ≥ ε P (h(X) ≥ ε).
Thus,
E[h(X)]
P (h(X) ≥ ε) ≤ .
ε
Equivalently,
E[h(X)]
P (h(X) < ε) ≥ 1 − .
ε
Application
Markov’s Inequality provides a fundamental tool for bounding probabilities. It is the basis
for deriving further inequalities, such as Chebyshev’s Inequality.
Markov Inequality:
If we take
h(X) = |X|r , r > 0,
then for any ε > 0:
E[|X|r ]
P (|X|r ≥ εr ) ≤ .
εr
Equivalently,
E[|X|r ]
P (|X| ≥ ε) ≤ .
εr
This is the general form of Markov’s Inequality.
We start with the general inequality:
E |X|r
Pr |X| ≥ ε ≤ , for r > 0.
εr
37
Chebyshev’s Inequality
Suppose X is a random variable with expectation E(X) = µ and variance Var(X) = σ 2 .
We choose the function h(X) = (X − µ)2 . Then, for any k > 0,
E (X − µ)2 σ2 1
Pr (X − µ)2 ≥ k 2 σ 2 ≤ = = 2.
k2σ2 2
k σ 2 k
Hence,
1
Pr |X − µ| ≥ kσ ≤ .
k2
Equivalently,
1
Pr |X − µ| < kσ ≥ 1 − .
k2
For k = 2,
1 3
Pr |X − µ| < 2σ ≥ 1 − = .
4 4
38
Lecture 12
P (X = 1) = p, P (X = 0) = 1 − p
x 0 1
P (X = x) 1 − p p
General form:
P (X = r) = pr (1 − p)1−r , r ∈ {0, 1}
• Expectation:
E(X) = p
• Variance:
Var(X) = p(1 − p)
• Moment generating function (MGF):
MX (t) = E etX = (1 − p) + pet
Remark: A Bernoulli trial is a trial where there are exactly two possible outcomes (suc-
cess/failure).
Binomial Distribution
Consider a random variable X = number of successes out of n Bernoulli trials. Here, n is
the total number of trials in an experiment.
2. All the trials are identical, i.e., the probability of success in each trial is the same,
denoted by p.
39
Let Xi ∼ Bernoulli(p), where
P (Xi = 1) = p, P (Xi = 0) = 1 − p.
Then,
X = X 1 + X2 + · · · + Xn
is the sum of n Bernoulli trials, called a Binomial random variable.
X ∈ {0, 1, 2, . . . , n}
P (X = 0) = (1 − p)n
!
n
P (X = 1) = p(1 − p)n−1
1
Example
Suppose India vs. Australia, 5 matches. Let
X ∼ Binomial(5, p).
Then, !
5 r
P (X = r) = p (1 − p)5−r , r = 0, 1, 2, . . . , 5.
r
• P (X ≤ 2) ̸= P (X < 2)
• P (X ≤ 3) ̸= P (X < 3) = P (X ≤ 2)
n
!
n r
p (1 − p)n−r .
X
E(X) = r
r=0 r
Simplifying, we get
E(X) = np.
40
Var(X) = E(X 2 ) − (E(X))2 = np(1 − p).
n
!
tX tr n r
p (1 − p)n−r .
X
MX (t) = E(e ) = e
r=0 r
Simplifying, n
MX (t) = pet + (1 − p) .
Conditions
• n is large (n → ∞),
• p is small (p → 0),
• such that λ = np remains finite.
Binomial pmf
!
n r
P (X = r) = p (1 − p)n−r .
r
Substitute p = nλ :
!r !n−r
n(n − 1) · · · (n − r + 1) λ λ
P (X = r) = 1− .
r! n n
Limit
As n → ∞,
n(n − 1) · · · (n − r + 1)
→ 1,
nr
and !n
λ
1− → e−λ .
n
Thus,
e−λ λr
P (X = r) = , r = 0, 1, 2, . . .
r!
41
Lecture 13
Poisson’s Distribution
Let X be a discrete random variable. X is said to follow Poisson’s distribution with param-
eter λ if
λr e−λ
P (X = r) = , r = 0, 1, 2, . . .
r!
∞
X λr e−λ
=1
r=0 r!
In Practice
• X: no. of occurrences of an event in unit time interval.
• λ: average no. of occurrences in unit time interval (in a hour).
Example
Whether a car passes or not, Bernoulli distribution because
Example 1
Let X: no. of accidents in one week.
It is again Bernoulli as:
P (X = 5)
42
Example 2
Let X: no. of patients having cancer.
Yes → 1, No → 0
Question 2
Probability of 5 accidents in 2 weeks:
λ=6
65 e−6
P (Y = 5) =
5!
Note
If n is large and p is small, then the results generated from Binomial and Poisson are almost
same.
Recurrence Formula
λr e−λ
P (X = r) =
r!
λ
P (X = r + 1) = P (X = r)
r+1
V ar(X) = λ
43
Moment Generating Function
∞
λr e−λ
ert ·
X
MX (t) =
r=0 r!
t t
= e−λ · eλe = eλ(e −1)
t
MX (t) = eλ(e −1)
Lecture 14
Geometric Distribution
Definition 8 (Number of failures before the first success). Let the random variable X be
the number of failures before the first success occurs. The probability mass function (PMF)
is given by:
P (X = r) = (1 − p)r p for r = 0, 1, 2, . . .
Definition 9 (Number of trials to get the first success). Let the random variable X be the
number of trials required to get the first success. The PMF is given by:
P (X = r) = (1 − p)r−1 p for r = 1, 2, 3, . . .
Note 8.1. We will use the second definition (number of trials) for the following examples
and properties. Let q = 1 − p.
Example 11 (UPSC Qualification). Let the probability of qualifying for the UPSC exam in
a single attempt be p = 0.3. Let X be the number of attempts needed to qualify. What is the
probability that exactly 4 attempts are needed?
44
• Moment Generating Function (MGF):
∞
tX
etr pq r−1
X
MX (t) = E[e ] =
r=1
∞
= pet (qet )r−1
X
r=1
t
pe
= , provided qet < 1
1 − qet
Property 8.1 (Memoryless Property). The Geometric distribution is the only discrete dis-
tribution that has the memoryless property.
This means that, given the first m trials were failures, the probability of having at least n
more failures is the same as the original probability of having at least n failures.
Proof of the Memoryless Property. The cumulative distribution function (CDF) is FX (r) =
P (X ≤ r) = 1 − q r .
Therefore, the survival function is P (X > r) = 1 − P (X ≤ r) = q r .
By the definition of conditional probability:
P ((X > m + n) ∩ (X > m))
P (X > m + n | X > m) =
P (X > m)
P (X > m + n)
= (since if X > m + n, it must be that X > m)
P (X > m)
q m+n
= m
q
n
=q
= P (X > n)
The logic is that the rth trial must be the k th success, and the preceding r − 1 trials must
contain exactly k − 1 successes.
Note 8.2. The Negative Binomial distribution does not satisfy the memoryless property.
45
Standard Continuous Distributions
Lecture 15
Gamma Function
The Gamma function, Γ(n), is useful for integration.
Γ(n) = 0∞ e−x xn−1 dx
R
•
• For a positive integer n, Γ(n) = (n − 1)!
• A useful property is Γ(n) = (n − 1)Γ(n − 1)
A general form: 0∞ e−ax xn−1 dx = Γ(n)
R
• an
46
Gamma Distribution
Let X ∼ G(α, β). The PDF is:
1
fX (x) = xα−1 e−x/β , x > 0, α > 0, β > 0
Γ(α)β α
Special Cases
• When α = 1, the Gamma distribution becomes the Exponential distribution:
1 1
fX (x) = 1
x1−1 e−x/β = e−x/β
Γ(1)β β
• When α = 2:
1 x
fX (x) = 2
x2−1 e−x/β = 2 e−x/β
Γ(2)β β
Mean: E(X) = αβ
h 1 Z ∞ h −x/λ
E(X ) = x e dx
λ 0
For the Gamma distribution:
• Mean: E(X) = αβ
• Second Moment: E(X 2 ) = α(α + 1)β 2
• Variance: V ar(X) = E(X 2 ) − [E(X)]2 = αβ 2
1 1
• MGF: MX (t) = (1−βt) α , for t < β
47
Lecture 16
1 1 x−µ 2
fX (x) = √ e− 2 ( σ )
σ 2π
For a normal distribution:
• Mean (E(X)) = µ
!
Z ∞
1 (x − µ)2
Z ∞
E(X) = xf (x) dx = x · √ exp − dx
−∞ −∞ σ 2π 2σ 2
X−µ
– Put σ
=Z
!
1 Z∞ z2
=√ (µ + σz) exp −
2π −∞ 2
! !
µ Z∞ z2 σ Z∞ z2
=√ exp − dz + √ z exp − dz
2π −∞ 2 2π −∞ 2
R∞ z
2
√
– Where −∞ exp − 2 dz = 2π
R∞ 2
– −∞ z exp − Z2 dz = 0
=⇒ E(X) = µ
• Variance = σ 2
1 2 2
• MGF = E(eXt )= e µt+ 2 σ t
X −µ
Z=
σ
and follows a standard normal distribution:
Z ∼ N (0, 1).
48
For a random variable X following a normal distribution with X ∼ N (µ, σ 2 ) the transfor-
mation of density function on normalization is fX (x) →
− fZ (z), and it becomes:
d 1 −Z 2
fz (z) = fX (µ + σZ) (µ + σZ) = √ e 2
dZ 2π
Properties
• Z has mean 0:
X −µ 1
E[Z] = E = (E[X] − µ) = 0.
σ σ
• Z has variance 1:
X −µ 1
V ar(Z) = V ar = 2 V ar(X) = 1.
σ σ
• Z has Coefficient of Skewness 0:
E[Z 3 ] = 0
• Z has Coefficient of Kurtosis 0:
E[Z 4 ] = 3
49
Lecture 17
Example
In a class, the marks obtained by students in a subject follow a normal distribution with
mean 35 and variance 16. Find the probabilities:
(1)P (X < 40)
(2)P (30 < X < 40)
(3)P (X > 45)
= P (Z > 2.5)
Example 1:
Let P (Z ≤ a + b) = 0.7 and P (Z ≤ 2a − b) = 0.4, find a and b ?
P (Z ≤ 2a − b) = 0.4 =⇒ a + b = Z0.6
50
Figure 1: P (Z > Zp ) = p or P (Z ≤ Zp ) = 1 − p
From the Z-table Z0.3 = 0.52 and Z0.6 = −0.26, solve for a and b
Example 2:
Find out µ and σ if it is given that the P (X > 30) = 0.4, P (X < 18) = 0.05 and X ∼
N (µ, σ 2 ).
30−µ 30−µ
Since, P (X > 30) = 0.4 =⇒ P (Z > σ
) = 0.4 =⇒ σ
= Z0.4 and
18−µ 18−µ
P (X < 18) = 0.05 =⇒ P (X > 18) = 0.95 =⇒ P (Z > σ
) = 0.95 =⇒ σ
= Z0.95
30−µ 18−µ
From the Z-table, σ
= 0.25 and σ
= 1.65, solve for µ and σ
Variant 1: The linear Form of X, i.e Y = aX + b also follows normal distribution with
mean µa + b and variance a2 σ 2
Since,
MY (t) = Max+b (t) = E(e(ax+b)t ) = ebt MX (at)
1 2 (at)2
= ebt eµ(at)+ 2 σ
1 2 (at)2
= e(µa+b)t+ 2 σ
51
Comparing with the MGF of the Normal distribution, Mean= µa + b and Variance = a2 σ 2
Variant 2:Log Normal Distribution
If the log of a normal distribution follows a normal distribution
Let Y = eX =⇒ X = ln Y, Y ∈ (0, ∞)
Mean:
The mean of X is E[X] = E[eY ].
Using the moment-generating function (MGF) of Y :
1 2 t2
MY (t) = E[etY ] = eµt+ 2 σ ,
we set t = 1 to get
σ2
E[X] = E[eY ] = MY (1) = eµ+ 2 .
Variance:
The variance of X is
Var(X) = E[X 2 ] − (E[X])2 .
We have
2
E[X 2 ] = E[e2Y ] = MY (2) = e2µ+2σ .
Thus, 2
σ2
2 2 2
2
2
Var(X) = e2µ+2σ − eµ+ 2 = e2µ+2σ − e2µ+σ = eσ − 1 e2µ+σ .
52
Lecture 18
X\Y y1 y2 y3 ··· ym P (X = xi )
x1 p11 p12 p13 ··· p1m p1∗
x2 p22 p22 p23 ··· p2m p2∗
x3 p32 p32 p33 ··· p3m p3∗
.. .. .. .. .. .. ..
. . . . . . .
xn pn1 pn2 pn3 · · · pnm pn∗
P (Y = yj ) p·1 p·2 p·3 · · · p·m 1
a) pX,Y (x, y) ≥ 0,
XX
b) pX,Y (x, y) = 1.
x y
Marginal Distributions
Marginal probability mass function (PMF) of x and y is given as
X X
pX (x) = p(x, y), pY (y) = p(x, y).
y x
53
Conditional Distributions
Conditional PMF of x given y is defiend as
p(x, y)
P (X = x | Y = y) = , pY (y) > 0.
pY (y)
p(x, y)
P (Y = y | X = x) = , pX (x) > 0.
pX (x)
Independence
X and Y are independent if
P (X = xi , Y = yj , Z = zk ) = P (X = xi )P (Y = yj )P (Z = zk ) ∀i, j, k
Expectation
For discrete case: XX
E[g(X, Y )] = g(x, y) p(x, y).
x y
Example
Consider the experiment of tossing three fair coins simultaneously. Define the random
variables:
Y = |#Heads − #Tails|.
Sample Space
S = {HHH, HHT, HT H, T HH, HT T, T HT, T T H, T T T }
54
Values of X and Y
X\Y 0 1 3
0 0 0 1/8
1 0 3/8 0
2 0 3/8 0
3 0 0 1/8
Marginal Probabilities
1 3 3 1
P (X = 0, Y = 3) = , P (X = 1, Y = 1) = , P (X = 2, Y = 1) = , P (X = 3, Y = 3) =
8 8 8 8
6 2
P (Y = 0, X = 0) = 0, P (Y = 1) = , P (Y = 3) =
8 8
Conditional PMF
P (Y | X)
P (X = x, Y = y)
P (Y = y | X = x) =
P (X = x)
X|Y 0 1 3
0 0 0 1
1 0 1 0
2 0 1 0
3 0 0 1
55
P (X | Y )
P (X = x, Y = y)
P (X = x | Y = y) =
P (Y = y)
Y |X 0 1 2 3
0 0 0 0 0
1 0 1/2 1/2 0
3 1/2 0 0 1/2
Expectation
X X
E[X] = xP (X = x) = 1.5, E[Y ] = yP (Y = y) = 1.5
x y
56
Lecture 19
1. XX
E(g(x, y)) = g(xi , yj ) pij
i j
2. X XX
E(g(x)) = g(xi ) pi+ = g(xi ) pij
i i j
3.
X
E(g(x) | Y = y) = g(xi ) pi|j
i
n
X
= g(xi ) P (X = xi | Y = y)
i=1
= h(y)
E(g(x) | y) = h(y)
ZZ
p((x, y) ∈ R) = f (x, y) dy dx
(x, y) ∈ R
57
Marginal Density
The marginal densities of X and Y are obtained by integrating the joint density over the
other variable:
Z ∞
fX (x) = fX,Y (x, y) dy,
−∞
Z ∞
fY (y) = fX,Y (x, y) dx.
−∞
These represent the individual distributions of X and Y irrespective of the other variable.
Conditional Density
The conditional density of X given Y = y is defined as
fX,Y (x, y)
, if fY (y) > 0,
fX|Y (x | y) = fY (y)
0, if fY (y) = 0.
Example:
We are given the joint density
f (x, y) = c(x + y 2 ), 0 < x < 1, 0 < y < 1.
(a) Find c
Since f (x, y) is a pdf, Z 1Z 1
f (x, y) dx dy = 1.
0 0
Z 1Z 1 Z 1
1
2 2
c(x + y ) dx dy = c +y dy.
0 0 0 2
" #1
1 y3 1 1 5
=c y+ =c + =c .
2 3 0
2 3 6
Thus,
6
c= .
5
58
(b) Marginal density of X
Z 1 Z 1
6
fX (x) = f (x, y) dy = (x + y 2 ) dy.
0 0 5
6 1 6 1
= x(1) + = x+ , 0 < x < 1.
5 3 5 3
Final Results
6
c= ,
5
6
fX (x) = x + 13 , 0 < x < 1,
5
6 1 2
fY (y) = + y , 0 < y < 1,
5 2
x + y2
fX|Y (x | y) = 1 , 0 < x < 1,
2
+ y2
x + y2
fY |X (y | x) = , 0 < y < 1.
x + 13
59
Aspect Discrete Continuous
Definition Takes a countable number of dis-
Takes an uncountable (con-
tinct values tinuum) number of values
Example Number of heads in 10 coin tosses,
Height of a person, time
number of students in a class taken to run a race
Probability Assign- Probabilities assigned to individ-
Probability for exact values
ment ual values: P (X = xi ) is 0; probability is defined
over intervals
Probability Function Probability Mass Function (pmf): Probability Density Func-
p(x) = P (X = x) tion (pdf): f (x)
P (a ≤ X ≤ b) = ab f (x) dx
Pb
Probability Computa- P (a ≤ X ≤ b) = x=a p(x)
R
tion
Cumulative Distribu- F (x) = P (X ≤ x) = t≤x p(t) (x) = P (X ≤ x) =
P
F
Rx
tion Function (CDF) −∞ f (t) dt
Graph Representation Bar graph (pmf) Smooth curve (pdf)
P R∞
Total Probability x p(x) = 1 −∞ f (x) dx = 1
Independence
The random variables X and Y are independent if and only if
Properties:
Z
E[x] = xf (x) dx
Z
E[X|Y ] = xf (x|y) dx
ZZ
E[g(x, y)] = g(x, y)f (x, y) dx dy
x,y
60
Example:
f (x, y) = cxy, 0≤x≤y≤1
Z 1Z 1
cxy dy dx = 1
0 x
Z 1Z 1
cxy dx dy = 1
0 y
Solution
We are given
f (x, y) = cxy, 0 ≤ x ≤ y ≤ 1.
(a) Find c
Since f (x, y) is a probability density function,
Z 1Z y
cxy dx dy = 1.
0 0
61
(c) Marginal density of Y
Z y Z y
fY (y) = f (x, y) dx = 8xy dx.
0 0
Z y
y2
= 8y x dx = 8y · .
0 2
fY (y) = 4y 3 , 0 ≤ y ≤ 1.
Final Results
c = 8,
fX (x) = 4x(1 − x2 ), 0 ≤ x ≤ 1,
fY (y) = 4y 3 , 0 ≤ y ≤ 1,
2x
fX|Y (x | y) = 2 , 0 ≤ x ≤ y ≤ 1,
y
2y
fY |X (y | x) = , x ≤ y ≤ 1.
1 − x2
62
Lecture 20
We are given the joint PDF
Solution
1. Find k
The support region is 0 < y < 0.5, 2y ≤ x < 1.
Z 0.5 Z 1 Z 0.5 h i0.5
1= k dx dy = k (1 − 2y) dy = k y − y 2 = k · 0.25
y=0 x=2y 0 0
⇒ k = 4.
So
f (x, y) = 4, 0 < y < 0.5, 2y ≤ x < 1.
2. Marginal PDF of Y
For 0 < y < 0.5: Z 1
fY (y) = 4 dx = 4(1 − 2y).
x=2y
3. Marginal PDF of X
For 0 < x < 1, 0 < y ≤ x/2:
Z x/2
fX (x) = 4 dy = 2x.
y=0
So
2x, 0 < x < 1,
fX (x) =
0, otherwise.
63
4. Conditional PDF f (x | y)
For 0 < y < 0.5:
f (x, y) 4 1
f (x | y) = = = , 2y ≤ x < 1.
fY (y) 4(1 − 2y) 1 − 2y
So
1 , 2y ≤ x < 1,
f (x | y) = 1−2y
0, otherwise.
Independence
The random variables X and Y are independent if and only if
fX,Y (x, y) = fX (x) fY (y), ∀ x, y.
Dependence
The random variables X and Y are dependent then
fX,Y (x, y) = fX (x) f (y|x), ∀ x, y.
Example 1
Find whether the given function is independent or not.
f (x, y) = 4xy, 0 < x < 1, 0<y<1
Example 2
Find whether the given function is independent or not.
f (x, y) = x + y, 0 < x < 1, 0<y<1
Example 3
Find whether the given function is independent or not.
f (x, y) = e−(x+y) , 0 < x, 0<y
Theorem 4. Let (X, Y ) be continuous random variables with joint probability density func-
tion f (x, y) and support of x and y. Then X and Y are independent if and only if there
exist functions g(x) and h(y) such that:
f (x, y) = g(x) h(y) for all (x, y),
64
Proof. (⇒) If X and Y are independent:
By definition of independence,
Thus f (x, y) = fX (x)fY (y) for all (x, y). Hence X and Y are independent.
65
Lecture 21
Example
Let X, Y be two continuous random variables with joint probability density function (PDF):
1. Marginal Distributions
2. Conditional Distributions
3. Probability Calculations
66
(b) Marginal probability of X
Z 1/2
P (0 < X < 12 ) = fX (x) dx.
0
P (X = 12 ) = 0.
1. Definitions
For a function g(x): Z ∞
E[g(X)] = g(x)fX (x) dx.
−∞
67
For joint random variables:
Z ∞ Z ∞
E[g(X, Y )] = g(x, y)fX,Y (x, y) dx dy.
−∞ −∞
Conditional expectation:
Z ∞
E[g(X) | Y = y] = g(x)fX|Y (x | y) dx.
−∞
2. Variance
Var(X) = E[X 2 ] − (E[X])2 ,
2
Var(X | Y ) = E[X 2 | Y ] − E[X | Y ] .
Covariance
Definition: For two random variables X and Y , the covariance is defined as
h i
Cov(X, Y ) = E (X − E[X])(Y − E[Y ]) .
Interpretation
• Cov(X, Y ) > 0: Positive association between X and Y (they tend to move in the same
direction).
• Cov(X, Y ) < 0: Negative association between X and Y (they tend to move in opposite
directions).
• Cov(X, Y ) = 0: No linear association between X and Y .
68
Graphical Interpretation
Given data points (Xi , Yi ) such as:
X = {1, 2, 3, 4, . . . }, Y = {6, 8, 9, . . . },
we can plot (X, Y ) pairs. The relative movement of X̄ and Ȳ (sample means) shows whether
X and Y increase together (positive covariance) or in opposite directions (negative covari-
ance).
—
Correlation Coefficient
Definition: The correlation coefficient ρX,Y (also called Pearson correlation) is a normalized
measure of linear association:
Cov(X, Y )
ρX,Y = q q .
Var(X) Var(Y )
Properties
• −1 ≤ ρX,Y ≤ 1.
• ρX,Y = 1: Perfect positive linear relationship.
• ρX,Y = −1: Perfect negative linear relationship.
• ρX,Y = 0: No linear relationship (but variables may still be dependent).
Summary
• Covariance measures the direction of linear association.
• Correlation standardizes covariance, giving both direction and strength of linear asso-
ciation.
• Variance is a special case of covariance when X = Y .
69
Example A: fX,Y (x, y) = x + y on [0, 1]2
Assume
fX,Y (x, y) = x + y, 0 < x < 1, 0 < y < 1,
and fX,Y (x, y) = 0 elsewhere. (Note this integrates to 1 on [0, 1]2 .)
Marginals
Z 1
fX (x) = (x + y) dy = x + 21 , 0 < x < 1,
0
Z 1
fY (y) = (x + y) dx = y + 12 , 0 < y < 1.
0
Conditionals
x+y
fX|Y (x | y) = , 0 < x < 1,
y + 12
x+y
fY |X (y | x) = , 0 < y < 1.
x + 12
Expectations
Z 1 Z 1
7
1
E[X] = xfX (x) dx = x x+ 2
dx = .
0 0 12
By symmetry,
7
E[Y ] = .
12
Joint expectation: ZZ
1
E[XY ] = xy(x + y) dx dy = .
[0,1]2 3
Thus
2 6y 2 + 6y + 1
V(X | Y = y) = E[X 2 | Y = y] − E[X | Y = y] = .
18(4y 2 + 4y + 1)
70
Variance, covariance and correlation
Compute full variances:
11 11
V(X) = E[X 2 ] − (E[X])2 = , V(Y ) = .
144 144
Covariance:
1 7 7 1
C(X, Y ) = E[XY ] − E[X] E[Y ] = − · =− .
3 12 12 144
Correlation:
1
− 144 1
ρX,Y = q =− ≈ −0.0909.
11
· 11 11
144 144
Normalization
Integrate k(x + y) over 0 < x < y < 1:
Z 1 Z y
ZZ
k
k(x + y) dx dy = k (x + y) dx dy = .
0<x<y<1 y=0 x=0 2
Set equal to 1 gives k/2 = 1 ⇒ k = 2.
Hence
fX,Y (x, y) = 2(x + y), 0 < x < y < 1.
Marginals
For fixed x (with 0 < x < 1), y ranges x to 1:
Z 1
fX (x) = 2(x + y) dy = −3x2 + 2x + 1, 0 < x < 1.
y=x
71
Conditionals
For 0 < x < y < 1:
2(x + y)
fX|Y (x | y) = , 0 < x < y,
3y 2
2(x + y)
fY |X (y | x) = , x < y < 1.
−3x2 + 2x + 1
Expectations
Compute E[X], E[Y ], E[XY ] over the triangular region:
ZZ
5
E[X] = x · 2(x + y) dx dy =
,
0<x<y<1 12
ZZ
3
E[Y ] = y · 2(x + y) dx dy = ,
0<x<y<1 4
ZZ
1
E[XY ] = xy · 2(x + y) dx dy = .
0<x<y<1 3
Conditional expectations
Z y
2(x + y) 5y
E[X | Y = y] = x· 2
dx = , 0 < y < 1.
0 3y 9
Z 1
2(x + y) 5x2 + 5x + 2
E[Y | X = x] = y· dy = , 0 < x < 1.
x −3x2 + 2x + 1 3(3x + 1)
2
Z y
2(x + y) 7y 2
E[X | Y = y] = x2 · dx = ,
0 3y 2 18
so
7y 2 13y 2
2
5y
V(X | Y = y) = − = .
18 9 162
72
Correlation:
√
1/48 5 129
ρX,Y = q ≈ 0.440225 (exact simplified form ).
43
· 3 129
720 80
73
Lecture 22
Five-Point Summary
From fX,Y (x, y), we can derive the following five important parameters:
Note: To compute E[XY ], we require the joint pdf fX,Y (x, y); we cannot compute it using
the marginal distributions alone.
Mean Vector
The mean vector for the two random variables is defined as:
" #
E[X]
µ=
E[Y ]
Covariance
The covariance between X and Y is given by:
Covariance measures the direction of linear association between two random variables.
Remark: The term “linear” is crucial—covariance captures only linear dependence. Non-
linear dependencies may still exist even if covariance is zero.
74
Limitation of Covariance
Covariance does not indicate the strength of the relationship and is not restricted to a
specific range. To overcome this limitation, we use the correlation coefficient.
Correlation Coefficient
The correlation coefficient (also called the Pearson correlation) is defined as:
Cov(X, Y )
ρX,Y = q
Var(X) Var(Y )
It is a normalized measure of linear association that satisfies:
−1 ≤ ρX,Y ≤ 1
Interpretation
• ρX,Y = 1: Perfect positive linear relationship
• ρX,Y = −1: Perfect negative linear relationship
• ρX,Y = 0: No linear relationship (though a non-linear relationship may exist)
1. Compute ρX,Y
2. Check its significance statistically (e.g., via hypothesis testing)
3. Visualize using a scatter diagram
If ρX,Y = 0, there is no linear relationship, but independence cannot be inferred purely from
this statistic.
75
Perfect Linear Relationship
Let
Y = aX + b
represent a perfect linear relationship between two random variables X and Y .
The correlation between X and Y is defined as:
Cov(X, Y )
ρX,Y = q
Var(X)Var(Y )
We know that:
Cov(X, aX + b) = a Cov(X, X) = a Var(X)
and
Var(aX + b) = a2 Var(X)
Hence,
a Var(X) a +1, a > 0
ρX,Y =q = =
Var(X) · a2 Var(X) |a| −1, a < 0
Transformation Properties
(A) Expectation of Linear Combination
This property leads to the concept of diversification in finance. When two datasets (or
assets) are combined, the total variability depends on their covariance. This concept forms
the mathematical basis for portfolio theory (Markowitz Model, you can explore more but
MAL2010 is limited to intro only).
76
(D) Variance of Difference
Cov(aX + b, cY + d) = ac Cov(X, Y )
Numerical Example
Given:
E[X] = 2, E[Y ] = 1, Var(X) = 4, Var(Y ) = 9, E[XY ] = −2
Then:
Cov(X, Y ) = E[XY ] − E[X]E[Y ] = −2 − (2)(1) = −4
Covariance Matrix
For two random variables X and Y , the covariance matrix is defined as:
" #
Var(X) Cov(X, Y )
Σ=
Cov(Y, X) Var(Y )
Properties:
• Generalizable to n variables also.
• Variance is always non-negative: Var(X) ≥ 0
• Covariance matrix is symmetric: Σ = ΣT
• Covariance matrix is positive semi-definite
77
Independence of Random Variables
If X and Y are independent:
fX,Y (x, y) = fX (x) fY (y)
Then: ZZ
E[XY ] = xy fX (x)fY (y) dx dy = E[X]E[Y ]
Hence:
Cov(X, Y ) = 0
Conclusion: Independence implies zero covariance, but the converse is not necessarily true.
Key Takeaways
• Perfect linear relationship: ρ = ±1
• Zero correlation implies no linear relation, but not necessarily independence
• Variance–covariance structure forms the basis for multivariate data representation
• Independence assumptions simplifies computation: E[XY ] = E[X]E[Y ]
78
Lecture 23
Transformation Equations
Define two new random variables:
U = g1 (X, Y ), V = g2 (X, Y )
X = h1 (U, V ), Y = h2 (U, V )
Objective
Our goal is to find the joint pdf of the transformed random variables (U, V ), denoted by
fU,V (u, v), from the given fX,Y (x, y).
Principle of Transformation
The fundamental requirement is that the total probability remains invariant under transfor-
mation: ZZ ZZ
fX,Y (x, y) dy dx = fU,V (u, v) dv du
RXY RU V
where RXY and RU V denote the regions of support for (X, Y ) and (U, V ), respectively.
Jacobian Transformation
The change of variables from (x, y) to (u, v) is carried out using the Jacobian of the trans-
formation.
79
Definition: Jacobian
80
Real-World Interpretation
A physical example of such transformation occurs in mechanics: Consider two particles
moving randomly with velocity components X and Y . If we define:
√ −1
Y
U = velocity magnitude = X2 +Y 2, V = angle of motion = tan
X
then the transformation from (X, Y ) to (U, V ) allows us to derive the joint density of kinetic
energy and direction.
4. The transformed pdf fU,V (u, v) should integrate to 1 over the support of (U, V ).
Takeaway
• Transformations help in expressing complex relationships between random variables in
simpler coordinates.
• The Jacobian determinant acts as a scaling factor that preserves total probability.
• Common transformations include Cartesian to Polar, and in higher dimensions, trans-
formations to Spherical or Cylindrical coordinates.
81
Remark (normalization). Check the integral
ZZ
1 −(x2 +y2 ) 1 Z 2πZ ∞ −r2 1 1 1
e dx dy = e r dr dθ = · 2π · = ,
R2 2π 2π 0 0 2π 2 2
so the constant 1/(2π) does not normalize this pdf to 1. Two commonly used normalized
forms are:
1 −(x2 +y2 ) 1 − 1 (x2 +y2 )
(A) fX,Y (x, y) = e , (B) fX,Y (x, y) = e 2 .
π 2π
Both of the above integrate to 1 on R2 . (Form B is the standard bivariate normal with
independent N (0, 1) components.)
Now transform to polar coordinates:
Jacobian: |J| = r. Thus for case (A) the transformed joint density is
1 −r2
fR,Θ (r, θ) = fX,Y (r cos θ, r sin θ) · r = e · r, r ≥ 0, θ ∈ [0, 2π).
π
82
Example 3: Transformation Example
If we have the joint density over X, Y as
fXY (x, y) = 1,
u = x + y, v = x − y,
0 ≤ x ≤ 1, 1 ≤ y ≤ 2.
(0, 1) → (1, −1), (1, 1) → (2, 0), (1, 2) → (3, −1), (0, 2) → (2, −2).
Thus, the region in the u, v-plane is a quadrilateral with vertices (1, −1), (2, 0), (3, −1), (2, −2).
We can also describe the region analytically as:
− u ≤ v ≤ u − 2, 1 ≤ u ≤ 2,
u − 4 ≤ v ≤ 2 − u, 2 ≤ u ≤ 3.
Hence,
1,
(u, v) in the region defined above,
fU V (u, v) = 2
0,
otherwise.
83
If we have to find the marginal with respect to u, then it will be
u − 1, 1 ≤ u ≤ 2,
fU (u) =
3 − u, 2 ≤ u ≤ 3,
0,
otherwise.
Similarly, for fV (v), we can go back to the graphical representation of the rectangular region,
plot the limits accordingly, and then calculate the marginal with respect to v.
84
Lecture 24
Topic: Conditional Expectation, Regression,
and Covariance Structure
X3 µ3
Then
Var(X1 ) Cov(X1 , X2 ) Cov(X1 , X3 )
Cov(X2 , X1 )
Σ= Var(X2 ) Cov(X2 , X3 )
.
Cov(X3 , X1 ) Cov(X3 , X2 ) Var(X3 )
Notes:
• Σ is symmetric: Σ = ΣT .
• Σ is positive semi-definite.
2. Correlation Coefficient
For two random variables X and Y ,
Cov(X, Y )
ρXY =
σX σY
85
2
where σX = Var(X) and σY2 = Var(Y ).
Theorem 5. For any two random variables X, Y with finite and nonzero variances,
−1 ≤ ρXY ≤ 1,
where
Cov(X, Y )
ρXY = .
σX σY
Var(aX + Y ) ≥ 0.
This quadratic in a must be nonnegative for all a, hence its discriminant must be less than
or equal to zero.
Simplifying,
Cov(X, Y )2 ≤ Var(X) Var(Y ).
2 2
Dividing both sides by σX σY ,
!2
Cov(X, Y )
≤ 1.
σX σY
Hence,
−1 ≤ ρXY ≤ 1.
Y = aX + b
86
Example 12 (Counterexample). Let X be uniformly distributed on the interval [−1, 1], i.e.,
1,
−1 ≤ x ≤ 1,
fX (x) = 2
0,
otherwise.
3. Conditional Expectation
Definition 11. Let X and Y be random variables. The conditional expectation of Y given
X is the random function
E(Y | X) = g(X),
where for each fixed value x,
X
y P (Y = y | X = x), discrete Y,
g(x) := E(Y | X = x) = Zy ∞
y fY |X (y | x) dy, continuous Y.
−∞
fX,Y (x, y)
where fY |X (y|x) = .
fX (x)
Remark 3. E(Y | X) is a measurable function of X. It is itself a random variable (a
function of X).
87
3.1 Properties
h i
• E E(Y | X) = E(Y ).
• For any (suitable) function h,
h i h i
E h(X) E(Y | X) = E h(X)Y .
Theorem 6. Among all measurable functions g(X), the conditional expectation g ∗ (X) :=
E(Y | X) minimizes the MSE:
h i
g ∗ = arg min
g
E (Y − g(X))2 .
Thus h i h i
E[(Y − g(X))2 ] = E (Y − E(Y | X))2 + E (E(Y | X) − g(X))2 .
The first term does not depend on g; the second term is minimized (to zero) by taking
g = E(Y | X).
E(Y | X = x) = α + βx.
88
This motivates the regression model
Y = α + βX + ε,
where ε is a zero-mean error satisfying E(ε | X) = 0.
The parameters α, β are chosen to minimize
h i
E (Y − α − βX)2 .
5.2 Results:
• Cov(X, ε) = 0.
• Var(Y ) = β 2 Var(X) + Var(ε).
• If the correlation ρ(X, Y ) = 0, then β = 0 and the best linear predictor is constant;
but ρ = 0 does not imply independence.
ZZ Z 1Z 1 Z 1
1 1 1
1= f (x, y) dy dx = k (x + y) dy dx = k x+ 2
dx = k 2
+ 2
= k · 1.
[0,1]2 0 0 0
89
6.1 Marginal of X
Z 1
fX (x) = (x + y) dy = x + 21 , 0 ≤ x ≤ 1.
0
Now Z 1
1 Z 1
1
xy dy = x · , y 2 dy = ,
0 2 0 3
so
3x + 2
x/2 + 1/3 6 3x + 2
E(Y | X = x) = = 1 = .
x + 1/2 x+ 6x + 3
2
Therefore, the conditional expectation (best predictor) is
3X + 2
E(Y | X) = (0 ≤ X ≤ 1).
6X + 3
90
Lecture 25
Topic: Regression and Bivariate Normal Dis-
tribution
E(Y |X) = Yp ,
Thus,
E(Y |X) = Yp = best predictor of Y.
X −→ g(X) −→ Yp .
If g(X) is linear, it leads to linear regression.
91
Hence,
x 1
1 Z 1
2
+ 3 x/2 + 1/3
E(Y |X = x) = 1 y(x + y) dy = 1 = .
x+ 2 0 x+ 2
x + 1/2
i=1 i=1
Simplifying: P P
yi
= nα + β xi ,
P xi y i P P 2
=α xi + β x.
i
xi yi − ( xi )( yi )
P P P
n
β= , α = ȳ − β x̄.
n x2i − ( xi )2
P P
92
5.1 Graphical Interpretation of Simple Linear Regression
(A) (B)
10 10
Best fit: y = 0.96x + 0.10
(x1 , y1 )
r1 = y1 − b
y1
5 5
y
y
(x1 , b
y1 )
0 0
0 2 4 6 8 10 0 2 4 6 8 10
x x
Figure 2: (A) Scatter plot showing observed data points, candidate regression lines, and the
best fit line with a confidence band. (B) Illustration of a single observation and its residual
r1 = y1 − yb1 projected onto the regression line.
Hence,
Cov(X, Y )
Yp = E(Y ) + (X − E(X)).
Var(X)
x, y ∈ R.
93
8. Independence and Correlation in the Bivariate Nor-
mal Case
If ρ = 0, " !#
1 1 (x − µ1 )2 (y − µ2 )2
f (x, y) = exp − + .
2πσ1 σ2 2 σ12 σ22
This can be factorized as
f (x, y) = g(x) h(y),
showing that X and Y are independent.
However, note:
ρ = 0 ̸⇒ X ⊥ Y (in general),
but
ρ=0⇒X⊥Y only for the bivariate normal case.
Remark 5. For the bivariate normal distribution, the only possible dependence between X
and Y is linear.
94
Lecture 26
Topic: Bivariate Normal Distribution and Con-
ditional Expectation
3. Marginal Distributions
If (X, Y ) ∼ BN (µ1 , µ2 , σ12 , σ22 , ρ), then
X ∼ N (µ1 , σ12 ) and Y ∼ N (µ2 , σ22 )
95
The marginal density of X is obtained by integrating out Y :
Z ∞
fX (x) = f (x, y) dy.
−∞
Thus,
X ∼ N (µ1 , σ12 ) .
By symmetry, integrating out X gives
Y ∼ N (µ2 , σ22 ) .
4. Conditional Distribution of Y |X
The conditional distribution of Y given X = x is also normal:
σ2
2 2
Y |X = x ∼ N µ2 + ρ (x − µ1 ), σ2 (1 − ρ )
σ1
Therefore,
σ2
E(Y |X = x) = µ2 + ρ (x − µ1 )
σ1
and
Var(Y |X = x) = σ22 (1 − ρ2 )
96
4.1 Derivation: conditional law Y | X = x
The conditional density is
f (x, y)
f (y | x) = .
fX (x)
When we divide the joint density by fX (x) those x-only terms cancel, leaving the conditional
density in the Gaussian form
( 2 )
1 1 σ2
f (y | x) = q exp − 2
y − µ2 − ρ (x − µ1 ) .
2π σ22 (1 − ρ2 ) 2 σ2 (1 − ρ )
2 σ1
σ2
E(Y | X = x) = µ2 + ρ (x − µ1 ) , Var(Y | X = x) = σ22 (1 − ρ2 ) .
σ1
NOTE: the conditional mean is linear in x; the conditional variance does not depend on x
and is reduced by the factor 1 − ρ2 .
X ⊥ Y ⇐⇒ ρ = 0
97
7. Example
Let
(X, Y ) ∼ BN (0, 1, 1, 4, 0.5)
Then
2
E(Y |X = x) = 1 + 0.5 (x − 0) = 1 + x
1
and
Var(Y |X = x) = 4(1 − 0.25) = 3
So
Y |X = x ∼ N (1 + x, 3)
where µ and Σ are the mean vector and the covariance matrix, respectively.
98
Lecture 27
Topic: Statistical Inference and Estimation
Population and Sample
• A population refers to the entire collection of individuals or observations of interest.
• Since it is often not possible to observe the whole population, we select a sample.
• The sample is used to estimate characteristics (parameters) of the population.
n
Y
f (x1 , x2 , . . . , xn ) = f (xi ; θ)
i=1
Example
For 50 students, let Xi represent whether the ith student plays cricket:
1,if the student plays cricket,
Xi =
0, otherwise.
Estimation
Given a random sample (X1 , X2 , . . . , Xn ):
• If the form of f (xi ; θ) is known, the estimation is called parametric.
• If the form of f (xi ; θ) is unknown, the estimation is non-parametric.
Goal: To estimate the population parameter θ using the sample.
99
Statistics and Estimators
• A statistic is any function of the random sample:
T = g(X1 , X2 , . . . , Xn )
E(Xi ) = µ, V ar(Xi ) = σ 2 .
Then as n → ∞, Pn
X − nµ
Z= i=1
√i −→ N (0, 1).
nσ
That is, the standardized sum of a large number of independent random variables tends
toward a standard normal distribution.
2 /2
Since MXi (t) = et for Xi ∼ N (0, 1),
h 2 /(2n)
in 2 /2
MZ (t) = et = et
Hence,
Z ∼ N (0, 1).
100
Lecture 28
Topic: Sampling, Estimation and Properties of
Estimators
Sampling Framework
Let X1 , X2 , . . . , Xn be a random sample such that
Xi ∼ f (xi ; θ),
where θ is an unknown population parameter.
The objective is to construct an estimator g(X1 , X2 , . . . , Xn ) of θ.
Since X X
E Xi = nµ, V ar Xi = nσ 2 ,
we have
Xi − nµ
P
Z= √ ∼ N (0, 1).
nσ
Hence,
80
X
Xi ∼ N (20, 15).
i=1
101
To find: !
X 18 − 20 27 − 20
P (18 ≤ Xi ≤ 27) = P √ ≤Z≤ √ .
15 15
Another Example
Let X1 , X2 , . . . , X100 be a random sample with
Then, X
P (50 ≤ Xi ≤ 60) =?
P
can be solved using CLT by standardizing the variable Xi .
Solution:
X X
E Xi = 100(6.5) = 650, V ar Xi = 100(4) = 400,
√
SD = 400 = 20.
Hence,
50 − 650 60 − 650
X
P (50 ≤ Xi ≤ 60) = P ≤Z≤ = P (−30 ≤ Z ≤ −29.5).
20 20
Since these Z-values are far into the left tail of the standard normal curve,
P (−30 ≤ Z ≤ −29.5) ≈ 0.
Therefore,
X
P (50 ≤ Xi ≤ 60) ≈ 0.
Estimation of Parameters
If X1 , X2 , . . . , Xn ∼ f (xi ; θ), then θ represents the population parameter.
An estimator is a function of the sample:
g(X1 , X2 , . . . , Xn ) → θ̂
102
Properties of a Good Estimator
(i) Unbiasedness
E[g(X1 , X2 , . . . , Xn )] = θ.
(ii) Efficiency
Among two unbiased estimators g1 and g2 of θ, the estimator with smaller variance is said
to be more efficient.
Example:
X1 + X 2 1 1
V ar(g1 ) = V ar = [V ar(X1 ) + V ar(X2 )] = σ 2 ,
2 4 2
2
X1 + X2 + · · · + Xn σ
V ar(g2 ) = V ar = .
n n
Hence g2 is more efficient than g1 .
If an estimator is unbiased and has the smallest possible variance among all unbiased esti-
mators, it is called a Minimum Variance Unbiased Estimator (MVUE).
If this property holds for all values of θ, it is called the Uniform Minimum Variance
Unbiased Estimator (UMVUE).
103
Lecture 29
Topic: Sample Statistics and Chi-Square Dis-
tribution
Random Sample and Estimators
Let X1 , X2 , . . . , Xn be a random sample from a population with p.d.f. f (xi ; θ), where θ is
an unknown parameter.
The estimator is defined as a statistic:
g(X1 , X2 , . . . , Xn ) → θ̂.
If
E[θ̂] = θ,
then θ̂ is said to be an unbiased estimator of θ.
Among unbiased estimators, if
V ar(g1 ) ≤ V ar(g2 ),
then g1 is said to be a more efficient estimator than g2 .
Sample Statistics
(i) Sample Mean
n
1X
X̄ = Xi
n i=1
or equivalently,
X̄ − µ
√ → N (0, 1).
σ/ n
(Xi − X̄)2 = [(Xi − µ) − (X̄ − µ)]2 = (Xi − µ)2 + (X̄ − µ)2 − 2(Xi − µ)(X̄ − µ).
i=1 i=1
Taking expectation:
1 1 σ2
E(S 2 ) = [nσ 2 − nV ar(X̄)] = [nσ 2 − n ] = σ 2 .
n−1 n−1 n
Hence,
S 2 is an unbiased estimator of σ 2 .
105
Distribution of Sample Variance
If Xi ∼ N (µ, σ 2 ), then
Xi − µ
Zi = ∼ N (0, 1).
σ
Now define
Y = Z 2.
i=1
(n − 1)S 2
∼ χ2(n−1) .
σ2
106