0% found this document useful (0 votes)
9 views48 pages

Continuous Random Variables

Continuous Random Variables

Uploaded by

pmaldio866
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)
9 views48 pages

Continuous Random Variables

Continuous Random Variables

Uploaded by

pmaldio866
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

Chapter 5 part 1

Continuous Random Variables

EEE 214

Chapter 5 part 1 EEE 214 1 / 22


Outline

1 Continuous random variables

2 Expectation and variance of continuous random variable

3 Uniform distribution

Chapter 5 part 1 EEE 214 2 / 22


Continuous random variables

Outline

1 Continuous random variables

2 Expectation and variance of continuous random variable

3 Uniform distribution

Chapter 5 part 1 EEE 214 3 / 22


Continuous random variables

Continuous random variables


☞ A continuous random variable X can take any real value in (−∞, ∞).

Chapter 5 part 1 EEE 214 4 / 22


Continuous random variables

Continuous random variables


☞ A continuous random variable X can take any real value in (−∞, ∞).

Definition
X is a continuous random variable if there exists a nonnegative function
f defined for any x ∈ (−∞, ∞), such that for any set B of real numbers,
Z
P (X ∈ B) = f (x)dx
B

This function f is called the probability density function (pdf) of the


random variable X.

Chapter 5 part 1 EEE 214 4 / 22


Continuous random variables

Continuous random variables


☞ A continuous random variable X can take any real value in (−∞, ∞).

Definition
X is a continuous random variable if there exists a nonnegative function
f defined for any x ∈ (−∞, ∞), such that for any set B of real numbers,
Z
P (X ∈ B) = f (x)dx
B

This function f is called the probability density function (pdf) of the


random variable X.

Examples of continuous random variable


Rainfall amount for a year.
Lifetime of your first car.
Amount of coffee consumed on a exam week.
Chapter 5 part 1 EEE 214 4 / 22
Continuous random variables

Pdf and cdf


For pdf to be valid, in additional to being non-negative,
Z ∞
f (x)dx = P (−∞ < X < ∞) = 1
−∞

Chapter 5 part 1 EEE 214 5 / 22


Continuous random variables

Pdf and cdf


For pdf to be valid, in additional to being non-negative,
Z ∞
f (x)dx = P (−∞ < X < ∞) = 1
−∞

Cdf function of continuous random variable


Z a
F (a) = P (X ≤ a) = f (x)dx
−∞

Chapter 5 part 1 EEE 214 5 / 22


Continuous random variables

Pdf and cdf


For pdf to be valid, in additional to being non-negative,
Z ∞
f (x)dx = P (−∞ < X < ∞) = 1
−∞

Cdf function of continuous random variable


Z a
F (a) = P (X ≤ a) = f (x)dx
−∞
For continuous random variable, probability to be a single point is
zero. Z a
P (X = a) = f (x)dx = 0
a
P (X < a) = P (X ≤ a) − P (X = a) = F (a)

Chapter 5 part 1 EEE 214 5 / 22


Continuous random variables

Pdf and cdf


For pdf to be valid, in additional to being non-negative,
Z ∞
f (x)dx = P (−∞ < X < ∞) = 1
−∞

Cdf function of continuous random variable


Z a
F (a) = P (X ≤ a) = f (x)dx
−∞
For continuous random variable, probability to be a single point is
zero. Z a
P (X = a) = f (x)dx = 0
a
P (X < a) = P (X ≤ a) − P (X = a) = F (a)
Probability on an interval
P (a ≤ X ≤ b) = F (b) − F (a) = P (a < X < b)
Chapter 5 part 1 EEE 214 5 / 22
Continuous random variables

Chapter 5 part 1 EEE 214 6 / 22


Continuous random variables

Connection between pdf and cdf of continuous random variable. If we


know the pdf, Z a
F (a) = P (X ≤ a) = f (x)dx
−∞

Chapter 5 part 1 EEE 214 6 / 22


Continuous random variables

Connection between pdf and cdf of continuous random variable. If we


know the pdf, Z a
F (a) = P (X ≤ a) = f (x)dx
−∞
How to find the pdf if we know the cdf?

Chapter 5 part 1 EEE 214 6 / 22


Continuous random variables

Connection between pdf and cdf of continuous random variable. If we


know the pdf, Z a
F (a) = P (X ≤ a) = f (x)dx
−∞
How to find the pdf if we know the cdf?
d
f (x) = F (x)
dx
Chapter 5 part 1 EEE 214 6 / 22
Continuous random variables

Example: suppose that X is a continuous random variable whose pdf is


(
c(8x − 4x3 ) if 0 ≤ x ≤ 1
f (x) =
0 otherwise
What’s the value of c?

Chapter 5 part 1 EEE 214 7 / 22


Continuous random variables

Example: suppose that X is a continuous random variable whose pdf is


(
c(8x − 4x3 ) if 0 ≤ x ≤ 1
f (x) =
0 otherwise
What’s the value of c?

Z ∞
1= f (x)dx
−∞
Z 1
= c(8x − 4x3 )dx
0
 
1
= c 4x2 − x4 0

1
3c = 1 =⇒ c =
3

Chapter 5 part 1 EEE 214 7 / 22


Continuous random variables

Interpretation of the pdf


For some small value h > 0,
  Z x+ h
h h 2
P x− ≤X ≤x+ = f (t)dt
2 2 x− h
2
 
h h
≈ (x + ) − (x − ) f (x)
2 2
= h · f (x)

The larger f (x) is, the more likely X is to be “near” x.

Chapter 5 part 1 EEE 214 8 / 22


Continuous random variables

Question
Comparing discrete random variables and continuous random variables.

discrete continuous

values can take

pmf / pdf

validness (i.e. the sum


of probability is 1)

cdf

from cdf to pmf / pdf

probability at a single
point
Chapter 5 part 1 EEE 214 9 / 22
Expectation and variance of continuous random variable

Outline

1 Continuous random variables

2 Expectation and variance of continuous random variable

3 Uniform distribution

Chapter 5 part 1 EEE 214 10 / 22


Expectation and variance of continuous random variable

Expectation and variance of continuous random variable


Recall that expected value of the discrete random variable X with
pmf p(x), X
E[X] = xp(x)
all x

Chapter 5 part 1 EEE 214 11 / 22


Expectation and variance of continuous random variable

Expectation and variance of continuous random variable


Recall that expected value of the discrete random variable X with
pmf p(x), X
E[X] = xp(x)
all x

We define expected value of a continuous random variable X with pdf


f (x) as Z ∞
E[X] = xf (x)dx
−∞

Chapter 5 part 1 EEE 214 11 / 22


Expectation and variance of continuous random variable

Expectation and variance of continuous random variable


Recall that expected value of the discrete random variable X with
pmf p(x), X
E[X] = xp(x)
all x

We define expected value of a continuous random variable X with pdf


f (x) as Z ∞
E[X] = xf (x)dx
−∞
Definitions of variance and standard deviation are the same.
p
V ar(X) = E[X 2 ] − (E[X])2 , SD(X) = V ar(X)

Definition:
V ar(X) = E[(X − µ)2 ]

Chapter 5 part 1 EEE 214 11 / 22


Expectation and variance of continuous random variable

Properties of E[X] for continuous random variable


Recall that expected value of the discrete random variable X with
pmf p(x), X
E[g(X)] = g(x)p(x)
all x

Chapter 5 part 1 EEE 214 12 / 22


Expectation and variance of continuous random variable

Properties of E[X] for continuous random variable


Recall that expected value of the discrete random variable X with
pmf p(x), X
E[g(X)] = g(x)p(x)
all x

Similarly, expected value of a continuous random variable X with pdf


f (x) as Z ∞
E[g(X)] = g(x)f (x)dx
−∞

Chapter 5 part 1 EEE 214 12 / 22


Expectation and variance of continuous random variable

Properties of E[X] for continuous random variable


Similarly as discrete random variable, for continuous random variable X
and Y
Sum of two random variable’s

E[X + Y ] = E[X] + E[Y ]

If a and b are constants, then

E[aX + b] = aE[X] + b

If a and b are constants, then

V ar(aX + b) = a2 V ar(X)

Chapter 5 part 1 EEE 214 13 / 22


Expectation and variance of continuous random variable

Find the mean and variance of the continuous random variable X, whose
pdf is
(
2x if 0 ≤ x ≤ 1
f (x) =
0 otherwise

Chapter 5 part 1 EEE 214 14 / 22


Expectation and variance of continuous random variable

Find the mean and variance of the continuous random variable X, whose
pdf is
(
2x if 0 ≤ x ≤ 1
f (x) =
0 otherwise

Z ∞
E[X] = xf (x)dx
−∞
Z 1 1
2 3 2
= x · 2xdx = x =
0 3 0 3

Chapter 5 part 1 EEE 214 14 / 22


Expectation and variance of continuous random variable

Find the mean and variance of the continuous random variable X, whose
pdf is
(
2x if 0 ≤ x ≤ 1
f (x) =
0 otherwise

Z ∞
E[X] = xf (x)dx
−∞
Z 1 1
2 3 2
= x · 2xdx = x =
0 3 0 3
Z ∞
2 2
V ar[X] = E[X ] − (E[X]) = x2 f (x)dx − (2/3)2
−∞
Z 1 1
2 4 1
= x2 · 2xdx − 4/9 = x − 4/9 =
0 4 0 18
Chapter 5 part 1 EEE 214 14 / 22
Expectation and variance of continuous random variable

Question
Comparing discrete random variables and continuous random variables.

discrete continuous

E[X]

E[g(X)]

Var(X)

E[aX+b]

Var(aX+b)

E[X+Y]
Chapter 5 part 1 EEE 214 15 / 22
Uniform distribution

Outline

1 Continuous random variables

2 Expectation and variance of continuous random variable

3 Uniform distribution

Chapter 5 part 1 EEE 214 16 / 22


Uniform distribution

Uniform Distribution
Let’s define a continuous probability distribution that has some constant
value c between α and β where α < β. What is the pdf?
(
c if α < x < β
f (x) =
0 otherwise

Chapter 5 part 1 EEE 214 17 / 22


Uniform distribution

Uniform Distribution
Let’s define a continuous probability distribution that has some constant
value c between α and β where α < β. What is the pdf?
(
c if α < x < β
f (x) =
0 otherwise
Z ∞ Z β
1
1= f (x)dx = cdx = c(β − α) =⇒ c =
−∞ α β−α

Chapter 5 part 1 EEE 214 17 / 22


Uniform distribution

Uniform Distribution
Let’s define a continuous probability distribution that has some constant
value c between α and β where α < β. What is the pdf?
(
c if α < x < β
f (x) =
0 otherwise
Z ∞ Z β
1
1= f (x)dx = cdx = c(β − α) =⇒ c =
−∞ α β−α

Definition
A continuous random variable X has a Uniform distribution on the interval
(α, β) if its pdf is
(
1
1 if α < x < β
X ∼ Unif(α, β) ⇐⇒ f (x) = · 1(α,β) (x) = β−α
β−α 0 otherwise

Chapter 5 part 1 EEE 214 17 / 22


Uniform distribution

Cdf of Uniform distribution


For any x ∈ (α, β),
x x
x−α
Z Z
1
F (x) = f (t) dt = dt =
−∞ α β−α β−α

Chapter 5 part 1 EEE 214 18 / 22


Uniform distribution

Cdf of Uniform distribution


For any x ∈ (α, β),
x x
x−α
Z Z
1
F (x) = f (t) dt = dt =
−∞ α β−α β−α

0
 if x ≤ α
x−α
X ∼ Unif(α, β), then its cdf is F (x) = β−α if α < x < β

1 if x ≥ β

Chapter 5 part 1 EEE 214 18 / 22


Uniform distribution

Cdf of Uniform distribution


For any x ∈ (α, β),
x x
x−α
Z Z
1
F (x) = f (t) dt = dt =
−∞ α β−α β−α

0
 if x ≤ α
x−α
X ∼ Unif(α, β), then its cdf is F (x) = β−α if α < x < β

1 if x ≥ β

Chapter 5 part 1 EEE 214 18 / 22


Uniform distribution

Mean of a Uniform distribution


(required) Expected value of X ∼ Unif(α, β) is

α+β
E[X] =
2

Chapter 5 part 1 EEE 214 19 / 22


Uniform distribution

Mean of a Uniform distribution


(required) Expected value of X ∼ Unif(α, β) is

α+β
E[X] =
2

β β
x2
Z
x
E[X] = dx =
a β−α 2(β − α) α
β2− α2
α+β
= =
2(β − α) 2

Chapter 5 part 1 EEE 214 19 / 22


Uniform distribution

Variance of a Uniform distribution


(required) Variance of X ∼ Unif(α, β) is
(β − α)2
V ar(X) =
12

Chapter 5 part 1 EEE 214 20 / 22


Uniform distribution

Variance of a Uniform distribution


(required) Variance of X ∼ Unif(α, β) is
(β − α)2
V ar(X) =
12
Z β 2 β
x x3
E[X 2 ] = dx =
a β−α 3(β − α) α
β 3 − α3 β 2 + βα + α2
= =
3(β − α) 3

Chapter 5 part 1 EEE 214 20 / 22


Uniform distribution

Variance of a Uniform distribution


(required) Variance of X ∼ Unif(α, β) is
(β − α)2
V ar(X) =
12
Z β 2 β
x x3
E[X 2 ] = dx =
a β−α 3(β − α) α
β 3 − α3 β 2 + βα + α2
= =
3(β − α) 3

β 2 + βα + α2 (β + α)2
V ar(X) = E[X 2 ] − E[X]2 = −
3 4
4b2 + 4βα + 4α2 3b2 + 6αβ + 3α2
= −
12 12
2
β − 2βα + α 2 (β − α) 2
= =
12 12
Chapter 5 part 1 EEE 214 20 / 22
Uniform distribution

Uniform distribution: probability calculation


If X ∼ Unif(α, β), then P (X ∈ B) = length(B)
β−α

Chapter 5 part 1 EEE 214 21 / 22


Uniform distribution

Uniform distribution: probability calculation


If X ∼ Unif(α, β), then P (X ∈ B) = length(B)
β−α

Example: The bus arrives at the nearest bus stop at 10-minute intervals
starting at 4pm. Suppose I arrive the bus stop at a time uniformly dis-
tributed between 4pm to 5pm. What’s the probability I will wait more than
7 minutes?

Chapter 5 part 1 EEE 214 21 / 22


Uniform distribution

Uniform distribution: probability calculation


If X ∼ Unif(α, β), then P (X ∈ B) = length(B)
β−α

Example: The bus arrives at the nearest bus stop at 10-minute intervals
starting at 4pm. Suppose I arrive the bus stop at a time uniformly dis-
tributed between 4pm to 5pm. What’s the probability I will wait more than
7 minutes?
Let X denote the time I arrive the bus stop.
X ∼ Unif(0, 60)

Chapter 5 part 1 EEE 214 21 / 22


Uniform distribution

Uniform distribution: probability calculation


If X ∼ Unif(α, β), then P (X ∈ B) = length(B)
β−α

Example: The bus arrives at the nearest bus stop at 10-minute intervals
starting at 4pm. Suppose I arrive the bus stop at a time uniformly dis-
tributed between 4pm to 5pm. What’s the probability I will wait more than
7 minutes?
Let X denote the time I arrive the bus stop.
X ∼ Unif(0, 60)
The bus arrives at time t = 0, 10, 20, 30, 40, 50, 60.
So the intervals of my arriving time such that I will wait more than 7 min:
B = (0, 3) ∪ (10, 13) ∪ (20, 23) ∪ (30, 33) ∪ (40, 43) ∪ (50, 53)

Chapter 5 part 1 EEE 214 21 / 22


Uniform distribution

Uniform distribution: probability calculation


If X ∼ Unif(α, β), then P (X ∈ B) = length(B)
β−α

Example: The bus arrives at the nearest bus stop at 10-minute intervals
starting at 4pm. Suppose I arrive the bus stop at a time uniformly dis-
tributed between 4pm to 5pm. What’s the probability I will wait more than
7 minutes?
Let X denote the time I arrive the bus stop.
X ∼ Unif(0, 60)
The bus arrives at time t = 0, 10, 20, 30, 40, 50, 60.
So the intervals of my arriving time such that I will wait more than 7 min:
B = (0, 3) ∪ (10, 13) ∪ (20, 23) ∪ (30, 33) ∪ (40, 43) ∪ (50, 53)

P (X ∈ B) = (3 × 6)/60 = 0.3
Chapter 5 part 1 EEE 214 21 / 22
Uniform distribution

Recap
Expectation for continuous random variable X and a function of it g(X)
Z ∞
E[X] = xf (x)dx
−∞
Z ∞
E[g(X)] = g(x)f (x)dx
−∞

Chapter 5 part 1 EEE 214 22 / 22


Uniform distribution

Recap
Expectation for continuous random variable X and a function of it g(X)
Z ∞
E[X] = xf (x)dx
−∞
Z ∞
E[g(X)] = g(x)f (x)dx
−∞

Uniform distribution X ∼ Unif(α, β)


Cdf 
Pdf ( 0
 if x ≤ α
1
β−α if α < x < β F (x) = x−α
if α < x < β
f (x) =  β−α
0 otherwise 
1 if x ≥ β
Mean and variance
α+β (β − α)2
E[X] = , V ar(X) =
2 12
Chapter 5 part 1 EEE 214 22 / 22

You might also like