03 Random Variable & Mathematical Exectation
03 Random Variable & Mathematical Exectation
&
MATHEMATICAL EXPECTATION
Dr. M. Musa Khan
Associate Professor
DEB, IIUC
Random Variable
A variable whose values are determined by the outcomes of a random
experiment is called random variable.
In other words, a random variable is a function that assigns a real number
to each sample point in a sample space.
We shall use capital letters, such as X, Y , Z etc. to denote random variables
and the corresponding small letters x, y, z to denote any specific value of a
random variable. Like variable, there are two types of random variable.
They are
i) Discrete random variable and
ii) Continuous random variable.
It is seen that the number of heads equals to 1 has probability 1/2. The
different values of X with the probabilities will be as follows:
Values of X : x 0 1 2 Total
p(x) 1/4 1/2 1/4 1
Here it is seen that the value of p(x) is greater than 0 and the sum of p(x) is
1. Here p(x) is the probability that X takes value x. That is P [X = x] = p (x).
It is seen that (i) p (x)>0 and (ii) Σ p (x) = 1.
The set of ordered pairs (x, p (x)) is called probability function or probability
mass function. It is also called probability distribution.
Usually discrete random variable takes integer value. But sometimes it can
take fractional isolated values too.
Probability function, probability mass function or probability
distribution. The probability function of a discrete random variable can be
shown in a table or by a formula.
A table or a formula by which the different values of a random variable
with their associated probabilities are shown is called discrete probability
distribution. Table 1 is an example of a probability distribution.
Let X be a random variable which can take values x1, x2, ........, xn with
associate probabilities p(x1), p(x2), ......., p(xn), then the probability function
of X can be defined by the following table:
Table 1. Discrete probability distribution
Variable X : x x1 x2 …….. xn
p(x) p(x1) p(x2) ………. p(xn)
Probability function of a random variable X can also be expressed by a
formula. Suppose X is a discrete random variable, then the probability
function of X may be defined by the formula
x 4−x
4 1 3
p(x) = ; x =1, 2, 3, 4.
x 4 4
2
Definition. The set of ordered pairs (x, p(x)) is called probability function,
probability mass function or probability distribution of the discrete random
variable X , if for each value of x
i) p(x) ≥ 0,
ii) Σp(x) = 1 and
iii) P [X= x] = p (x).
Example 2. Suppose that three items are selected at random from a
manufacturing process. Each item is inspected and classified as defective D,
or non-defective N. Let X denotes the number of defective items. Suppose
the probability of a defective item is 0.02. (i) Find the probability function of
X. Also compute, (ii) P [X > 2], (iii) P [X ≥ 2] and (iv) P [X = 2].
Solution. (i) The sample space of the experiment is
S = {NNN, NND, NDN, DNN, NDD, DND, DDN, DDD}
Here P [D] = 0.02, then P [N] = 1- P[D] = 1- 0.02 = 0.98 .
It is easily seen that the possible values of X are 0, 1, 2, 3
P [NNN] = P [X=0] = P (0) = P [N] P [N] P [N]
= (0.98) (0.98) (0.98) = 0.941192.
P [NND] = P [NDN]= P [DNN] = P [X=1] = p (1)
=P [N] P [N] P [D] = (0.98) (0.98) (0.02) = 0.19208
P [NDD] = P [DND] = P [DDN] = P [X=2] = p (2)
= P [N] P [D] P [D] = (0.98) (0.02) (0.02) = 0.000392
P [DDD] = P [X=3] = p (3) =P [D] P [D] P [D]
= (0.02) (0.02) (0.02) = 0.000008.
The probability function of X is
Values of X: x 0 1 2 3
p(x) 0.941192 0.057624 0.001176 0.000008
(i) Find the probability function of sizes of the shoes sold by the
departmental store. Compute the probability of the sizes of the shoes sold
by the shop (ii) more than 7, (iii) less then 6, (iv) between 6 and 8.
Solution. (i) Here the sizes of the shoes may be considered as a random
variable X. The possible values of X are 5, 5.5, 6, 6.5, 7, 7.5, 8, 8.5, 9 and their
relative frequencies are 0.025, 0.030, 0.095, 0.105, 0.155, 0.210, 0.170, 0.125,
and 0.085. The relative frequencies for the different sizes of the shoes are
considered as their respective probabilities. Then the possible values of X
and their probabilities constitute the probability distribution of X and is
given by the following table:
Table 3. Probability distribution of the sizes of the shoes
Sizes of Shoes X : x 5 5.5 6 6.5 7 7.5 8 8.5 9
p(x) 0.025 0.030 0.095 0.105 0.155 0.210 0.170 0.125 0.085
6
1
2
f(x) dx = 1 kx dx = 1
− 0
x3 1 k
k = 1 = 1
3 0 3
Hence k = 3
0 .5 x 3 0.5
2
(ii) P [0.2 ≤ X ≤ 0.5] = 3x dx = 3 = (0.5)3 – (0.2)3
0 .2
3 0.2
= 0.125 – 0.008 = 0.117.
0 .3 x 3 0.3
2
(iii) P [X<0.3] = 3x dx = 3 = (0.3)3 = 0.027.
0
3 0
0.5 x 3 0.5
2
(iv) P [0.25<X<0.5] = 3x dx = 3 = (0.5)3 – (0.25)3
0.25
3 0.25
= 0.125 – 0.016 = 0.109.
1 x3 1
2
(v) P [X>0.75] = 3x dx = 3 = (1)3 – (0.75)3 = 1 – 0.423 = 0.578.
0.75
3 0.75
3 x x
2 2 3 2
3
3 /2
2
(ii) P [X > 1.5] = (2x - x ) dx = 2 −
4 4 2 3 3 / 2
3 8 9 27 3 96 − 64 − 54 + 27 3 5 5
= 4 − − + = = = .
4 3 4 24 4 24 4 24 32
3 x x
3 /2 2 3 2 /3
3
1 /2
2
(iii) P [0.5 < X < 1.5] = (2x - x ) dx = 2 −
4 4 2 3 1 / 2
3 4 8 1 1 3 96 − 64 − 54 + 27 3 89 89
= − − + = = = .
4 9 81 4 24 4 24 4 648 864
8
1. The expected value of a constant c is constant, i,e, E(c) = c for every
constant c
2. The expected value of the product of a constant c and a random variable
X is equal to c times the expected value of the random variable,
i,e, E(cX) = c E(X)
3. The expected value of a linear function of a random variable X is same
as the linear function of its expectation i,e, E(a + bX) = a + b E(X)
4. The variance of the linear function of a random variable X is equal to the
constant squared times the variance of the random variable X, i,e,
Var(a + bX) = b2 Var(X)
Example 9. A fair coin is tossed twice. Then the number of heads is a
random variable that takes values 0, 1 and 2 with the following probability
function:
Values of X : x 0 1 2 Total
p(x) 1/4 1/2 1/4 1
10
Probability p(x) 0.02 0.07 0.09 0.12 k 0.2 0.18 0.02
2
Here E [X2] = x f(x) dx .
−
Example 14. Suppose that in a certain region of a country the daily rainfall
(in inches) is a continuous random variable X with probability density
3
function f(x) given by f(x) = (2x – x2), 0< x < 2. Find the expected daily
4
rainfall (in inches) in that region. Also find variance and standard deviation.
Solution. The expected daily rainfall is
2
µ = E [X] = x f(x) dx
0
3 x x
2 3 4 2
3 3 16 16 3 4
0 x 4 (2x - x
2
= ) dx = 2 − = − = =1.
4 3 4 0 4 3 4 4 3
This means, on an average the daily rainfall of that region is one inch.
Variance = 2 = E [X – µ]2 = E [X2] – µ2
3 2 2
2
E [X2] = x (2x - x ) dx
4 0
3 x x
4 5 2
3 32 32 3 32 6
= 2 − = − = = = 1.2
4 4 5 0 4 4 5 4 20 5
.
Exercise
1. The probability function of a discrete random variable X is as follows:
X:x -5 -3 -1 1 3 5
p(x) a 2a 3a 4a 5a 6a
(i) Find the value of a, (ii) Find P [X = 1], (iii) P[-1<X< 3], (iv) P[ - 1 ≤ X
≤ 3], (v) P[X > - 1], (vi) P[X ≥ 4], (vii) P[X ≤ 1].
2. Let X be a discrete random variable with the following probability
function
Values of X : x 0 1 2 3 4
p(x) 0.12 0.18 k 0.30 0.16
(i) Find the value of k, Compute (ii) P [X>3], (iii) P [1<X<4],
(iv) P [X<1].
12
3. Let X be a random variable with probability function given below;
x 0 1 2 3
p(x) 1/6 1/2 3/10 1/30
Find P [X ≤ 1]; P [X < 1] and P [0, X, 2].
4. A continuous random variable X has the following probability
distribution: f(x) = kx2 ; 0 ≤ x ≤ 1. (i) Find the value of k, (ii) Calculate
the probability that X lies between 0. 2 and 0.5, (iii) X less than 0.3, (iv)
1/4 <X<1/2 .
5. Find mean, variance and standard deviation of the following
probability function:
Values of X : x 0 1 2 3
p(x) 1/8 3/8 3/8 1/8
7. The annual premium for a Tk. 5000 insurance policy against the theft of
a painting is Tk.150. If the probability that the painting will be stolen during
the year is .01, what is your expected return from the insurance company if
you take out this insurance?
Pay off table
X:x 4850 –150
p(x) 0.01 0.99 ; E(X)= Tk.100
Application
1. A company has five applicants for two positions: two women and three
men. Suppose that the five applicants are equally qualified and that no
preference is given for choosing either gender. Let X equal the number
of women chosen to fill the two positions (i) Find the probability
function of X. (ii) What is the probability that exactly 1 woman will be
chosen? (iii) Also find the probability that at least one woman will be
chosen.
Ans. p(0)= 3/10; p(1)=6/10; p(2)= 1/10. (ii) 6/10; (iii) 7/10.
2. Past experience has shown that, on the average, only one in ten wells
drilled hits oil. Let X be the number of drillings until the first success.
Assume that the drillings represent independent event. (i) Find p(1) ;
p(2) ; p(3); (ii) Give a formula for p(x).
5. Mr. Rahman just has bought a VCR from Jalani’s Videotape Service at a
cost of $300. He now has the option of buying an extended service
warranty offering 5years of coverage for $100. After taking to friends
and reading reports, Mr. Rahman believes the following maintenance
could be incurred during the next five years
Expense (x) 0 50 100 150 200 250 300
p(x) 0.35 0.25 0.15 0.10 0.08 0.05 0.02
Find the expected value of the anticipated maintenance costs. Should
Mr. Rahman pay $100 for the warranty?
14