Randome Variables Notes
Randome Variables Notes
Randome Variables Notes
2.1.1 Definition
Let S be a sample space of an event. Let us assign numbers to elementary events in the sample
space. Let X stands for numerical values of the elementary events.
X is said to be a random variable because it can take on different values and the particular value
it takes on depends on the outcome of the random experiment.
So we can now define a random variable as a numerical variable whose value is determined by
the outcome of a random experiment.
Notation
1, 4 and 5 8 X X X = s s s are example of events and hence have probabilities.
Their probabilities are j j j 1 , 4 and P 5 8 P X P X X = s s s .
We read:
- The probability that the random variable X takes on the value 1
- The probability that the random variable X takes on the values less than or equal to 4
- The probability that the random variable X takes on the values between 5 and 8
inclusive
Examples
1. Consider the random experiment of tossing an unbiased coin three times. If the random
variable X of interest is the number of heads that occur.
(a)List all possible values that X can take on.
(b) Find the following probabilities:
(i) j 0 P X =
(ii) j 1 P X =
(iii) j 3 P X =
2. Consider the random experiment of rolling a die. . If the random variable X of interest is
the label of the face turned up.
(a)List all possible values that X can take on.
(b) Find the following probabilities:
(i) j 0 P X =
(ii) j 1 P X =
(iii) j 3 P X =
(iv) j P X is an even number
3 . A car salesperson is scheduled to see two clients today. She sells only two models of car,
an executive ( ) E and a basic ( ) B model. Each executive model sold earns the
salesperson a commission of N$ 20 0 0 , while each basic model sold earns her only
N$10 0 0 . If the sale is lost ( ) L , no commission is earned. Suppose ( ) 0 .2 P E = ,
( ) 0 .3 P B = , and ( ) 0 .5 P L = , and that the sales are independent of each other. Let the
random variable X be the total commission earned by the salesperson today.
(a) What values can X take on?
(b) Find the probability of each value.
2.1.2 Classification of random variables
The flow chart below gives a summary of variables classification.
3
4
5
From the above chart, it can be noted that random variables are divided into two categories,
namely Qualitative and Quantitative random variables. The later will be the focus of this course.
The quantitative random variables are also subdivided into two groups: Discrete and Continuous
random variables.
Types of variables
Qualitative
Quantitative
Discrete
Continuous
e.g
- Brand of PC
- Marital status,
- hair color
- Children in a family
- Strikes in a golf hole
- TV sets owned
- Amount of income
tax paid
- Weight of a student
- Yearly rainfall in
Tampa,FL
(a) Discrete random variable (d.r.v)
A discrete random variable takes on isolates values along the real line, usually integer.
However, discrete random variables with values that are not integers do also exist!
Examples:
- Number of customers entering a store between 12:0 0 and 14:0 0
- Number of students who drop out every year
- Number of clients visited by a salesperson
(b) Continuous random variable (c.r.v)
Continuous random variables are random variables that can be measured to any degree of
accuracy. This means that between every two possible value
1
x and
2
x there exists another
possible value
3
x .
Examples:
- Distance travelled by a car on one litre of petrol
- Time that a customer waits in the queue at fast food outlet
- Direction of a wind at midday measured in degrees.
2.2.3 Probability mass functions (p.m.fs) and probability density functions (p.d.fs )
We can use probability mass functions to describe mathematically discrete random variables
whereas continuous random variables are modeled using probability density functions.
(a) Probability mass functions
A function ( ) p x is called a probability mass function if it satisfies the following
conditions:
- ( ) p x is defined for all values of x , but ( ) 0 p x = only at finite or countable
infinite set of points.
- All values of ( ) p x lie in the unit j 0 ,1 i.e. 0 ( ) 1 p x s s
- ( ) 1 p x =
=
}
Examples
1. Show that
( ) 4 0 0 .25
0
f x x
otherwise
= s s
=
is a probability density function
2. In a certain risk sector of share market, the proportion of companies that survive
(i.e. not deleted) a year is continuous random variable lying in the interval from
zero to one. A statistician examines the data collected over past years and
suggests that the function
3
( ) 20 (1- ) 0 1
0
f x x x x
otherwise
= s s
=
might be useful in modeling X , the annual proportion of companies that survives.
(a) Check that ( ) f x is a probability density function.
(b) What is the probability that between 3 0 % and 50 % of the companies survive a
year?
(c) What is the probability that less than 10 % of companies survive a year?
2.2.4 Mean , Variance, and coefficient of variation of random variables
1. Mean
(a) Let X be a discrete random variable with probability mass function ( ) ( ) p x P X x = =
The mean of X , sometimes called the expectation, or expected value, is given by
( ) ( )
x
x
E X xp x
=
=
=
=
=
=
}
Example:
Suppose the random variable X has a probability density function
( ) 6 (1 ) 0 1
0
f x x x x
otherwise
= s s
=
Find the mean value of X
2. Variance
(a) Let X be a discrete random variable with probability mass function ( ) ( ) p x P X x = =
The variance of X , is given by
2 2
2
2
( ) ( )
x
x
x
V X x p x
=
=
=
Or
2
2
2
( ) ( ) ( )
x
x
x
V X x p x
=
=
=
=
}
If X is discrete, then
( ) ( )
t x
F x p t
s
=
Notes:
For X is continuous:
( ) ( ) F x f x ' = ie the first derivative of the cumulative distribution function is the probability
density function.
The distribution function gives an expression that can be directly used to compute probabilities.
Examples:
1. Find the cumulative distribution function of a random variable that follows the mass
function given by:
4
4
( ) 0 .5 0 ,1, 2, 3 , 4
0
x
p x x
elsewhere
| |
= =
|
\ .
=
Solution
, )
, )
, )
, )
, )
, )
4
4
0
4
4
1
4
4
2
4
4
3
4
4
4
( ) :
0 0 .5
0 .0 625
1 0 .5
0 .25
2 0 .5
0 .3 75
3 0 .5
0 .25
4 0 .5
0 .0 625
0 0
0 .0 625 0 1
F x
p
p
p
p
p
F x x
x
| |
=
|
\ .
=
| |
=
|
\ .
=
| |
=
|
\ .
=
| |
=
|
\ .
=
| |
=
|
\ .
=
= <
= s <
0 .3 125 1 2
0 .6875 2 3
0 .93 75 3 4
1 4
x
x
x
x
= s <
= s <
= s <
= >
2. Find the cumulative distribution function for the exponentially distributed random
variable
(i.e.
, ) 0
0
x
f x e x
elsewhere
= >
=
)
3 .
Find the distribution functions of random variables having the following probability
density/mass functions:
(a)
, )
4
4-
0 .4 0 .6 0 ,1, 2, 3 , 4
0
x x
x
p x x
otherwise
| |
= =
|
\ .
=
(b)
, )
1
3 8
5
0
f x x
otherwise
= < <
=
(c)
, )
1
1
0
f x x e
x
otherwise
= s s
=
(d)
, )
3
3 -
0 .2 0 .8 0 ,1, 2, 3
0
x x
x
p x x
otherwise
| |
= =
|
\ .
=
2.2.6 Median of a random variable
A cumulative distribution function enables us to define the median of a random variable.
Let X be a random variable with a cumulative distribution function , ) F x . Then the median of
X , denoted
m
x , satisfies the equation
, ) 0
0
x
f x e x
elsewhere
= >
=
, )
1
2
m
F x =
If X is continuous, the median is clearly the value
m
x such that
, )
1
2
m
x
f x dx
=
}
If X is discrete, , ) F x is a step function and the median is taken to be the lowest value of X for
which , )
1
2
F x >
Examples
Find the medians of random variables having the following probability density/mass functions:
(a)
, )
4
4-
0 .4 0 .6 0 ,1, 2, 3 , 4
0
x x
x
p x x
otherwise
| |
= =
|
\ .
=
(b)
, )
1
3 8
5
0
f x x
otherwise
= < <
=
2.2.7 Percentile of a random variable
Let X be a continuous random variable with probability density function ( ) f x and the
cumulative distribution function , ) F x . Let p be any number between 0 and 10 0 , the
th
p
percentile is the point
p
x that satisfies the equation , )
10 0
p
x
p
f x dx
=
}
Find the 60
th
percentile of random variable X with a probability density function
, ) 0
0
x
f x e x
elsewhere
= >
=