15
2. Probability Distributions
2.1. Random Variables, Expected Values and Variance
Definition (random variable): A random variable is a numerical description
of the outcome of an experiment.
There are two common types of random variables. They are:
Discrete random variable: a quantity assumes either a finite number of
values or an infinite sequence of values, such as 0, 1, 2,
Continuous random variable: a quantity assumes any numerical value in an
interval or collection of intervals, such as time, weight, distance, and
temperature.
Definition (probability distribution (or density) function (p.d.f)): a
function describes how probabilities are distributed over the values of the
random variable.
Required conditions for a discrete probability distribution function:
Let a1 , a 2 ,, a n , be all the possible values of the discrete random variable X.
Then, the required conditions for
f (x )
to be the discrete probability
distribution for X are
(a) P X ai f (ai ) 0, for every i.
(b)
f a f a f a f a 1
i 1
i
1
2
n
Required conditions for a continuous probability density:
Let the continuous random variable Z taking values in subsets of , .
Then, the required conditions for f (x) to be the continuous probability density
function for Z are
(a)
f ( x) 0, x .
(b)
f ( x )dx 1
Note: As X is discrete,
P(c X d )
f a .
cai d
15
i
16
As X is continuous,
d
P (c X d )
f ( x)dx.
c
Expected Value and Variance:
As X is discrete,
E ( X ) ai f ai a1 f ( a1 ) a2 f ( a2 ) an f (an )
i 1
and
Var ( X ) 2 E X E ( X ) (ai ) 2 f (ai )
2
i
(a1 ) f (a1 ) (a2 ) f (a2 ) (an ) 2 f (an )
2
2
As X is continuous,
E( X )
xf ( x) dx
and
Var ( X ) 2 E X E ( X )
2
( x u)
2
f ( x) dx
Important Properties of Expected Value and Variance:
a, b are constants and X is discrete or continuous.
1.
Var X E X 2 2 .
2. EaX b aE X b .
3. Var aX b a 2Var X
Example 1:
The probability distribution functions (discrete random variable) or probability
density functions (continuous random variable) for a random variable X are
(a)
c exp 6 x , x 0
f ( x ) cx, 1 x 0
0, otherwise
16
17
(b)
f x cx 2 exp x 3 , x 0
(c)
x
1
f x c , x 0, 1, 2,
3
Find c .
[solution:]
(a)
cx 2
c exp 6 x
cxdx
c
exp
6
x
dx
1
1
0
1
2
6
0
1
c c
3c c
3
1
1 c
2 6
6
2
0
0
(b)
c exp x 3
1
3
3
cx
exp
x
dx
1
c
exp
x
dx
1
1
0
0 3
3
0
c
1 c 3
3
2
3
(c)
x
1
1 1 2
1
1 3c 1
c 1 c 1 1 c
2
1 1
x 0 3
3 3
3
c
2
3
Example 2:
The probability distribution function for a discrete random variable X is
f ( x ) 2k , x 10
k , x 20
k 0.2, x 30
0, otherwise
where k is some constant. Please find
(a) k (b) P( X 15 or X 40 ) (c) E X and Var X (d) E5 X 2
(e) Var 3 X 7
17
18
[solution:]
(a)
f ( x) f (10) f (20) f (30) 2k k k 0.2 1
x
k 0.3 .
(b) P( X 15 or X 40) P( X 10 or X 20 or X 30) 1 .
(c)
u E ( X ) xf ( x) 10 f (10) 20 f (20) 30 f (30)
x
10 0.6 20 0.3 30 0.1 15
and
E ( X 2 ) x 2 f ( x) 10 2 f 10 20 2 f 20 30 2 f 30
x
100 0.6 400 0.3 900 0.1 270
Var X E X 2 2 270 225 45
(d) E5 X 2 5E X 2 5 15 2 77.
(e) Var (3 X 7) 32 Var X 9 45 405 .
Example 3:
Let X be a discrete random variable representing the number of hours
a college student spending on reading novels per week. The following
probability distribution has been proposed.
i3
f i
, i 1, 2, 3 ,
9c
where k is some constant.
(a) Compute c. (b) Compute P X 1.2 and P X 2.2 .
(c) Compute E X a nd Var X .
[solution:]
(a)
f (i) f (1) f (2) f (3)
i
13 23 33 36 4
1
9c 9c 9c 9c c
c 4.
(b) P ( X 1.2) P ( X 1) f 1
1
1
.and
9 4 36
P( X 2.2) P( X 3) f 3
(c)
18
33
27
.
9 4 36
19
u E ( X ) if (i ) 1 f (1) 2 f (2) 3 f (3)
i
1
1
8
27 98 49
2
3
36
36
36 36 18
and
E ( X 2 ) i 2 f (i ) 12 f 1 2 2 f 2 32 f 3
i
1
1
8
27 276 46
4
9
36
36
36
36
6
Var X E X 2 2
2
46 49
0.2561
6 18
Example 4:
The probability density function for a continuous random variable X is
f ( x ) a bx 2 , 0 x 1
0, otherwise.
where a, b are some constants. Please find
(a) a, b if E ( X )
3
(b) Var( X ) .
5
[solution:]
(a)
a bx dx 1
1
1
f ( x)dx 1
2
0
ax
0
a
b 3 1
x |0 1
3
b
1
3
and
1
1
0
0
E ( X ) xf ( x)dx x a bx 2 dx
Solve for the two equations, we have a
a 2 b 4 1 a b 3
x x |0
2
4
2 4 5
3
6
.
, b
5
5
(b)
f ( x)
3
6
x2 , 0 x 1
5
5
0, otherwise.
Thus,
19
20
Var ( X ) E X E ( X ) E ( X ) E ( X )
2
2
2
3
E( X )
5
2
9
3 6 2
x dx
25
5 5
0
1
6 5 1
9
1
6
9
2
x3
x |0
5
25
25 5 25 25 25
1
1
9
x f ( x) dx
25
0
x
2
2
Example 5:
The probability density function for a continuous random variable X is
x 2
,2 x 4
f ( x ) 18
0, otherwise
Please find (a) P X 1 (b) P X 2 9 (c) E X and Var X
(d) E 9 X 2 8 X 2 (e) Var6 X 8 .
[solution:]
1
x2 x
x2
1 1 1 1 2
P X 1 P 1 X 1
dx
18
36 9 1 36 9 36 9 9
1
1
(a)
(b)
P X 2 9 P 3 X 3
x2
3 18 dx
3
2
0dx
3
3
x2 x
x2
25
2 18 dx 36 9 36
2
3
(c)
4
EX
2
x 2 dx
x
18
4
x2 x
x3 x2
18 9 dx 54 18 2 .
2
2
4
Since
x
4
E X
2
2
2
x 2 dx
18
4
x3 x2
x4 x3
18 9 dx 72 27 6 ,
2
2
4
Var X E X E X 2 2 6 2 2 2 .
2
(d) E 9 X 2 8 X 2 9E X 2 8E X 2 9 6 8 2 2 72 .
(e) Var 6 X 8 6 2 Var X 36 2 72
20
2
21
Definition (cumulative distribution function (c.d.f)): F x P X x.
Important Properties of CDF:
1. CDF is right continuous.
2. As X is discrete, F x
f a ;
ai x
i
As X is continuous and f is continuous, f x F ' x .
Example 2 (continuous):
The probability distribution function for a discrete random variable X is
f ( x ) 0.6, x 10
0.3, x 20
0.1, x 30
0, otherwise
Thus, the CDF is
F ( x ) 0, x 10
0.6, 10 x 20
0.3, 20 x 30
1, x 30
Example 1 (a):
The probability distribution functions (discrete random variable) or probability
density functions (continuous random variable) for a random variable X are
3
2 exp 6 x , x 0
3
f ( x)
x, 1 x 0
2
0, otherwise
Thus, as 1 x 0 ,
x
3x 2
3x
3
2
F x
dx
1 x
2
4 1 4
1
x
as 0 x ,
3x
3
3 3 exp 6 x
3 1
F x
dx exp 6 x dx
1 exp 6 x .
2
2
4 2
6
0 4 4
1
0
x
x
x
21
22
Thus, the CDF is
F ( x ) 0, x 1
3
1 x2 , 1 x 0
4
3
1
1 exp 6 x , 0 x
4
4
22