Professional Documents
Culture Documents
(FIST)
PSM 0325
Introduction to Probability and Statistics
ONLINE NOTES
Topic 3
Random Variables
TOPIC 3
RANDOM VARIABLES
Reference:
Introduction to Probability and Statistics, Assliza Salim. et al.,Pearson. 2011
Objectives:
1. To understand the concept of discrete and continuous random variables.
2. To find the probability, mean and variance of random variable X.
3. To construct cumulative distribution.
Contents:
1. Introduction
2. Random Variables and Probability Functions
3. Expected Value and Variance
4. Continuous Random Variables
3.1 INTRODUCTION
This chapter forms a bridge between the study of probability and the application of
probability theory to the field of statistics. One such topic is the values (or costs)
which are sometimes associated with the outcomes of experiments. A common
problem in such situations, a problem which occurs frequently in decision making, is
to find an average value to associate with an experiment. To solve such problems we
use the concepts of random variable, mean, and standard deviation. The normal
random variable, which occurs in many statistical applications, will be introduced and
studied, as will the binomial random variable. We conclude the chapter by studying
the close relationship between the normal random variable and the binomial random
variable.
For a given sample space S of some experiment, a random variable is a function that
assigns a number to each outcome in S. It is a function from S to the set of real numbers
.
__________________________________________________________________________________
1/ 6
PSM0325 Introduction to Probability and Statistics Topic 3
Example 1
Consider the experiment of flipping a coin three times.
There are 8 possible outcomes of the experiment;
The sample space S = {HHH , HHT ,HTH , HTT ,THH ,TTT ,THT ,TTH }.
If X : S is the random variable that denotes the number of tails that appear in three flips
of a fair coin, what are the possible values of X?
Let Y be the random variable that denotes the number of heads that appear in three flips of a
fair coin.
Random Variable X Y
Value of Random Variable 0, 1, 2, 3 0, 1, 2, 3
Continuous Random Variable - a random variable that can assume any value
contained in one or more intervals.
- eg: the height of student, the time taken to
complete the examination.
Random variables are usually represented by uppercase letters such as X and Y. The
values of the random variables X will be denoted by the lowercase letters x 1, x2, …,
xk. Following convention, we will list these values in increasing order: x 1 < x2 < …<
xk. Also, in most problems we will specify a random variable by using table in which
each row corresponds to a single value of the random variable.
__________________________________________________________________________________
2/ 6
PSM0325 Introduction to Probability and Statistics Topic 3
We note that since the events Ei are always a partition of the sample space S,
p1 + p2 + … + pk = 1
Example 2
Consider a game in which you roll two fair dice, and you note the sum of the numbers
on top. You win $3 if the sum is 7 and $4 if the sum is 11.You will lose $1 if the sum
is anything other than 7 or 11. Let X be the random variable which assigns to each
play of the game the amount you win or lose. Find the probability density function of
this random variable. Hence, construct the probability distribution table.
Solution:
The random variable X takes the values (in dollars) -1, 3, and 4, and so we set x 1 = -1,
x2 = 3, x3 = 4. The associated events E1, E2, and E3 are defined by
The probabilities of these events are obtained by using the methods of Chapter 3. The
dice are fair, so all 36 outcomes are equally likely. Also, n(E 1) = 28, n(E2) = 6, and
n(E3) = 2. Thus, we have
The random variable X and its density function are shown in Table 5.3. Note that p 1 +
p2 + p3 = 7/9 + 1/6 + 1/18 = 1
Event E1 E2 E3
Value of X -1 3 4
Probability 7/9 1/6 1/18
__________________________________________________________________________________
3/ 6
PSM0325 Introduction to Probability and Statistics Topic 3
Let X be a random variable with values x1, x2, …, xk. Also, let p1 = Pr[X = xi]
for i = 1, 2, …, k. The expected value of X, E[X], is defined to be
The probabilities pi are given by the probability density function for the random
variable X. Thus a necessary step in determining the expected value of X is to find
the density function of X.
Example 3:
The sale table for compact discs at Tone Down Sounds has 3 premium labels and 5
discount specials. On sale each premium label disc sells for $10 and each discount special
sells for $6. Two discs are selected at random. A random variable X is defined to be the
total cost of the discs selected. Find the expected value of the random variable X.
Solution:
In this first example, however, we apply the formula directly to emphasize the meaning
of each term in the formula. We first determine the values assumed by X. If 2 discount
specials are selected, then the cost in dollars is $12; if 1 discount special is selected along
with 1 premium label, then the cost is $16; and is 2 premium labels are selected, then the
cost is $20. Thus we set x1 = 12, x2 = 16, and x3 = 20. We determine the density function
of X to be
C(5,2 ) (5 4 ) / (1 2 ) 20
p1 Pr[ X x1 ]
C(8,2 ) (8 7 ) / (1 2 ) 56
C(5,1)C( 31, ) (5 / 1)( 3 / 1) 30
p 2 Pr[ X x 2 ]
C(8,2 ) (8 7 ) / (1 2) 56
C(3, 2) (3 2) / (1 2) 6
p3 Pr[ X x 3 ]
C(8,2) (8 7) / (1 2) 56
In terms of the original setting, the expected value of the cost of the discs selected is
$15.
__________________________________________________________________________________
4/ 6
PSM0325 Introduction to Probability and Statistics Topic 3
Example 4:
A friend invites you to play the following game: 2 coins are to be selected at random
from 6 coins: 2 nickels, 3 dimes, and 1 quarter. If the sum of the values of the coins is
10, 20, or 30 cents, your friend pays you 25 cents. Otherwise you must pay your
friend the value of the coins. What is your expected gain per play of the game?
Solution:
Let N, D, and Q denote nickel, dime, and quarter, respectively. Since the order in
which the coins are drawn is unimportant, the sample space of the experiment can be
represented as {DQ, DN, DD, NQ, NN}. The gain to you is -35 cents for DQ, -15
cents for DN, and +25 cents for the other three outcomes. Let X denote the random
variable which assigns to each outcome its value to you in cents.
You should expect to lose 3 cents to your friend on each play game.
The expected value (or mean) of a random variable X is a number which gives a
precise meaning to the vague concept of the "average size of X". (There are other
numbers which one might associate with an average size, such as the median and the
mode, but we do not consider them in this book). In addition to such an average, it is
frequently helpful to know how the values of X are distributed about the mean, that
is, how the values are "spread out".
Var[X] (3.4)
Equation (5.4) simply says that once we have the variance of X we obtain the
standard deviation by taking the positive square root of the variance.
__________________________________________________________________________________
5/ 6
PSM0325 Introduction to Probability and Statistics Topic 3
A continuous random variable has a probability of zero of assuming exactly any of its
values. P( X a) 0
Expected value of X
Let X be a random variable with probability distribution function f(x). The mean or
expected value of X is
E ( X ) xf ( x )dx
if X is continuous random variable.
Variance of X
Let X be a random variable with probability distribution function f(x) and mean, . The
variance of X is
2 E ( X ) 2 ( x ) 2 f ( x)dx
E ( X 2 ) ( E ( X )) 2 [Shortcut formula]
where
E ( X ) xf ( x )dx
E ( X 2 ) x 2 f ( x )dx
__________________________________________________________________________________
6/ 6