You are on page 1of 31

Chapter 4 One Random Variable

Cumulative Distribution Function

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 1 / 31


Cumulative Distribution Function (CDF)

CDF of a random variable is a method to describe the distribution of


RVs.
CDF of a RV contains all the information required to calculate
probability for any event involving the RV.
The advantage of CDF is that it can be defined for any kind of RV
(discrete, continuous or mixed); while PMF cannot be defined for a
continuous RV.

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 2 / 31


Cumulative Distribution Function (CDF)

Definition
The CDF of a RV X, denoted by FX (x), is defined as the probability
of the event {X ≤ x} = {ζ ∈ S|X(ζ) ≤ x} for any value of x.

For −∞ < x < ∞, the CDF FX (x) of a RV X is given as:


 P
 pX (k) X : discrete


 k≤x
FX (x) = P [X ≤ x] =

 Rx

 fX (t)dt X : continuous.
−∞

The event {X ≤ x} and its probability may vary, as x is varied, i.e.


FX (x) is a function of the variable x.

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 3 / 31


Cumulative Distribution Function (CDF)

(a) CDF of a discrete RV X (b) CDF of a continuous RV X

(c) CDF of a mixed RV X

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 4 / 31


Properties of CDF

(1) 0 ≤ FX (x) ≤ 1 for any x ∈ [−∞, ∞] = R


Proof: This simply follows from the fact that FX (x) is a probability
and the axioms of probability.
(2) lim FX (x) = 1
x→∞
Proof:
lim FX (x) = lim P [{X ≤ x}] = P [ lim {X ≤ x}] = P [S] = 1
x→∞ x→∞ x→∞

(3) lim FX (x) = 0


x→−∞

Proof:
lim FX (−x) = lim P [{X ≤ −x}] = P [ lim {X ≤ −x}] = P [∅] = 0
x→∞ x→∞ x→∞

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 5 / 31


Properties of CDF

(4) For a ≤ b, FX (a) ≤ FX (b). In other words, FX (x) is monotone


non-decreasing in x.
Proof: {X ≤ b} = {X ≤ a} ∪ {a < X ≤ b}.
Since, {X ≤ a} and {a < X ≤ b} are disjoint events, therefore, by
the third axiom of probability we have,

P ({X ≤ b}) = P ({X ≤ a}) + P ({a < X ≤ b})

FX (b) = FX (a) + P (a < X ≤ b)

FX (a) ≤ FX (b) for a ≤ b

(5) If a < b, then, P (a < X ≤ b) = FX (b) − FX (a)

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 6 / 31


Properties of CDF

(6) FX (b) = FX (b+ ), i.e., the CDF FX (x) is a right-continuous function.

(7) P (X = b) = FX (b) − FX (b− )


| {z }
jump at b

(8) P [X > b] = 1 − P [X ≤ b] = 1 − FX (b)

(a) CDF of a discrete RV X

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 7 / 31


Cumulative Distribution Function (CDF)

Example (Two Coin Tosses)


Let X be the no. of observed heads in two tosses of a fair coin. Find the
CDF, FX (x), of X.
Solution: S = {T T, HT, T H, HH}, and SX = {0, 1, 2}. Note that
X ∼ Binomial(2, 21 ) with and its PMF is given as:

pX (x)

1
2
1
4
1
4

0 1 2
x
Dr. Babar Mansoor EEE251 Probability Methods in Engineering 8 / 31
Cumulative Distribution Function (CDF)

Example (Two Coin Tosses)


To find the CDF we proceed as follows:
First, note that if x < 0, then pX (x)

FX (x) = P (X ≤ x) = 0, 1
2
1
Next, if 0 ≤ x < 1, 4
1
1 4
FX (x) = P (X ≤ x) = P (X = 0) = ,
4 0 1 2
x
Next, if 1 ≤ x < 2,
1 1 3
FX (x) = P (X ≤ x) = P (X = 0) + P (X = 1) = + =
4 2 4
Next, if x ≥ 2,
FX (x) = P (X ≤ 2) = P (X = 0) + P (X = 1) + P (X = 2)
1 1 1
= + + =1
4 2 4
Dr. Babar Mansoor EEE251 Probability Methods in Engineering 9 / 31
Cumulative Distribution Function (CDF)

Example (Two Coin Tosses)


 1 

 4 for x = 0  0 for x<0

 

1
2 for x = 1  1 for 0≤x<1
pX (x) = 1 FX (x) = 4

 for x = 2  3
for 1≤x<2


4 
 4
0 otherwise 
1 for x≥2

pX (x) 𝐹 𝑥

1
2 1
1 3
4
4
1 𝑃 𝑋 1
4 1
4

0 1 2 𝑥
x 0 1 2 3

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 10 / 31


Cumulative Distribution Function

Example (Two Coin Tosses)


For discrete RVs, we can also write FX (x) in terms of unit-step
function as below:
1 1 1
FX (x) = u(x) + u(x − 1) + u(x − 2)
4 2 4
where u(x) is the unit-step function given by,

0 x < 0,
u(x) =
1 x ≥ 0.

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 11 / 31


Cumulative Distribution Function

Example
Suppose that a discrete RV has the following PMF
1 1 1 1
pX (1) = , pX (2) = , pX (3) = , pX (4) =
2 4 8 8

(a) Find and sketch FX (x) of the RV X.


(b) Find (i) P [X ≤ 1], (ii) P [1 < X ≤ 3], (iii) P [1 ≤ X ≤ 3]
Sol:
(a) First, note that if x < 1, then
FX (x) = P (X ≤ x) = 0, for x < 1.
Next, if x ≥ 4,
FX (x) = P (X ≤ x) = 1, for x ≥ 4.
Next, if 1 ≤ x < 2,
1
FX (x) = P (X ≤ x) = P (X = 1) = , for 1 ≤ x < 2.
2

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 12 / 31


Cumulative Distribution Function

Example
Next, if 2 ≤ x < 3,
1 1 3
FX (x) = P (X ≤ x) = P (X = 1)+P (X = 2) = + = , for 2 ≤ x < 3.
2 4 4
Next, if 3 ≤ x < 4,
1 1 1 7
FX (x) = P (X ≤ x) = P (X = 1)+P (X = 2)+P (X = 3) = + + = , f
2 4 8 8


 0 x<1

 1

 1≤x<2
 2 3
FX (x) = P [X ≤ x] = 4 2≤x<3

 7

 8 3≤x<4


 1 x≥4

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 13 / 31


-$% $2%+2 +&", $"!2%(2%#
2 
2

@^
Cumulative Distribution Function
%2 02*
2
2-"2+""2 ,$,2

Example
%%2 02*
2
2

(b)

−222/ /' 2 "^
(i) P [X < 1] = FX (1
 2 )=0 
2 2 2

(ii) P [1 < X ≤ 3] = FX (3) − FX (1) = 7/8 − 1/2 = 3/8


%%%2 02*
2
2

(iii) P [1 ≤ X ≤ 3] = P [X = 1] + FX (3) − FX (1)


2 = 1/2
 2 + 7/8 − 1/2 = 7/8

 222222 2/ /     
2 2 2 2




 




 
 

.KJ^  
Dr. Babar Mansoor EEE251 Probability Methods in Engineering 14 / 31
Cumulative Distribution Function
Homework
Let X be a discrete RV with the following PMF


 0.2 for x = −2



 0.3 for x = −1

0.2 for x = 0
pX (x) =

 0.2 for x = 1



 0.1 for x = 2

0 otherwise.

Find and plot the CDF of X.


ANS: 

 0 for x < −2



 0.2 for − 2 ≤ x < −1

0.5 for −1≤x<0
FX (x) =

 0.7 for 0≤x<1



 0.9 for 1≤x<2

1 for x ≥ 2.

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 15 / 31


Cumulative Distribution Function

Example
Let X be a discrete RV with the following CDF


 0 for x < 0

 1

 for 0≤x<1
 16
FX (x) = 2 for 1 ≤ x < 2

 3

 4 for 2 ≤ x < 3


 1 for x ≥ 3.

Find the range and PMF of X.


Sol:
SX = {0, 1, 2, 3}

pX (x) = FX (x) − FX (x− )

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 16 / 31


Cumulative Distribution Function
Example (Cont.)
1 1
pX (0) = FX (0) − FX (0− ) = −0=
6 6
1 1 1
pX (1) = FX (1) − FX (1− ) = − =
2 6 3
3 1 1
pX (2) = FX (2) − FX (2− ) = − =
4 2 4
3 1
pX (3) = FX (3) − FX (3− ) = 1 − =
4 4
Thus,  1

 6 for x = 0




1
for x = 1
 3
1
pX (x) = 4 for x = 2

 1

 for x = 3


4
 0 otherwise.
Dr. Babar Mansoor EEE251 Probability Methods in Engineering 17 / 31
CDF of Continuous RVs

Relationship between CDF & PDF of a continuous RV


For a continuous RV X, we have
Zx
FX (x) = P [X ≤ x] = fX (t)dt
−∞

Thus, the PDF fX (x) can be obtained from the CDF by


differentiation:
dFX (x)
fX (x) =
dx
For a continuous RV, the CDF has no jumps, i.e., it is continuous.
We also have
Z b
P (a < X ≤ b) = FX (b) − FX (a) = fX (t)dt.
a

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 18 / 31


CDF of Continuous RVs
Continuous Uniform Distribution
A RV X with a flat probability density function between two points a and b, so
that 
1
 b−a , a≤x≤b
fX (x) =
 0, otherwise.
is said to have a uniform distribution written as X ∼ U (a, b).

𝑓 𝑥

1
𝑏 𝑎

𝑎 𝑏 𝑥
Dr. Babar Mansoor EEE251 Probability Methods in Engineering 19 / 31
CDF of Continuous RVs
X ∼ U (a, b)
From the definition of CDF, FX (x) = P (X ≤ x) we get
Zx
FX (x) = fX (u)du = 0 for x < a
−∞
Zx Zx
1
FX (x) = fX (u)du = du, a ≤ x ≤ b
b−a
−∞ a
x−a
= , a≤x≤b
b−a
and
FX (x) = 1, x ≥ b
Therefore,

 0 for x < a
x−a
FX (x) = b−a for a ≤ x ≤ b

1 for x > b
Dr. Babar Mansoor EEE251 Probability Methods in Engineering 20 / 31
CDF of Continuous RVs

X ∼ U (a, b)
𝑓 𝑥
𝐹 𝑥

1
1
𝑏 𝑎

𝑎 𝑏 𝑥 𝑎 𝑏 𝑥

PDF and CDF of X ∼ U (a, b).

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 21 / 31


CDF of Continuous RVs
Example (Bus Arrival Time)
Suppose that a bus arrives at a station every day between 10:00 A.M. and
10:30 A.M., at random. Let X be the arrival time; find the distribution
function of X and sketch its graph.
Sol:
The bus arrives at the station at random, between 10 and 10 12 , so if
t ≤ 10, FX (t) = P (X ≤ t) = 0. Now if t ∈ (10, 10 21 ), then
t − 10
FX (t) = P (X ≤ t) = = 2(t − 10)
10 12 − 10

If t ≥ 10 12 , then, FX (t) = P (X ≤ t) = 1. Thus,



 0 t < 10

FX (t) = 2(t − 10) 10 ≤ t < 10 12

 1 t ≥ 10 12
Dr. Babar Mansoor EEE251 Probability Methods in Engineering 22 / 31

CDF of F (t) =
Continuous RVs 2(t − 10) 10 ≤ t < 10 12


1 t ≥ 10 12 .

e graph of F is shown in Figure 4.3. 


Example (Bus Arrival Time)

F(t)
1

t
10 10.5

Cummulative Distribution Function of X


Figure 4.3 Distribution function of Example 4.9.

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 23 / 31


CDF of Continuous RVs

The Exponential Distribution


Often used to model failure or waiting times, such as how long it
takes for something to happen, and interarrival times.
The exponential RV, with parameter λ > 0, is a non-negative RV and
has pdf as follows:

 λe−λx , x ≥ 0,
fX (x) =
 0, x < 0.

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 24 / 31


CDF of Continuous RVs

Probability density function of X ∼ Exp(λ).

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 25 / 31


CDF of Continuous RVs

CDF of Exponential Distribution


For X ∼ Exp(λ), where λ > 0, the CDF is given as:

FX (x) = P (X ≤ x) = 0, for x ≤ 0

and
Zx x

FX (x) = λe−λt dt = −e−λt = 1 − e−λx , for x > 0
0
0

So, 
 1 − e−λx , x > 0,
FX (x) = P (X ≤ x) =
 0, x ≤ 0.

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 26 / 31


CDF of Continuous RVs

CDF of X ∼ Exp(λ).

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 27 / 31


CDF of Continuous RVs

Example
The transmission time X of messages in a communication system has an
exponential distribution:

P [X > x] = e−λx , x > 0.

Find the CDF and PDF of X.


Solution:
The CDF of X is FX (x) = P [X ≤ x] = 1 − P [X > x]

 1 − e−λx , x ≥ 0,
FX (x) = P (X ≤ x) =
 0, x < 0.

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 28 / 31


CDF of Continuous RVs

Example
dFX (x)
As the PDF fX (x) = dx , therefore,

 λe−λx , x ≥ 0,
fX (x) =
 0, x < 0.

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 29 / 31


CDF of Continuous RVs

Example
The lifetime in hours of a component is represented by the random
variable X whose PDF is given by fx (x) = 0.1e−0.1x for x ≥ 0 ?
(a) What is the CDF of x.
(b) What is the probability that the component will last at least 5 hours?
Solution:
(a) The CDf is
Zx Zx (
1 − e−0.1x , x ≥ 0,
−0.1u
FX (x) = fX (u)du = 0.1e du =
0, x < 0.
−∞ 0

(b) Since X is a continuous random variable, the probability that the


component will last at least 5 hours is given by
P [X ≥ 5] = P [X > 5] = 1 − P [X ≤ 5] = 1 − FX (5) = 1 − (1 − e−0.1(5) )
⇒ P [X ≥ 5] = e−0.5 = 0.6065
Dr. Babar Mansoor EEE251 Probability Methods in Engineering 30 / 31
CDF of Continuous RVs

Homework
The PDF of the time T it takes a bank teller to serve a customer is
defined by ( 1
6, 2 ≤ t ≤ 8,
fT (t) =
0, otherwise.
(a) What is the CDF of T ?
(b) What is the probability that a customer is served in less than 5
minutes? 
 0, t<2
t−2
ANS: (a) FT (t) = , 2 ≤ t < 8,
 6
1, t > 8.
(b) P [T < 5] = 0.5

Dr. Babar Mansoor EEE251 Probability Methods in Engineering 31 / 31

You might also like