Lecture # 38
INTRODUCTION
Suppose S is the sample space of some experiment. The outcomes of the
experiment, or the points in S, need not be numbers. For example in tossing
a coin the outcomes are H (heads) or T(tails), and in tossing a pair of dice
the outcomes are pairs of integers. However, we frequently wish to assign a
specific number to each outcome of the experiment. For example, in coin
tossing, it may be convenient to assign 1 to H and 0 to T; or in the tossing of
a pair of dice, we may want to assign the sum of the two integers to the
outcome. Such an assignment of numerical values is called a random
variable.
RANDOM VARIABLE
A random variable X is a rule that assigns a numerical value to each
outcome in a sample Space S.
We shall let X(S) denote the set of numbers assigned by a random variable
X, and refer to X(S) as the range space.
In formal terminology, X is a function from S to the set of real numbers R,
and X(S) is the range of X.
REMARK
1. A random variable is also called a chance variable, or a
stochastic variable.
2. Random variables are usually denoted by capital letters such as
X, Y, Z and the values taken by them are represented by the
corresponding small letters.
1
RANDOM VARIABLE
A random variable X is a rule that assigns a numerical value to each
outcome in a sample Space S.
We shall let X(S) denote the set of numbers assigned by a random variable
X, and refer to X(S) as the range space.
In formal terminology, X is a function from S to the set of real numbers R,
and X(S) is the range of X.
REMARK
1.A random variable is also called a chance variable, or a
stochastic variable.
[Link] variables are usually denoted by capital letters such as
X, Y, Z and the values taken by them are represented by the corresponding
small letters.
EXAMPLE
A pair of fair dice is tossed. The sample space S consists of the 36 ordered
pairs
S = {(1,1), (1,2), (1,3), …, (6,6)}
Let X assign to each point in S the sum of the numbers; then X is a random
variable with range space
X(S) = {2,3,4,5,6,7,8,9,10,11,12}
Let Y assign to each point in S the maximum of the two numbers; then Y is
a random variable with range space.
Y(S) = {1,2,3,4,5,6}
2
PROBABILITY DISTRIBUTION OF A RANDOM VARIABLE
Let X(S) = {x1, x2, …, xn} be the range space of a random variable X
defined on a finite sample space S. Define a function f on X(S) as follows:
f(xi) = P (X = xi) = sum of probabilities of points in S
whose image is xi.
This function f is called the probability distribution or the probability
function of X.
The probability distribution f of X is usually given in the form of a table.
x1 x2 … xn
f(x1) f(x2) … f(xn)
The distribution f satisfies the conditions.
n
(i ) f ( xi ) 0 and (ii ) f ( x ) 1
i 1
i
EXAMPLE
A pair of fair dice is tossed. Let X assign to each point (a, b) in
S = {(1,1), (1,2), …, (6,6)}, the sum of its number, i.e., X (a,b) = a+b.
Compute the distribution f of X.
SOLUTION
X is clearly a random variable with range space
X(S) = {2,3,4,5,6,7,8,9,10, 11, 12}
The distribution f of X may be computed as:
1
f(2) = P (X=2)=P({(1,1)})
36=
2
f(3) = P(X=3) = P({(1,2), (2,1)})
36 =
3 3
f(4) = P(X=4) = P({(1,3), (2,2),(3,1)}) =
36
4
f(5) = P(X=5) = P({(1,4), (2,3),(3,2),(4,1)}) =
36
5
f (6) P( X 6) P({(1,5), (2,4), (3,3), (4,2), (5,1)})
36
6
f (7) P ( X 7) P ({(1,6), (2,5), (3,4), (4,3), (5,2), (6,2)})
36
5
f (8) P( X 8) P ({( 2,6), (3,5), (4,4), (5,3), (6,2)})
36
4
f (9) P ( X 9) P ({(3,6), (4,5), (5,4), (6,3)})
36
3
f (10) P ( X 10) P ({( 4,6), (5,5), (6,4)})
36
2
f (11) P ( X 11) P ({(5,6), (6,5)})
36
1
f (12) P ( X 12) P ({(6,6)})
36
The distribution of X consists of the points in X(S) with their respective
probabilities.
xi 2 3 4 5 6 7
f(xi) 1/36 2/36 3/36 4/36 5/36 6/36
xi 8 9 10 11 12
f (xi) 5/36 4/36 3/36 2/36 1/36
4
EXAMPLE
A box contains 12 items of which three are defective. A sample of three
items is selected from the box. If X denotes the number of defective items in
the sample; find the distribution of X.
SOLUTION
12
The sample space S consists of 220
3
different samples of size 3.
The random variable X, denoting the number of defective items has the
range space
X(S) = {0,1,2,3}
9
There are samples
84 of size 3 with no defective items. Hence
3
84
p0 P ( X 0)
220
3 9
There are 108 of size 3 containing one
samples
1
2
defective item. Hence probability of getting one defective item is
108
.
p1 P ( X 1)
220
3 9
There are samples
27 of size 3 containing two
2
1
defective items. Hence
27
p2 P ( X 2)
220
Finally, there is only one sample of size 3 containing three
defective items. Hence :
1 5
p3 P ( X 3)
220
Hence Distribution Table is
xi 0 1 2 3
pi 84/220 108/220 27/220 1/220
EXPECTATION OF A
RANDOM VARIABLE
Let X be a random variable with probability distribution
xi x1 x2 x3 … xn
f (xi) f(x1) f(x2) f(x3) … f(xn)
The mean (denoted ) or the expectation of X (written E(X)) is defined by
= E(X) = x1 f(x1) + x2 f(x2) + … + xnf(xn)
n
xi f ( xi )
i 1
EXERCISE
What is the expectation of the number of heads when three fair coins are
tossed?
SOLUTION
The sample space of the experiment is:
S = {TTT, TTH, THT, HTT, THH, HTH, HHT, HHH}
Let the random variable X represents the number of heads when three fair
coins are tossed. Then X has the probability distribution.
6
xi 0 1 2 3
f(xi) 1/8 3/8 3/8 1/8
Hence, expectation of X is
1 3 3 1 12
E ( X ) 0 1 2 3 15
8 8 8 8 8
EXERCISE
A player tosses two fair coins. He wins Rs. 1 if one head appears, Rs.2 if
two heads appear. On the other hand, he loses Rs.5 if no heads appear.
Determine the expected value E of the game and if it is favourable to be
player.
SOLUTION
The sample space of the experiment is
S = {HH, HT, TH, TT}
Now P (Two heads) P ( HH ) 1 1 1
2 2 4
1 1 1 1 1
P (One head) P ( HT , TH )
2 2 2 2 2
1 1 1
P (No heads) P (TT )
2 2 4
1 1
Thus, the probability of winning Rs.2 is , of winning Rs 1 is and of
1 4 2
losing Rs 5 is .
4
Hence, 1 1 1
E 2 1 5
4 2 4
1
0.25
4
Since, the expected value of the game is negative, so it is unfavorable to the
player. 7
EXAMPLE
3 1
A coin is weighted so that P ( H ) P (T )
and . The coin is
4 4
tossed three times. Let X denotes the number of heads that appear.
(a) Find the distribution of X
(b) Find the expectation of E(X)
SOLUTION
(a) The sample space is
S = {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}
The probabilities of the points in sample space are
3 3 3 27 3 3 1 9
p ( HHH ) p ( HHT )
4 4 4 64 4 4 4 64
3 1 3 9 1 3 3 9
p ( HTH ) p (THH )
4 4 4 64 4 4 4 64
3 1 1 3 1 3 1 3
p ( HTT ) p (THT )
4 4 4 64 4 4 4 64
1 1 3 3 1 1 1 1
p (TTH ) p (TTT )
4 4 4 64 4 4 4 64
The random variable X denoting the number of heads assumes the values
0,1,2,3 with the probabilities:
1
P (0) P (TTT )
64
3 3 3 9
P (1) P ( HTT , THT , TTH )
64 64 64 64
9 9 9 27
P (2) P ( HHT , HTH , THH )
64 64 64 64
27
P (3) P ( HHH ) 8
64
Hence, the distribution of X is
xi 0 1 2 3
P(xi) 1/64 9/64 27/64 27/64
(b) The expected value E(X) is obtained by multiplying each
value of X by its probability and taking the sum.
The distribution of X is
xi 0 1 2 3
P(xi) 1/64 9/64 27/64 27/64
Hence
1 9 27 27
E ( X ) 0 1 2 3
64 64 64 64
144
64
2 25
VARIANCE AND STANDARD DEVIATION
OF A RANDOM VARIABLE
Let X be a random variable with mean and the probability distribution
x1 x2 x3 … xn
f(x1) f(x2) f(x3) … f(xn)
The variance of X, measures the “spread” or “dispersion” of X from the
mean and is denoted and defined as
n
Var ( X ) ( xi ) 2 f ( xi )
2
x
i 1
E (( X ) 2 )
E ( X 2 ) 2 9
xi2 f ( xi ) 2
The last expression is a more convenient form for computing Var(X).
The standard derivation of X, denoted by X , is the non-negative square
root of Var(X):
X Var ( X )
EXERCISE
Find the expectation , variance 2 and standard deviation of the
distribution
xi 1 3 4 5
f(xi) 0.4 0.1 0.2 0.3
SOLUTION
= E(X) = xi f(xi)
= 1(0.4) + 3(0.1) + 4(0.2) + 5(0.3)
= 0.4 + 0.3 + 0.8 + 1.5
= 3.0
Next
E(X2) = xi2 f(xi) = 12 (0.4) + 32 (0.1) + 42 (0.2) + 52 (0.3)
= 0.4 + 0.9 + 3.2 + 7.5
= 12.0
Hence
2 = Var(X) = E(X2) - 2
= 12.0 - (3.0)2 = 3.0
and
Var ( X ) 3.0 1.7
10
EXERCISE
A pair of fair dice is thrown. Let X denote the maximum of the two numbers
which appears.
(a) Find the distribution of X
(b) Find the, variance x2 = Var(X), and standard deviation x of X
SOLUTION
(a) The sample space S is the equiprobable space consisting of the
36 pairs of integers (a,b) where a and b range from 1 to 6; that is
S = {(1,1), (1,2), …, (6,6)}
Since X assigns to each pair in S the larger of the two integers, the value of
X are the integers from 1 to 6.
Note that:
1
f (1) P ( X 1) P ({(1,1)})
36
3
f (2) P ( X 2) P ({( 2,1), (2,2), (1,2)})
36
5
f (3) P ( X 3) P ({(3,1), (3,2), (3,3), (2,3), (1,3)})
36
7
f (4) P ( X 4) P ({( 4,1), (4,2), (4,3), (4,4), (3,4), (2,4), (1,4)})
36
Similarly
9 11
f (5) P ( X 5) and f (6) P ( X 6)
36 36
Hence, the probability distribution of x is:
xi 1 2 3 4 5 6
f(xi) 1/36 3/36 5/36 7/36 9/36 11/36
11
(b) We find the expectation (mean) of X as
E ( X ) xi f ( xi )
1 1 5 7 9 11
1 2 3 4 5 6
36 36 36 36 36 36
161
4.5
36
Next
E ( X 2 ) xi2 f ( xi )
1 1 1 7 9 11
12 22 32 42 52 62
36 36 36 36 36 36
791
22.0
36
Then
x2 Var( X ) E ( X 2 ) 2
22.0 (4.5) 2
17.5
and
x 1.75 1.3
12