3.
ONE DIMENSIONAL RANDOM VARIABLES
3.1 Random variable: definition and distribution function
3.2 Discrete random variables
3.3 Continuous random variables
3.4 Cumulative distribution function and its properties
3.1 Random Variable
Introduction
The theory of probability distributions is widely used in both natural and social sciences. For that
matter, the concept of random variables and distributions is the backbone of statistics.
Particularly, the area of inferential statistics is entirely dependent on this concept. In
estimation and hypotheses testing, we extensively use some commonly known distributions.
Definition: Let E be an experiment and S be a sample space associated with the experiment. A
function X that assigns to every element ∈ , a real number, ( ), is called a random
[Link] set of all possible values of the random variable X is called the range space.
Moreover, the domain of the random variable X is S.
Random variables are real valued functions that transform each sample point of a sample space to
real numbers. Hence, random variables serve as links between outcomes of a random experiment and
real numbers. Their significance can be seen from the fact that it is theoretically easier to deal
with numbers than outcomes.
A random variable, X, is a function that assigns a single, but variable, value to each element
of a sample space.
A random variable, X, provides a means of assigning numerical values to experimental
outcomes.
A random variable, X, is a numerical description of the outcomes of the experiment or a
numerical valued function defined on sample space, usually denoted by capital letters.
Page 1 of 11
Example 1: Consider the different possible orderings of boy (B) and girl (G) in four sequential
births. There are 2*2*2*2= 16 possibilities, so the sample space is:
BBBB GGBB BGBB GBBB
BBBG BGBG GBBG GGBG
BBGB BGGB GBGB GGGB
BBGG BGGG GBGG GGGG
If girl and boy are each equally likely [P(G) = P(B) = 1/2], and the gender of each child is
independent of that of the previous child, then the probability of each of these 16 possibilities is:
(1/2)(1/2)(1/2)(1/2) = 1/16.
Now count the number of girls in each set of four sequential births:
BBBB (0) GGBB (2) BGBB (1) GBBB (1)
BBBG (1) BGBG (2) GBBG (2) GGBG (3)
BBGB (1) BGGB (2) GBGB (2) GGGB (3)
BBGG (2) BGGG (3) GBGG (3) GGGG (4)
Notice that:
each possible outcome is assigned a single numeric value,
all outcomes are assigned numeric values, and
the value assigned varies across the outcomes.
The count of the number of girls is a random variable:
Page 2 of 11
Where RX is the range space of X and S is the sample space.
Example 2: Consider the experiment of tossing of a fair coin once.
The sample space is S= {H, T} where H denotes the outcome ‘Head’ and T denotes the outcome
‘Tail’. So, there are two possible outcomes H or T.
Now, let the random variable X represents the outcome `Head’, then X can take the value 0 or 1.
Example 3: Suppose a single fair die is rolled once.
The sample space of this experiment constitutes six possible outcomes, S = {1, 2, 3, 4, 5, 6}
Let the random variable X denotes the event: "anumber greater than 2 occurs’. Then the
random variable can assume the values 3, 4, 5 or 6.
Probability Distribution
The probability distribution for a random variable describes how the probabilities are distributed
over the values of the random variable.
Page 3 of 11
Types of Random Variables
Depending upon the numerical values it can assume, a random variable can be classified into two
major divisions.
Discrete Random Variable and
Continuous Random Variable
3.2. Discrete Random Variable
Definition: Let X be a random variable. If the number of possible values of X (i.e. Rx) is finite
or countably infinite, then we call X as a discrete random variable. That is, the possible values of
X may be listed as , ,…, , … In the finite case, the list terminates and in the countably
infinite case the list continues indefinitely.
Examples:
• Toss a coin times and count the number of heads.
• Number of children in a family.
• Number of car accidents per week.
• Number of defective items in a given company.
• Number of bacteria per two cubic centimeter of water.
Probability Distribution of Discrete Random Variable
Definition:: Let X be a discrete random variable. Hence, RX consists of at most a countably
infinite number of values, , , … with each possible outcome we associate a number
( ) = ( = ) called the probability of .The probabilities ( ) for = 1,2,3, . . . , , . ..
must satisfy the following two conditions:
I. ( ) ≥ 0 for all ,
II. ∑ ( )=1
The function p defined above is called the probability function (or point probability
function) of the random variable X. Furthermore, the tabular arrangement of all possible
values of X with their corresponding probability is called probability distribution of X.
Example 1: Construct a probability distribution for the number of heads in tossing of a fair coin
two times.
Page 4 of 11
Solution: The sample space of the experiment contains the following:
S = {HH, HT, TH, TT}
Let the random variable X denotes the ‘number of heads’. We then use the probability function
P(X) to assign probability to each outcome consequently; the probability distribution is given
below:
0 1 2
( ) 1/4 1/2 1/4
Notes:
a) Suppose that the discrete random variable X may assume only a finite number of values,
say , ,…, . If each outcome is equally probable, then we obviously have ( ) =
( )=⋯= ( )= .
b) If X assumes a countably infinite number of values, then it is impossible to have all
outcomes equally probable. For we cannot possibly satisfy the condition ∑ P(x ) = 1
if we must have ( ) = c for all .
c) In every finite interval, there will be at most a finite number of possible values of X. if
some such interval contains none of these possible values, we assign a probability zero to
it. That is, if ={ , ,…, } and if no ∈ [a, b], then ( ≤ ≤ ) = 0.
3.3. Continuous Random Variable
Definition: A random variable X is said to be a continuous random variable if it assumes all
values in some interval (c,d), where c and d are real numbers.
Examples:
• Height of students at a certain college.
• Mark of a student.
• Life time of light bulbs.
• Length of time required to complete a given training.
Page 5 of 11
Probability density function ( ) of continuous random variable
Probability Density Function (pdf) of Continuous Random Variables
A random variable X is said to be a continuous random variable if there exists a function ,
called the probability density function (pdf) of X, satisfying the following conditions:
a) ( ) ≥ 0 for all
b) ∫ ( ) =1
c) For any ℎ−∞< < < ∞, ℎ ( ≤ ≤ )=∫ ( )
Remark:
a. P(a≤x≤b) represents the area under the graph ( or curve) of the P.d.f of f between a and b.
b. It is a consequence of the above description of X that for any specified value of X, say X0,
x0
we have p(X=X0)=0, since P(X=X0)= f ( x) dx 0
x0
We must realize, however, that if we allow X to assume all t he values in so me interval, then the
zero value of the probabilit y does not imply that the event is impossible. That is, zero probabilit y
does not necessarily imply impossibilit y. Hence, in the cont inuous case P(A)=0 does not imply
A=. In view o f this fact, the fo llowing probabilit ies are all the same if X is a cont inuous rando m
variable.
P(c≤X≤d)= P(c≤Xd)= P(c<X≤d)= P(c<X<d)
Caution: The above property can never be extended to the case of discrete random variables.
Example 1: Let X be a continuous random variable with probabilit y densit y function (P.d.f)
2 x if 0 x 1
f ( x)
0 otherwise
a) Verify that f is a P.d.f b) find P(0.5<x<0.75)
Page 6 of 11
Solution
a) A funct ion f is a P.d.f iff the fo llowing two condit ions are satisfied
i) f(x)0 and ii) f ( x) dx 1
In our case, it is easily observable that f (x) 0 because 2x is a positive number for all x
between 0 and [Link], for other values of x the given funct ion assumes the value 0.
Hence the first condit ion is satisfied. We can also show the second condit ion as under.
0 1 0 1
f ( x) dx f ( x)dx f ( x)dx f(x)dx 0dx 2 xdx 0dx 0 1 0 1
0 1 0 1
Therefore, we can conclude that the given funct ion is a P.d.f.
0.75
2
0.75 9 1 5
b) P (0.5<x<0.75)= 2 xdx x
0.5
0.5
16 4 16
3x 2 if 0 x 1
Example 2: Suppose that X is a continuous random variable wit h P.d.f f ( x )
0 otherwise
a) Verify that f is a P.d.f b) P(X>1/3) c) P(1/4 x 2/3)
Conditional Probability in the Case of Continuous Random Variables
Recall that for the case of discrete random variables the conditional probabilit y is given by
P( A B)
P( A / B)
P( B)
The same formulat ion ho lds true for the case of cont inuous random variables except that A and B
take range of values (intervals) rather than discrete values.
Example: The diameter of an electric cable is assumed to be a cont inuous rando m variable, sa y
6 x(1 x) if 0 x 1
X, with P.d.f f ( x)
0 otherwise
1 1 2
Compute P x x
2 3 3
Page 7 of 11
3.4 Cumulative distribution function and its properties
Definition (Cumulative Distribution Function) Let X be a rando m variable (discrete or
continuous). The funct ion F that is defined as
F(x) = P[Xx]
is called the cumulat ive distribution function (Cdf) of the rando m variable X.
Notation: Cumulative distribut ion funct ion is usually denoted by upper case alphabets.
Theorems
1. If X is a discrete rando m variable, then
F ( x ) p( x j ) for all x j x
j
2. If X is a continuous rando m variable, then
x
F ( x) f ( s)ds
Example 1: Let S={H,T} and X: the number of heads.
Clearly, X is a discrete random variable. Since P(x=0)=1/2=P(x=1), we have
0 if X 0
F (x ) 1 / 2 if 0 x 1
1 if x 1
Example 2: Suppose that a rando m variable X assumes the six values 1, 2, 3, 4, 5, 6 with
probabilit y 1/6. Then,
0 if X 1
1 / 6 if 1 x 2
2/6 if 2 x 3
F ( x ) 3/6 if 3 x 4
4/6 if 4x5
5/6 if 5x6
1 if x6
Page 8 of 11
Example 3: Find the cdf o f the rando m variable X whose P.d.f is given by
x if 0 x 1
f ( x ) 2 x if 1 x 2
0 Otherwise
Solution:
x 0 1 2
F(x) P( X x ) f (t )dt f (t )dt f (t )dt f (t )dt f (t )dt
0 1 2
Case 1: For x0
x x
F(x) f (t )dt 0dt 0
Case 2: For 0 x 1
x 0 x x x
t2 x2
F(x) P ( X x) f (t )dt f (t )dt f (t )dt 0 tdt
0 0
2 0
2
Case 3: For 1 x 2
x 0 1 x 1 x
t2
F(x) P ( X x) f (t )dt f (t )dt f (t )dt f (t )dt 0 2 x
0 1
2 0 1
x
1 x2 x2
2x 2x 1
2 2 1 2
Case 4: For x>2
x 0 1 2 x
F(x) P( X x) f (t )dt f (t )dt f (t )dt f (t )dt f (t )dt
0 1 2
2
2 1 x
t x2 1 3
0 2 x 0dt 2 0 1
2 0 2 1 2 2 2
Therefore, the cdf o f X beco mes,
Page 9 of 11
0 if x 0
2
x if 0 x 1
F ( x) 2 2
2x - x - 1 if 1 x 2
2
1 if x 2
Exercises:
e -x if x 0
1. Find the cdf of a rando m variable X whose P.d.f is given by f ( x)
0 Otherwise
2. Determine the cdf of the rando m variable X with P.d.f
1
2 x if 0 x 1
1 if 1 x 2
f ( x) 2
1 3
- x if 2 x 3
2 2
0 Otherwise
Properties of Cumulative Distribution Function (cdf) F
a) The funct ion F is a non-decreasing funct ion,
b) lim F ( x) 0 and lim F ( x ) 1
x x
Theorem
d
If X is a cont inuous random variable, then we have f ( x) F ( x) . On the other hand, if X is a
dx
discrete random variable, then we have P ( x j ) F ( x j ) F ( x j 1 ) .
Proof
Case 1: X is a continuous rando m variable
x
F ( x) f (t )dt
x
d d
F ( x) f (t )dt f ( x) .......by the fundamenta l theorem of calculus
dx dx
Case 2: X is a discrete random variable
Page 10 of 11
F ( x j ) P ( x x j ) P ( x1 ) P ( x 2 ) ... P ( x j 1 ) P ( x j )
F ( x j 1 ) P ( x x j 1 ) P ( x1 ) P ( x 2 ) ... P( x j 2 ) P ( x j 1 )
F ( x j ) F ( x j 1 ) P ( x j ) f ( x)
Remark: P(a X b)=F(b)-F(a)
Example: Suppose X is a continuous rando m variable with cdf
0 if x 0
F ( x) -x
1 - e if x 0
Find the P.d.f of X.
Page 11 of 11