MTU Stat Dept Introduction to statistics for engineer's Chapter - 5
CHAPTER-FIVE
5. One-dimensional Random Variables
5.1 Random variable: definition and distribution function
Definitions:
Variable: is any characteristic or attribute that can assume different values.
A random variable (r.v): is a variable whose values are determined by chance.
Definition: A random variable is a numerical description of the outcomes of an experiment or a
numerical valued function defined on sample space, usually denoted by capital letters.
If X is a random variable, then it is a function from the elements of the sample space to
the set of real numbers. i.e. X is a function X: S → R
Discrete variables: are variables whose values are determined by counting.
Continuous Variables: are variables whose values are determined by measuring rather
than counting.
A probability distribution is a description of the value a random variable can assume and the
corresponding probabilities of the values. It is often displayed in a graph, table, or formula.
Notation:
Random Variables are usually denoted by X or Y.
The probability a random variable X takes on a value x i is:
P X ( X=x i )=P ( X =x i )=P ( x i ) for discrete r . v∧f X ( x )=f ( x ) for continous r . v .
A Probability Distribution, then, is a specification of P(x i ) for each x i that is an outcome of a
procedure. As mentioned before, this could be done in a graph, table, or formula.
5.2 Discrete random variables
Definition: Let X be a r.v. If the number of possible values of X is finit or countably infinit, we call X
a discrete r.v. That is, the possible values of X may be listed as x 1 , x 2 , x 3 , … , x n , … In the finite case
the list terminates and in the countably infinite case the list continues indefinitely.
5.2.1 Probability Mass Function (Discrete Probability Distribution):
Definition: If X is a discrete r . v with distinct values x 1 , x 2 ,… , x n , … , then the function p(x )defined
as:
{
p X ( x )= P ( X =x i )= pi ,if x=xi
0 , if x ≠ x i ; i=1 , 2 , 3 ,…
is called the probability mass function (pmf) of r . v . X .
By Seid A. Lecture Notes Page 1
MTU Stat Dept Introduction to statistics for engineer's Chapter - 5
The set of ordered pairs { x i , pi ; i=1 , 2, … , n , … } ∨{( x 1 , p1 ) , ( x 2 , p2 ) , … , ( x n , pn ) , … } , specifies the
probability distribution of the r . v . X .
Remarks: The numbers p ( x i ) ; i=1 , 2 , …must satisfy the following conditions:
∞
1. 0 ≤ p ( x i ) ≤1 , ∀ i∧2. ∑ p ( x i )=1.
i=1
Note: If X is discrete random variable then
b−1 b−1
P ( a< X <b ) = ∑ P ( x ) ; P ( a≤ X < b )=∑ P ( x ) ,
x=a+ 1 x=a
b b
P ( a< X ≤ b )= ∑ P ( x ) ; P ( a ≤ X ≤ b )=∑ P ( x ) .
x=a +1 x=a
Example: Consider an experiment of "flipping a fair coin 3 times". List the elements of the
sample space and let X be the number of heads in three tosses. Then find the possible values of
X and Calculate the probability of each possible distinct value of X .
Solution: X is a discrete r . v . Since X =¿ the number of heads observed, the results are shown in the
following table:
S={HHH , HHT , HTH , THH , HTT ,THT , TTH , TTT }.
Elements of sample space Probability X
HHH 1/8 3
HHT 1/8 2
HTH 1/8 2
HTT 1/8 1
THH 1/8 2
THT 1/8 1
TTH 1/8 1
TTT 1/8 0
≫ Thus , we can write X ( HHH )=3 ; X ( HHT )=X ( HTH )=X ( THH )=2 ,
X ( HTT )= X (THT )=X ( TTH )=1 ; X ( TTT ) =0.
¿ P ( X=3 )=1/8 , P ( X=2 ) =3/8 , P ( X=1 )=3 /8 , P ( X =0 ) =1/8.
Note that :The possible values of X are : x i={ 0 , 1 ,2 , 3 } .
{
x
; x =1, 2 , 3 , 4 , 5.
Example: If , p ( x ) = 15
0; otherwise .
a) Is p ( x ) is pmf? b) Find P ( X=1∨2 ) , P ( X > 2 ) , P ( 1< X ≤ 4 ) .
5
1 2 3 4 5 15
Solution: a) Yes because ∑ p ( x i )=1. i .e . + + + + = =1.
i=1 15 15 15 15 15 15
By Seid A. Lecture Notes Page 2
MTU Stat Dept Introduction to statistics for engineer's Chapter - 5
1 2 3 1
b) P ( X=1∨2 )=P ( X =1 )+ P ( X=2 )= + = = .
15 15 15 5
3 4 5 12 4
P ( X >2 ) =P ( X=3 ) + P ( X =4 ) + P ( X=5 ) = + + = = .
15 15 15 15 5
2 3 4 9 3
P ( 1< X ≤ 4 )=P ( X=2 ) + P ( X =3 ) + P ( X=4 )= + + = = .
15 15 15 15 5
Exercise: A random variable X has the following probability function.
Values of X, 0 1 2 3 4 5 6 7
x:
p(x) 0 k 2 2k 3k k2 2k2 7k2+k
k
a). Find the value of k . b). Evaluate P ( X <6 ) , P ( X ≥ 6 )∧P ( 0< X <5 ) .
Ans :a ¿ k =1/10 b ¿ P ( X < 6 )=81/100 , P ( X ≥ 6 )=19 /100∧P ( 0< X < 5 )=4/5.
5.3 Continuous random variables
A random variable X is said to be continuous if it can take all possible values (integral as well as
fractional) between a certain limits. Continuous random variable is a random variable that can be
measured to any desired degree of accuracy. For instance, the life length of an electric bulb, the speed
of a car, weights, heights, and the like are continuous.
In such cases, probabilities are associated with intervals or regions of a continuous random
variable, and not with individual points.
5.3.1 Probability Density Function (pdf)
Consider the small interval (x , x +dx ) of length dx round the point x . Let f (x) be any continuous
function of x so that f (x)dx represents the probability that X falls in the infinitesimal interval
(x , x +dx ). Sybollically, P ( x ≤ X ≤ x +dx ) =f ( x ) dx .
f ( x ) dx
y=f ( x )
x x +dx
In the figure, f ( x ) dx represents the area bounded by the curve y=f ( x ) , x -axis and ordinates at the
points x and x +dx . The function f X ( x )=f ( x ) so defined is known as probability density function (pdf)
of random variable X. The expression , f ( x ) dx , usually written as dF ( x ) , is known as probability
differential and the curve y=f ( x ) is known as the probability density curve.
By Seid A. Lecture Notes Page 3
MTU Stat Dept Introduction to statistics for engineer's Chapter - 5
Definition: The probability density function (pdf) f X ( x )=f ( x ) of the r . v . X is defined as:
P(x ≤ X ≤ x+ δx)
f X ( x )=f ( x )= lim
δx →0 δx
The probability for a variate value to lie in the interval dx is f ( x ) dx and hence the probability for a
variate value to fall in the finite interval [a , b] is:
b
P ( a ≤ X ≤b )=∫ f ( x ) dx ,
a
which represents area between the curve y=f ( x ) , x - axis and the ordinates at x=a∧x=b .
b
Further, since the total probability is unity, we have ∫ f ( x ) dx=1 , where [a , b]is the range of
a
the random variable X . The range of the variable may be finite or infinite.
The probability density function (p.d.f.) of a random variable X , usually denoted by
f X ( x )∨simply by f ( x ) has the following obvious properties:
∞
1. f ( x ) ≥ 0 , 2. ∫ f ( x ) dx=1.
−∞
Important remarks: In the case of discrete random variable, the probability at a point, i.e.,
P ( X=c ) is not zero for some fixed c. However, in case of continuous random variables the
c
probability at a point is always zero, i .e . , P ( X=c )=P ( c ≤ X ≤ c )=∫ f ( x ) dx=¿ 0 , ∀ c . ¿
c
This property of continuous r . v . , viz . , P ( X=c )=0 , ∀ c leads us to the following important result:
P ( a ≤ X ≤b )=P ( a ≤ X <b )=P ( a< X ≤ b )=P ( a< X < b ) .
i .e . , in case of continuous r . v . , it does not matter whether we include the end points of
interval from a ¿ b . However, this result is, in general, not true for discrete random variables.
Example: The diameter of an electric cable, say X , is assumed to be a continuous r . v . with pdf :
f ( x )=6 x ( 1−x ) , 0 ≤ x ≤1.
a). Check that f ( x ) is pdf . b). Compute P ( X <1/2 ) .
Solution: a). Obviously, for 0 ≤ x ≤ 1 , f ( x ) ≥ 0. Now
| |
1 1 1 2 3 1
x x
∫ f ( x ) dx=¿ 6∫ x (1−x)dx=6 ∫ (x−x ) dx=6 2 − 3 . =1. ¿
2
0 0 0
0
Hence f ( x ) is pdf .
By Seid A. Lecture Notes Page 4
MTU Stat Dept Introduction to statistics for engineer's Chapter - 5
| |
1 /2 1/ 2 1 /2 2 3
x x
b) P ( X <1/2 )=P ( 0< X <1/2 )= ∫ f ( x ) dx =¿ ∫ 6 x(1−x) dx=¿ 6 − . =0.5 . ¿ ¿
0 0 2 3
0
Exercise: Let X be a continuous random variable with pdf :
{
ax , 0≤ x <1
f ( x )= a , 1≤ x <2
−ax+3 a ,2 ≤ x<3
0 , ot h erwise
a). Determine the constant a . b). Compute P ( X ≤1.5 ) .
Ans: a) . a=1/2. b). P ( X ≤1.5 )=1/2.
5.4 Cumulative distribution function (cdf) and its properties
Definition: Let X be a random variable. The function F defined for all real x by
F ( x )=P ( X ≤ x ) ,−∞ < x <∞ ,
is called the cumulative distribution function (cdf) of the random variable X .
{
∑ pi → If X is discrete .
i : x i≤ x
F ( x )=P ( X ≤ x )=
Thus, x
∫ f ( t ) dt → If X is continuous .
−∞
Properties of cumulative distribution function
1. If F is the cdf of one-dimensional r.v. X, then ( i ) .0 ≤ F ( x ) ≤ 1 ; ( ii ) . F ( x ) ≤ F ( y ) if x< y .
In other words, all distribution functions are monotonically non-decreasing and lie between 0 and 1.
2. If F is the cdf of one-dimensional r . v . X , then
F (−∞ )= lim F ( x )=0∧F ( ∞ ) =lim F ( x )=1.
x →−∞ x→∞
3. If F is the cdf of ther . v . X∧if a ≤ b , then P ( a ≤ X ≤b )=F ( b )−F ( a ) .
Remark: When P ( X=a )=0∧P ( X =b )=0 , all four events a ≤ X ≤ b , a ≤ X < b , a< X ≤ b∧a< X < b
have the same probability F ( b )−F ( a ) .
dF (x)
Note that: F ' ( x )= =f ( x ) .∧ p ( x i )=P ( X=x i )=F ( xi ) −F ( x i−1 ) .
dx
Graphs of the discrete and continuous distribution function for the random variable X.
F(x) F(x)
By Seid A. Lecture Notes Page 5
MTU Stat Dept Introduction to statistics for engineer's Chapter - 5
x x
1 2 3 4 5 6 7
Example: Let X be a discrete random variable with pmf :
{
x
; x =1, 2 , 3 , 4 , 5.
p ( x )= 15
0; otherwise .
a) Determine F ( x ) , the cumulative distribution function (cdf) of X.
Solution: For x=0 , F ( 0 )=P ( X ≤ 0 )= ∑ pi=0.
i : x i ≤0
For x=1 , F ( 1 )=P ( X ≤ 1 )= ∑ pi= p1=1 /15.
i : x i ≤1
For x=2, F ( 2 ) =P ( X ≤ 2 )= ∑ pi= p 1+ p2 =1/15+ 2/15=3 /15.
i : x i ≤2
For x=3 , F (3 )=P ( X ≤3 )= ∑ p i= p1 + p2 + p 3=1/15+2/15+3 /15=6 /15.
i : x i≤ 3
For x=4 , F ( 4 ) =P ( X ≤ 4 )= ∑ p i= p1 + p2 + p 3+ p 4=1 /15+ 2/15+3/15+ 4/15=10/15.
i : x i ≤4
For x=5 , F ( 4 )=P ( X ≤ 5 ) = ∑ p i=p 1+ p 2+ p 3+ p 4 + p5
i: xi ≤5
¿ 1/15+2/15+3 /15+ 4 /15+5/15=15 /15=1.
Hence the cumulative distribution function F ( x ) is given by:
{
0 for−∞ ≤ x <1
1/15 for 1 ≤ x <2
F ( x )= 3/15 for 2 ≤ x <3
6 /15 for 3 ≤ x < 4
10/15 for 4 ≤ x <5
1 for 5 ≤ x <∞
Example 2: Let X be a continuous random variable with pdf :
{
(1/2) x , 0≤ x <1
1 /2 , 1≤ x <2
f ( x )= −1
2 ( ) 3
x + , 2 ≤ x <3
2
0 , ot h erwise
By Seid A. Lecture Notes Page 6
MTU Stat Dept Introduction to statistics for engineer's Chapter - 5
a) Determine F ( x ) , the cumulative distribution function (cdf) of X.
x x
Solution: For any x such that −∞ ≤ x <0 ; F ( x ) =P ( X ≤ x )= ∫ f ( t ) dt=∫ 0. dt =0.
−∞ −∞
0 x
For any x, where 0 ≤ x<1 ; F ( x )=P ( X ≤ x )=∫ 0. dt+∫ t /2 dt=x /4.
2
−∞ 0
0 1 x
tdt 1 dt 2 x−1
For x, 1 ≤ x <2 ; F ( x )=P ( X ≤ x ) =∫ 0. dt +∫ +∫ = .
−∞ 0 2 1 2 4
0 1 2 x
−∞
t
0 2
1
For x, 2 ≤ x <3 ; F ( x )=P ( X ≤ x )=∫ 0. dt+∫ dt +∫ dt+∫
1 2 2
−t 3
+ dt
2 2 ( )
( )( )
2 2
1 1 −x 3 x −x 3 x 5
¿ + 1− + + −2 = + − .
4 2 4 2 4 2 4
0 1 2 3 x
−∞
t
0 2
1
For x, 3 ≤ x < ∞ ; F ( x )=P ( X ≤ x )=∫ 0. dt+∫ dt +∫ dt+∫
1 2 2
−t 3
+ dt +∫ 0. dt
2 2 3
( )
1
( )(
1
¿ + 1− +
4 2
−9 9
+ +1−3 =1.
4 2 )
Hence the cumulative distribution function F ( x ) is given by:
{
0 for−∞ ≤ x <0
2
x
for 0 ≤ x <1
4
F ( x )= 2 x −1
for 1≤ x< 2
4
2
−x 3 x 5
+ − for 2≤ x <3
4 2 4
1 for 3 ≤ x < ∞
By Seid A. Lecture Notes Page 7