0% found this document useful (0 votes)
7 views

05 Continuous Distr Answers Hidden Lecture

This document discusses continuous random variables, highlighting their characteristics and differences from discrete random variables. It covers key concepts such as probability density functions (PDF), cumulative distribution functions (CDF), and examples of continuous random variables like uniform, exponential, and normal distributions. The document also explains how to compute probabilities and the properties of PDFs in the context of continuous random variables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

05 Continuous Distr Answers Hidden Lecture

This document discusses continuous random variables, highlighting their characteristics and differences from discrete random variables. It covers key concepts such as probability density functions (PDF), cumulative distribution functions (CDF), and examples of continuous random variables like uniform, exponential, and normal distributions. The document also explains how to compute probabilities and the properties of PDFs in the context of continuous random variables.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 71

Introduction to Probability

Lecture 5+: Continuous random variables


Mateja Jamnik, Thomas Sauerwald

University of Cambridge, Department of Computer Science and Technology


email: {mateja.jamnik,thomas.sauerwald}@cl.cam.ac.uk
Outline

Continuous random variables

Cumulative distribution function, expectation, variance

Uniform random variable

Exponential random variable

Normal (Gaussian) random variable

Intro to Probability Continuous random variables 2


From discrete to continuous RV
So far, all RV were discrete: can only take on integer values.

If RV need to take on values in the real number domain (R), then


continuous random variable.

Examples of continuous RV: Uniform RV, Exponential RV, Normal RV.

Intro to Probability Continuous random variables 3


From discrete to continuous RV
So far, all RV were discrete: can only take on integer values.

If RV need to take on values in the real number domain (R), then


continuous random variable.

Examples of continuous RV: Uniform RV, Exponential RV, Normal RV.

Continuous RV are just like discrete RV, except that every sum becomes
an integral.

Example of possible values of continuous RV X :


(0, 1) = {x ∈ R; 0 < x < 1}
[0, 1] = {x ∈ R; 0 ≤ x ≤ 1}
[0, 1) = {x ∈ R; 0 ≤ x < 1}
(−∞, ∞) = all real numbers

Intro to Probability Continuous random variables 3


From discrete to continuous RV
So far, all RV were discrete: can only take on integer values.

If RV need to take on values in the real number domain (R), then


continuous random variable.

Examples of continuous RV: Uniform RV, Exponential RV, Normal RV.

Continuous RV are just like discrete RV, except that every sum becomes
an integral.

Example of possible values of continuous RV X :


(0, 1) = {x ∈ R; 0 < x < 1}
[0, 1] = {x ∈ R; 0 ≤ x ≤ 1}
[0, 1) = {x ∈ R; 0 ≤ x < 1}
(−∞, ∞) = all real numbers

Examples:
X : price of a stock
X : time that a machine works before breakdown
X : error in an experimental measurement

Intro to Probability Continuous random variables 3


Integrals revision
Z b
g(x)dx
x=a
g(x)

x
a b

Intro to Probability Continuous random variables 4


Integrals revision
Z b
g(x)dx
x=a
g(x)

x
a b
Z b b
Integral = area under a curve = g(x)dx = G(x) = G(b) − G(a)
x=a a
where G(x) is the antiderivative for g(x).

Intro to Probability Continuous random variables 4


Integrals revision
Z b
g(x)dx
x=a
g(x)

x
a b
Z b b
Integral = area under a curve = g(x)dx = G(x) = G(b) − G(a)
x=a a
where G(x) is the antiderivative for g(x).
Some examples:
Z b b
x3 b 3 − a3
Z
x 2 dx = = a dx = ax + C
a 3 a 3
1
Z Z
dx = ln|x| + C ex dx = ex + C
x

Intro to Probability Continuous random variables 4


Continuous paradigm

The most important property of discrete RV was probability mass function


(PMF) denoting the probability of the RV taking on a certain value.

But in the continuous world this is impossible:


What is the probability that a newborn child weighs exactly
3.215438765432532 kg? NONE

Real values are defined with infinite precision, thus the probability that a
RV takes on a specific value is not meaningful when the RV is continuous.

We need a function that says how likely is it that a RV takes on a


particular value relative to other values that it could take on: probability
density function.

Intro to Probability Continuous random variables 5


Definition of continuous RV
Continuous random variable
A random variable X is continuous if there is a probability density
function (PDF), f (x) ≥ 0 such that for −∞ < x < ∞:
Z b
P[a ≤ X ≤ b] = f (x)dx
a

To preserve the axioms that guarantee that P [ a ≤ X ≤ b ] is a


probability, the following properties must hold:

0 ≤ P[a ≤ X ≤ b] ≤ 1
 Z ∞ 
P [ −∞ < X < ∞ ] = 1 = f (x)dx
−∞

Intro to Probability Continuous random variables 6


Definition of continuous RV
Continuous random variable
A random variable X is continuous if there is a probability density
function (PDF), f (x) ≥ 0 such that for −∞ < x < ∞:
Z b
P[a ≤ X ≤ b] = f (x)dx
a

To preserve the axioms that guarantee that P [ a ≤ X ≤ b ] is a


probability, the following properties must hold:

0 ≤ P[a ≤ X ≤ b] ≤ 1
 Z ∞ 
P [ −∞ < X < ∞ ] = 1 = f (x)dx
−∞

Note: we also write f (x) as fX (x).


In continuous world, every RV has a PDF: its relative value wrt to other
possible values.
Integrate f (x) to get probabilities.

Intro to Probability Continuous random variables 6


Comparing PMF and PDF

Discrete random variable X Continuous random variable X

Probability mass function (PMF): Probability density function (PDF):

p(x) f (x)

Compute probability: Compute probability:

P [ X = x ] = p(x)
b
X Z b
P[a ≤ X ≤ b] = p(x) P[a ≤ X ≤ b] = f (x)dx
x=a x=a

Both are measures of how likely is X to take on a value.

Intro to Probability Continuous random variables 7


Computing probability example

Example
Let X be a continuous RV with PDF:
(
1
x if 0 ≤ x ≤ 2
f (x) = 2
0 otherwise

What is P [ X ≥ 1 ]?
Answer
Computing probability example

Example
Let X be a continuous RV with PDF:
(
1
x if 0 ≤ x ≤ 2
f (x) = 2
0 otherwise

What is P [ X ≥ 1 ]?
Answer

f (x)
1.0

0.5

x
0 1.0 2.0

Intro to Probability Continuous random variables 8


PDF properties

f (x) is NOT a probability, it is probability density:


Z a
P[X = a] = f (x)dx = 0 ̸= f (a)
a

Intro to Probability Continuous random variables 9


PDF properties

f (x) is NOT a probability, it is probability density:


Z a
P[X = a] = f (x)dx = 0 ̸= f (a)
a

f (x) f (x)
x x
a a
|{z}
ϵ

Intro to Probability Continuous random variables 9


PDF properties

f (x) is NOT a probability, it is probability density:


Z a
P[X = a] = f (x)dx = 0 ̸= f (a)
a

f (x) f (x)
x x
a a
|{z}
ϵ

Z a+ ϵ2
h ϵ ϵi
P a− ≤X ≤a+ = f (x)dx ≈ width × height = ϵf (a)
2 2 a− ϵ2

Intro to Probability Continuous random variables 9


PDF properties

f (x) is NOT a probability, it is probability density:


Z a
P[X = a] = f (x)dx = 0 ̸= f (a)
a

f (x) f (x)
x x
a a
|{z}
ϵ

Z a+ ϵ2
h ϵ ϵi
P a− ≤X ≤a+ = f (x)dx ≈ width × height = ϵf (a)
2 2 a− ϵ2

Thus, P [ X = a ] = lim ϵf (a) = 0.


ϵ→0

Intro to Probability Continuous random variables 9


PDF properties

f (x) is NOT a probability, it is probability density:


Z a
P[X = a] = f (x)dx = 0 ̸= f (a)
a

f (x) f (x)
x x
a a
|{z}
ϵ

Z a+ ϵ2
h ϵ ϵi
P a− ≤X ≤a+ = f (x)dx ≈ width × height = ϵf (a)
2 2 a− ϵ2

Thus, P [ X = a ] = lim ϵf (a) = 0.


ϵ→0

P[a ≤ X ≤ b] = P[a < X ≤ b] = P[a ≤ X < b] = P[a < X < b]

Intro to Probability Continuous random variables 9


PDF and probability example
Example
Let X be a continuous RV with PDF:
(
C(4x − 2x 2 ) when 0 < x < 2
f (x) =
0 otherwise

What is the value of the constant C? What is P [ X > 1 ]?


Answer
PDF and probability example
Example
Let X be a continuous RV with PDF:
(
C(4x − 2x 2 ) when 0 < x < 2
f (x) =
0 otherwise

What is the value of the constant C? What is P [ X > 1 ]?


Answer
f (x)

C is a normalisation constant. We know that


PDF must sum to 1:
x
0 1 2

Intro to Probability Continuous random variables 10


PDF and probability example cont.
Example
Let X be a continuous RV with PDF:
(
C(4x − 2x 2 ) when 0 < x < 2
f (x) =
0 otherwise

What is the value of the constant C? What is P [ X > 1 ]?


Answer

Intro to Probability Continuous random variables 11


PDF and probability example cont.
Example
Let X be a continuous RV with PDF:
(
C(4x − 2x 2 ) when 0 < x < 2
f (x) =
0 otherwise

What is the value of the constant C? What is P [ X > 1 ]?


Answer
f (x)

x
0 1 2

Intro to Probability Continuous random variables 11


PDF and probability example cont.
Example
Let X be a continuous RV with PDF:
(
C(4x − 2x 2 ) when 0 < x < 2
f (x) =
0 otherwise

What is the value of the constant C? What is P [ X > 1 ]?


Answer
f (x)

x
0 1 2
Z ∞ Z 2 Z ∞
P[X > 1] = f (x)dx = f (x)dx + 0dx
1 1 2

Intro to Probability Continuous random variables 11


PDF and probability example cont.
Example
Let X be a continuous RV with PDF:
(
C(4x − 2x 2 ) when 0 < x < 2
f (x) =
0 otherwise

What is the value of the constant C? What is P [ X > 1 ]?


Answer
f (x)

x
0 1 2
Z ∞ Z 2 Z ∞
P[X > 1] = f (x)dx = f (x)dx + 0dx
1 1 2
!
2 2
3 3 2x 3
Z
= (4x − 2x 2 )dx = 2x − 2
=
1 8 8 3 1

Intro to Probability Continuous random variables 11


PDF and probability example cont.
Example
Let X be a continuous RV with PDF:
(
C(4x − 2x 2 ) when 0 < x < 2
f (x) =
0 otherwise

What is the value of the constant C? What is P [ X > 1 ]?


Answer
f (x)

x
0 1 2
Z ∞ Z 2 Z ∞
P[X > 1] = f (x)dx = f (x)dx + 0dx
1 1 2
!
2 2
3 3 2x 3
Z
= (4x − 2x 2 )dx = 2x 2 − =
1 8 8 3 1
   
3 16 2 1
= 8− − 2− =
8 3 3 2

Intro to Probability Continuous random variables 11


Outline

Continuous random variables

Cumulative distribution function, expectation, variance

Uniform random variable

Exponential random variable

Normal (Gaussian) random variable

Intro to Probability Cumulative distribution function, expectation, variance 12


Cumulative distribution function
Since PDF is not a probability, we need to solve an integral every single
time we want to calculate a probability.

To save effort, cumulative distribution function (CDF) computes this:


F (a) = FX (a) = P [ X ≤ a ] where −∞ < a < ∞.
X
Recall: CDF for discrete RV is F (a) = p(x)
all x≤a

Intro to Probability Cumulative distribution function, expectation, variance 13


Cumulative distribution function
Since PDF is not a probability, we need to solve an integral every single
time we want to calculate a probability.

To save effort, cumulative distribution function (CDF) computes this:


F (a) = FX (a) = P [ X ≤ a ] where −∞ < a < ∞.
X
Recall: CDF for discrete RV is F (a) = p(x)
all x≤a

Cumulative distribution function for a continuous RV


For a continuous random variable X with PDF f (x), the cumulative
distribution function (CDF) is:
Z a
FX (a) = P [ X ≤ a ] = f (x)dx
−∞
f (x)

x
a
Cumulative distribution function
Since PDF is not a probability, we need to solve an integral every single
time we want to calculate a probability.

To save effort, cumulative distribution function (CDF) computes this:


F (a) = FX (a) = P [ X ≤ a ] where −∞ < a < ∞.
X
Recall: CDF for discrete RV is F (a) = p(x)
all x≤a

Cumulative distribution function for a continuous RV


For a continuous random variable X with PDF f (x), the cumulative
distribution function (CDF) is:
Z a
FX (a) = P [ X ≤ a ] = f (x)dx
−∞
f (x)

F (a)

x
a
Cumulative distribution function
Since PDF is not a probability, we need to solve an integral every single
time we want to calculate a probability.

To save effort, cumulative distribution function (CDF) computes this:


F (a) = FX (a) = P [ X ≤ a ] where −∞ < a < ∞.
X
Recall: CDF for discrete RV is F (a) = p(x)
all x≤a

Cumulative distribution function for a continuous RV


For a continuous random variable X with PDF f (x), the cumulative
distribution function (CDF) is:
Z a
FX (a) = P [ X ≤ a ] = f (x)dx
−∞
f (x)

F (a)
−∞

x
a

Intro to Probability Cumulative distribution function, expectation, variance 13


CDF properties

While PDF is not a probability, CDF is.

If you learn to use CDFs, you can avoid integrating the PDF.

It is a matter of convention that CDF is probability that a RV takes on a


value less than (or equal to) the input value as opposed to greater than.

Useful examples of using CDF:

Probability question Solution Explanation


P[X ≤ a] F (a) Definition of CDF
P[X < a] F (a) Note that P [ X = a ] = 0
P[X > a] 1 − F (a) P[X ≤ a] + P[X > a] = 1
P[a < X < b] F (b) − F (a) F (a) + P [ a < X < b ] = F (b)

Intro to Probability Cumulative distribution function, expectation, variance 14


Computing CDF
f (x)
P[a ≤ X ≤ b]

F (a)

x
a b
P[a ≤ X ≤ b]
F (b)
F (a)
– =
b a a b

Intro to Probability Cumulative distribution function, expectation, variance 15


Computing CDF
f (x)
P[a ≤ X ≤ b]

F (a)

x
a b
P[a ≤ X ≤ b]
F (b)
F (a)
– =
b a a b

Z b Z a
F (b) − F (a) = f (x)dx − f (x)dx
−∞ −∞
Z a Z b  Z a
= f (x)dx + f (x)dx − f (x)dx
−∞ a −∞
Z b
= f (x)dx = P [ a < X < b ] = P [ a ≤ X ≤ b ]
a

Intro to Probability Cumulative distribution function, expectation, variance 15


Expectation and variance for continuous RV

Discrete RV X Continuous RV X
X Z ∞
E[X ] = xp(x) E[X ] = xf (x)dx
x −∞
X Z ∞
E [ g(X ) ] = g(x)p(x) E [ g(X ) ] = g(x)f (x)dx
x −∞

Both continuous and discrete RVs

E [ aX + b ] = aE [ X ] + b Linearity of expectation
h i h i
V [ X ] = E (X − E [ X ])2 = E X 2 − (E [ X ]2 ) Properties of
2
V [ aX + b ] = a V [ X ] variance

Intro to Probability Cumulative distribution function, expectation, variance 16


Outline

Continuous random variables

Cumulative distribution function, expectation, variance

Uniform random variable

Exponential random variable

Normal (Gaussian) random variable

Intro to Probability Uniform random variable 17


Uniform continuous RV
Uniform continuous random variable
A uniform continuous random variable X is defined as follows:

X∼Uni(α, β)

Range: [α, β], sometimes (α, β)


(
1
when α ≤ x ≤ β
PDF: f (x) = β−α
0 otherwise
α+β
Expectation: E [ X ] =
2
(β − α)2
Variance: V [ X ] =
12

Intro to Probability Uniform random variable 18


Uniform continuous RV
Uniform continuous random variable
A uniform continuous random variable X is defined as follows:

X∼Uni(α, β)

Range: [α, β], sometimes (α, β)


(
1
when α ≤ x ≤ β
PDF: f (x) = β−α
0 otherwise
α+β
Expectation: E [ X ] =
2
(β − α)2
Variance: V [ X ] =
12

1
Notice that the density β−α is exactly the
f (x)
area= 1 same regardless of the value of x. This
makes it uniform.
1
β−α 1
The PDF is β−α since it is a constant such
x that the integral over all possible inputs
α β evaluates to 1.
Intro to Probability Uniform random variable 18
Public transport example
Example
The University bus arrives at the Computer Lab bus stop at 7:00, 7:15
and so on at 15 minute intervals. You arrive at the bus stop a time
uniformly distributed in the interval between 1pm and 1:30pm. What is
the probability that you wait less than 5 minutes for the bus?
Answer
Public transport example
Example
The University bus arrives at the Computer Lab bus stop at 7:00, 7:15
and so on at 15 minute intervals. You arrive at the bus stop a time
uniformly distributed in the interval between 1pm and 1:30pm. What is
the probability that you wait less than 5 minutes for the bus?
Answer

Let X be a RV for the time you arrive after 1pm to the bus stop.
Define RVs: X ∼ Uni(0, 30)
Solve:

Intro to Probability Uniform random variable 19


Expectation for Uniform RV

f (x)

1
β−α

x
α β

Z ∞ Z β
1
E[X ] = x · f (x) dx = x· dx
−∞ α β−α

β
1 1 2 1 1 2
= x = (β − α2 )
β−α2 α β−α2

1 (β + α)(β − α) α+β
= =
2 β−α 2

Intro to Probability Uniform random variable 20


Outline

Continuous random variables

Cumulative distribution function, expectation, variance

Uniform random variable

Exponential random variable

Normal (Gaussian) random variable

Intro to Probability Exponential random variable 21


Exponential continuous RV
Exponential continuous random variable
An exponential random variable X represents the time until an event (first
success) occurs. It is parametrised by λ > 0, the constant rate at which
the event occurs.
X∼Exp(λ)

Range: [0, ∞)
(
λe−λx when x ≥ 0
PDF: f (x) =
0 otherwise
1
Expectation: E [ X ] = (time)
λ
1
Variance: V [ X ] = 2
λ

Intro to Probability Exponential random variable 22


Exponential continuous RV
Exponential continuous random variable
An exponential random variable X represents the time until an event (first
success) occurs. It is parametrised by λ > 0, the constant rate at which
the event occurs.
X∼Exp(λ)

Range: [0, ∞)
(
λe−λx when x ≥ 0
PDF: f (x) =
0 otherwise
1
Expectation: E [ X ] = (time)
λ
1
Variance: V [ X ] = 2
λ

f (x) Examples: time until next earthquake, time for request to


reach web server, time until end of mobile phone contract.
Note that λ is the same as the one in the Poisson RV.
Poisson RV counts # of events that occur in a fixed
x interval, exponential RV measures the amount of time
0 1 2 3 4 5
until the next event occurs.
Intro to Probability Exponential random variable 22
Pandemic example
Example
Major pandemics occur once every 100 years. What is the probability of
a major pandemic in the next 5 years? What is the standard deviation of
years until the next pandemic?
Answer
Pandemic example
Example
Major pandemics occur once every 100 years. What is the probability of
a major pandemic in the next 5 years? What is the standard deviation of
years until the next pandemic?
Answer

Let X be a RV for the time when the next pandemic happens.


Let a unit of time be 1 year.
1 1
Define RVs: X ∼ Exp(λ), E [ X ] = λ
= 100, thus λ = 100
= 0.01
X ∼ Exp(λ = 0.01).
Solve: Compute P [ X < 5 ] , SD [ X ].

Intro to Probability Exponential random variable 23


CDF of Exponential RV

CDF for Exponential RV


If X is an exponential continuous random variable, X ∼ Exp(λ), then its
cumulative distribution function CDF (where x ≥ 0) is

F (x) = 1 − e−λx

Proof:
Z x
F (x) = P [ X ≤ x ] = λe−λx dx
0
x
1 −λx
=λ e
−λ 0

= −1(e−λx − e−λ0 )
= 1 − e−λx

Intro to Probability Exponential random variable 24


Outline

Continuous random variables

Cumulative distribution function, expectation, variance

Uniform random variable

Exponential random variable

Normal (Gaussian) random variable

Intro to Probability Normal (Gaussian) random variable 25


Normal continuous RV
Normal continuous random variable
A normal random variable X , parametrised over mean µ and variance σ 2
is defined as
X∼N (µ, σ 2 )

Range: (−∞, ∞)
1 2 2
PDF: f (x) = √ e−(x−µ) /2σ
σ 2π
Expectation: E [ X ] = µ
Variance: V [ X ] = σ 2

Intro to Probability Normal (Gaussian) random variable 26


Normal continuous RV
Normal continuous random variable
A normal random variable X , parametrised over mean µ and variance σ 2
is defined as
X∼N (µ, σ 2 )

Range: (−∞, ∞)
1 2 2
PDF: f (x) =√ e−(x−µ) /2σ
σ 2π
Expectation: E [ X ] = µ
Variance: V [ X ] = σ 2

The most important random variable type, AKA


f (x) Gaussian RV and Bell curve.
Generated from summing independent RV, thus occurs
often in nature (cf. Central Limit Theorem in Lecture 8).
Used to model entropic (conservative) distribution of data
with mean and variance.
x
µ
Intro to Probability Normal (Gaussian) random variable 26
Normal RV paradigm
Goal: translate problem statement into a RV – model real life situation with
probability distributions (e.g., height distribution in a class).

Intro to Probability Normal (Gaussian) random variable 27


Normal RV paradigm
Goal: translate problem statement into a RV – model real life situation with
probability distributions (e.g., height distribution in a class).

Perfect fit! Same mean and variance!


But what about another class? Generalises well.
Overfit?

Intro to Probability Normal (Gaussian) random variable 27


Normal RV paradigm
Goal: translate problem statement into a RV – model real life situation with
probability distributions (e.g., height distribution in a class).

Perfect fit! Same mean and variance!


But what about another class? Generalises well.
Overfit?

Let X ∼ N (µ, σ 2 ). PDF of X :

1 (x−µ)2

f (x) = √ e 2σ2
σ 2π

Intro to Probability Normal (Gaussian) random variable 27


Normal RV paradigm
Goal: translate problem statement into a RV – model real life situation with
probability distributions (e.g., height distribution in a class).

Perfect fit! Same mean and variance!


But what about another class? Generalises well.
Overfit?

Let X ∼ N (µ, σ 2 ). PDF of X :

1 (x−µ)2

f (x) = √ e 2σ2
σ 2π
normalising constant

Intro to Probability Normal (Gaussian) random variable 27


Normal RV paradigm
Goal: translate problem statement into a RV – model real life situation with
probability distributions (e.g., height distribution in a class).

Perfect fit! Same mean and variance!


But what about another class? Generalises well.
Overfit?

Let X ∼ N (µ, σ 2 ). PDF of X :

1 (x−µ)2

f (x) = √ e 2σ2
σ 2π
normalising constant variance σ 2 manages spread

Intro to Probability Normal (Gaussian) random variable 27


Normal RV paradigm
Goal: translate problem statement into a RV – model real life situation with
probability distributions (e.g., height distribution in a class).

Perfect fit! Same mean and variance!


But what about another class? Generalises well.
Overfit?

Let X ∼ N (µ, σ 2 ). PDF of X :


exponential tail

1 (x−µ)2

f (x) = √ e 2σ2
σ 2π
normalising constant variance σ 2 manages spread

Intro to Probability Normal (Gaussian) random variable 27


Normal RV paradigm
Goal: translate problem statement into a RV – model real life situation with
probability distributions (e.g., height distribution in a class).

Perfect fit! Same mean and variance!


But what about another class? Generalises well.
Overfit?

Let X ∼ N (µ, σ 2 ). PDF of X :


exponential tail symmetric around µ

1 (x−µ)2

f (x) = √ e 2σ2
σ 2π
normalising constant variance σ 2 manages spread

Intro to Probability Normal (Gaussian) random variable 27


Normal RV paradigm
Goal: translate problem statement into a RV – model real life situation with
probability distributions (e.g., height distribution in a class).

Perfect fit! Same mean and variance!


But what about another class? Generalises well.
Overfit?

Let X ∼ N (µ, σ 2 ). PDF of X :


exponential tail symmetric around µ
2

1 (x−µ)2
− 1.5
N (0, 1)
f (x) = √ e 2σ 2 1
N (0, 2)
N (−2, 0.5)
σ 2π 0.5 N (0, 0.2)

normalising constant variance σ 2 manages spread 0


−4 −2 0 2 4

Intro to Probability Normal (Gaussian) random variable 27


Walking example

Example
You spent X minutes walking to the department every day. The average
time you spend is µ = 10 minutes. The variance from day to day of the
time spent to get to the department is σ 2 = 2 minutes2 . Suppose X is
normally distributed. What is the probability you spend ≥ 12 minutes
travelling to the department?
Answer
Walking example

Example
You spent X minutes walking to the department every day. The average
time you spend is µ = 10 minutes. The variance from day to day of the
time spent to get to the department is σ 2 = 2 minutes2 . Suppose X is
normally distributed. What is the probability you spend ≥ 12 minutes
travelling to the department?
Answer

2
X ∼ N (µ = 10, σ = 2)
Z ∞ Z ∞ (x−µ)2
1 −
P [ X ≥ 12 ] = f (x)dx = √ e 2σ2 dx
12 12 σ 2π

Intro to Probability Normal (Gaussian) random variable 28


Walking example

Example
You spent X minutes walking to the department every day. The average
time you spend is µ = 10 minutes. The variance from day to day of the
time spent to get to the department is σ 2 = 2 minutes2 . Suppose X is
normally distributed. What is the probability you spend ≥ 12 minutes
travelling to the department?
Answer

2
X ∼ N (µ = 10, σ = 2)
Z ∞ Z ∞ (x−µ)2
1 −
P [ X ≥ 12 ] = f (x)dx = √ e 2σ2 dx
12 12 σ 2π

Cannot be solved analytically!


That is, no closed form for the integral of the Normal PDF. (But...)

Intro to Probability Normal (Gaussian) random variable 28


Properties for Normal RV
Let X ∼ N (µ, σ 2 ) with CDF P [ X ≤ x ] = F (x).

Linear tranformations of Normal RVs are also Normal RVs.


If Y = aX + b, then Y ∼ N (aµ + b, a2 σ 2 )

Intro to Probability Normal (Gaussian) random variable 29


Properties for Normal RV
Let X ∼ N (µ, σ 2 ) with CDF P [ X ≤ x ] = F (x).

Linear tranformations of Normal RVs are also Normal RVs.


If Y = aX + b, then Y ∼ N (aµ + b, a2 σ 2 )
Proof outline:
E [ Y ] = E [ aX + b ] = aE [ X ] + b = aµ + b (linearity of expectation)
V [ Y ] = V [ aX + b ] = a2 V [ X ] = a2 σ 2
Y is also Normal.

Intro to Probability Normal (Gaussian) random variable 29


Properties for Normal RV
Let X ∼ N (µ, σ 2 ) with CDF P [ X ≤ x ] = F (x).

Linear tranformations of Normal RVs are also Normal RVs.


If Y = aX + b, then Y ∼ N (aµ + b, a2 σ 2 )
Proof outline:
E [ Y ] = E [ aX + b ] = aE [ X ] + b = aµ + b (linearity of expectation)
V [ Y ] = V [ aX + b ] = a2 V [ X ] = a2 σ 2
Y is also Normal.

The PDF of a Normal RV is symmetric about the mean µ.


F (µ − x) = 1 − F (µ + x)

f (x)

P[X ≤ µ − x ] 1 − P[X ≤ µ + x ]

x
µ−x µ µ+x

Intro to Probability Normal (Gaussian) random variable 29


Computing probabilities with Normal RV

Let X ∼ N (µ, σ 2 ). How do we compute CDF, P [ X ≤ x ] = F (x)?

We cannot analytically solve the integral (it has no closed form).

Intro to Probability Normal (Gaussian) random variable 30


Computing probabilities with Normal RV

Let X ∼ N (µ, σ 2 ). How do we compute CDF, P [ X ≤ x ] = F (x)?

We cannot analytically solve the integral (it has no closed form).


But we can solve numerically using a function Φ, which is a precomputed
function:

 
x −µ
F (x) = Φ
σ

Intro to Probability Normal (Gaussian) random variable 30


Computing probabilities with Normal RV

Let X ∼ N (µ, σ 2 ). How do we compute CDF, P [ X ≤ x ] = F (x)?

We cannot analytically solve the integral (it has no closed form).


But we can solve numerically using a function Φ, which is a precomputed
function:

 
x −µ
F (x) = Φ
σ

CDF of the Standard Normal, Z

Intro to Probability Normal (Gaussian) random variable 30


Z: Standard Normal RV
Standard Normal random variable Z
The Standard Normal continuous random variable Z is defined as

Z∼N (0, 1)

Expectation: E [ Z ] = µ = 0 (zero mean)


Variance: V [ Z ] = σ 2 = 1 (unit variance)

Not a new distribution: a special case of the Normal (N (µ, σ 2 ) = µ+σN (0, 1)).
CDF of Z defined as P [ Z ≤ z ] = Φ(z).

Intro to Probability Normal (Gaussian) random variable 31


Z: Standard Normal RV
Standard Normal random variable Z
The Standard Normal continuous random variable Z is defined as

Z∼N (0, 1)

Expectation: E [ Z ] = µ = 0 (zero mean)


Variance: V [ Z ] = σ 2 = 1 (unit variance)

Not a new distribution: a special case of the Normal (N (µ, σ 2 ) = µ+σN (0, 1)).
CDF of Z defined as P [ Z ≤ z ] = Φ(z).

0.4

0.3 z = 0.83
0.2

Φ(z)
0.1

−3 −2 −1 0 1 2 3

P [ Z ≤ 0.83 ] = Φ(0.83) =

Intro to Probability Normal (Gaussian) random variable 31


Z: Standard Normal RV
Standard Normal random variable Z
The Standard Normal continuous random variable Z is defined as

Z∼N (0, 1)

Expectation: E [ Z ] = µ = 0 (zero mean)


Variance: V [ Z ] = σ 2 = 1 (unit variance)

Not a new distribution: a special case of the Normal (N (µ, σ 2 ) = µ+σN (0, 1)).
CDF of Z defined as P [ Z ≤ z ] = Φ(z).

0.4

0.3 z = 0.83
0.2

Φ(z)
0.1

−3 −2 −1 0 1 2 3

P [ Z ≤ 0.83 ] = Φ(0.83) = 0.7967

Intro to Probability Normal (Gaussian) random variable 31


Walking example revisited
Example
You spent X minutes walking to the department every day. The average
time you spend is µ = 10 minutes. The variance from day to day of the
time spent to get to the department is σ 2 = 2 minutes2 . Suppose X is
normally distributed. What is the probability you spend ≥ 12 minutes
travelling to the department?
Answer

2
X ∼ N (µ = 10, σ = 2)
R∞
(But P [ X ≥ 12 ] = 12 f (x)dx has no analytic solution.)

(x−µ)
1. Compute z = σ
: 2. Look up Φ(z) in table:

Intro to Probability Normal (Gaussian) random variable 32

You might also like