Chapter 4
Probability Distributions
Random Variables
A random variable (RV) is a function that associates
( assigns) a real number with each element in the sample
space. i.e. A random variable is a mapping ( function) from the
sample space S to the set of real numbers R
X: S → R
The set of all possible values of X is called the range.
The probability of X taking a value x is P(X = x)
A random variable may take two forms: discrete or
continuous.
•If the range of the random variable X is a finite set {x1 ,x2 , …, xn} then
it is called discrete random variable.
•If the range of the random variable X is an infinite set or an interval
[a,b] then it is called continuous random variable.
•The range of X is the set of real numbers R, i.e. it may take positive,
negative or zero values
Discrete Random Variables
1) The Probability Density Function:
If a variable X takes a discrete set of values x1, x 2 ,..., x n with
respective probabilitiesnP(x1) , P(x2 ) , …, P(xn) , where
P( x i ) 1
i 1
then the real function i=1,2,…,n, is called the
probability density function (p.d.f) for the random
variable X and satisfies :
f(xi) ≥ 0 .
And we say that a discrete probability distribution for X
has been defined .
The function f (xi) = P(X = xi) is called the probability
function, probability mass function , the probability
density function or probability distribution:
f (xi) 0, i= 1, 2,.., n
Example (1): If X is the number of heads in three tosses of a
coin .Find the probability function of the random variable.
Solution :Let H , denotes a head , and T a tail of coin ,
X = the number of heads obtained , then
X=0,1,2,3.
Now, for a random sample of three tosses, the following
mutually exclusive events can occur with probabilities.
P(X = 0) =f (0) = P {(T, T, T)} = 1/8
P(X =1)=f (1) = P{ (H , T , T ), ( T , H , T ),( T , T , H )}= 3/8
P(X =2)=f (2) =P{ (H , H , T ),( H , T , H ),( T , H , H )} = 3/8
P(X = 3) =f (3) = P {(H, H, H)} = 1/8.
Therefore, the probability function is
X 0 1 2 3
P(X = x) 1/8 3/8 3/8 1/8
=f(x)
f(x)
4
3
Series 1
2
0
0 1 2 3
Graph of P(x)
Example (2): Suppose that X, the score on the uppermost face
of a loaded die has a probability function
P(x) = k x ; x = 1, 2, 3, 4, 5, 6.
(a) Find k,
(b) write P(x) in tabular form, and find the probability that
X ≥ 3.
Solution:
6
(a) Since P( x ) 1
x 1
then,
k + 2k + 3k + … + 6k = 1
so, 21k = 1
then, k =1/21 , x = 1, 2, 3,4,5,6.
Then,
P( x ) x ; x 1, 2, 3, 4, 5, 6
21
X 1 2 3 4 5 6
P(x) = P(X = x) 1/21 2/21 3/2 4/2 5/2 6/21
1 1 1
(b) P(X 3) 3 4 5 6 6
21 21 21 21 7
2- The Cumulative distribution
function ( Distribution function F)
The Cumulative distribution function, or more simply the
distribution function, F of the random variable X is defined for
any real number x by
F(x) = P(X ≤ x) =
That is , F(x) is the probability that the random variable X
takes on a value that is less than or equal to x .
Note that : We will use the notation X~ F to signify that F is
the distribution function of X .
0 x x1
F (x ) f (x 1 ) x1 x x 2
f ( x ) f ( x ) f ( x ) xn x
1 2 n
satisfying
•0 ≤ F (x) ≤ 1
•F (x) is non-decreasing
•P(a ≤ X ≤ b) = F (b) – F (a)
•F(-∞)= 0 F(∞ ) = 1
Example (3): Consider a random variable X that is equal to
1, 2, or 3. If we know that : P(1) = ½ and P(2) = 1/3
Then it follows (since P(1) + P(2) +P(3) = 1 ) that
P(3) = 1/6 .
A graph of P(x) is presented in the following figure.
Graph of P(x)
Note that : If X is a discrete random variable whose set of
possible values are x1, x2, x3,… , where x1< x2< x3<… then, its
distribution function F is a step function . That is, the value of
F is a constant in the interval [xi-1, xi) and then takes a step
(or jump) of size f (xi) at xi .
Then the cumulative distribution function F of X is given by
X 1 2 3
P(X = x)=f (x) 1/2 1/3 1/6
F(x) 1 115 1 1 1 1
2 2 3 6 2 3 6
0 x 1
1 1 x 2
2
F( x )
5
6 2 x 3
1 x3
This is graphically presented in the following figure .
Graph of F(x)
3) Mean, Variance & Standard
Deviation: .
For a discrete random variable X with domain {x1 ,x2 , …, xn}
and p.d.f f(x1), f(x2),…,f( xn) respectively,
•Mean:
Variance
.
•Standard Deviation
Mathematical Expectation
Definition : Let X be a discrete variable with the probability
distribution f(xi) = P (X = xi) , i = 1 , 2 , …, n .
The mean or expected value of X is
n
E ( X ) xi f ( xi )
i 1
Example (3): A shipment of 8 similar microcomputers to a
retail outlet contains 3 that are defective. If a school makes a
random purchase of 2 of these computers,
(a) Find the probability distribution for the number of
defectives.
(b) Find the expected value of the random variable X
Solution: Let X be a random variable whose values x are the
possible numbers of defective computers purchased by the
school. Then x = 0, 1, 2. Now
3 5
0 2 10
(a) P ( 0) P ( X 0)
8 28
2
3 5
1 1 15
P(1) P( X 1)
8 28
2
3 5
2 0
P ( 2) P ( X 2 ) 3
8 28
2
Thus , the probability distribution of X is
X 0 1 2
P(X = x) 10/2 15/28 3/28
8
(b) E(X) (0)(10 ) (1)( 15 ) (2)( 3 ) 21 3
28 28 28 28 4
Example(4): If the p.d.f of a discrete RV X is given in the table:
x -3 -1 1 3 5
f(x) a 2a 4a 3a 2a
Find the value of a then calculate the mean and variance.
Sol.: To find the value of a
→ a+2a+4a+3a+2a =1
12a =1 → a=1/12
x f(x) xf(x) x2f(x)
-3 1/12 -3/12 9/12
-1 2/12 -2/12 2/12
1 4/12 4/12 4/12
3 3/12 9/12 27/12
5 2/12 10/12 50/12
Sum 1 18/12 92/12
Properties of Expectation
1- E(a) = a ; ( a is a constant )
Proof:
E (a ) a P( x ) a P( x ) a.(1) a
x x
2- E(a X ) = a E(X) ; ( a is a constant )
Proof:
E(aX) ax P( x ) a xP( x ) a.E(X)
x x
3- E(a X +b) = a E(X) + b ; ( a , b are constants )
Proof:
E (aX b) (ax b) P( x )
x
axP(x) bP(x)
x x
a xP( x ) b P( x )
x x
aE(X) b
2
Example (4): Find E[ X 1] for example (3)
Solution:
2 2 2
E[X 1] E[X 2X 1] E[X ] 2E[X] 1
Since E[X] = 3/4
n
E[X 2 ] x i2 P( xi ) (0)2 ( 10 ) (1)2 ( 15 ) (2)2 ( 3 ) 27 0.964
28 28 28 28
i 1
Then ,
2 2
E[X 1] E[X ] 2E[X] 1
27 3 13
2( ) 1 0.464
28 4 28
Variance
Definition : Let X be a random variable with mean E[X]=μ .
The variance of X, denoted by Var(X) = σ2, is given by
2 2
Var (X) E[(X ) ]
the positive square root of the variance, σ is called the
standard deviation of X
The variance can be simplified to give a more simple formula
as follows
Var (X ) 2 E[X 2 ] (E[X ]) 2 E[X 2 ] 2
Properties of Variance
1- Var(a) = 0 ; ( a is a constant )
Proof:
Var (a ) E (a ) E (a ) a a 0
2 2 2 2
2- Var(a X ) = a2 Var(X) ; ( a is a constant )
Proof:
Var (aX) E (aX) E (aX)2
2
2 2
E a X aE( X ) 2
2 2
a E X a E ( X )2 2
a E X E ( X )
2 2 2
2
a Var ( X )
3- Var(a X +b) = a2 Var(X) ; ( a , b are constants )
Proof: Since Var ( X ) E X E ( X ) 2
Then,
Var (aX b) E(aX b) E(aX b)2
E(aX b) (aE(X) b)2
EaX b aE(X) b2
EaX aE(X) a EX E(X)
2 2 2
2
a Var (X)
Example (5): Let the random variable X represents the
number of defective parts for a machine when 3 parts are
sampled from a production line and tested. The following is
the probability distribution of X.
x 0 1 2 3
P(x) 0.51 0.38 0.10 0.01
Find
(a) E(X) (b) E(X2 )
(c) Var(X) (d) E( 2X -1)
(e) Var( 3X +1)
Solution:
(a) E(X) (0)(0.51) (1)(0.38) (2)(0.10) (3)(0.01) 0.61
(b) E(X 2 ) (0)2 (0.51) (1)2 (0.38) (2)2 (0.10) (3)2 (0.01) 0.87
(c ) Var (X) E (X 2 ) E (X)2 (0.87) (0.61)2 0.4979.
(d) E( 2X -1) = 2 E(X) – 1 = 2 (0.61 ) – 1 = 0.22.
(e) Var(3X +1) = 9 Var( X ) = 9 ( 0.4979 ) = 4. 4811.
Example (6): Three balls are randomly chosen from an urn
containing 3 white, 3 red, and 5black balls.
Suppose that we win $1for each white ball selected and
we lose $1 for each red ball selected.
Let X denotes our winnings.
(a) What are the possible values of X
(b) What are the probabilities associated with each value?
(c) Calculate E(X-1)2 and V(0.5X+1)
Solution : 11
n (S)
3
The elements of the sample space will have the form
S = { (3 white) , (2 white and 1 red) , (2 white and 1black) ,
(1 white and 2 red ), (1 white and 1 red and 1black) ,
(1 white and 2 black) , (3 red ) , (2red and 1black) ,
(1red and 2 black) ,(3black ) }
(a) we can write the values of X as
(3 white) → X = +3
(2 white and 1 red) → X = +1
(2 white and 1black) → X = +2
(1 white and 2 red ) → X =-1
(1 white and 1 red and 1black) → X = 0
(1 white and 2 black) → X = +1
(3 red ) → X = -3
(2red and 1black) → X = -2
(1red and 2 black) → X = -1
(3black ) → X = 0
Then X takes the values : X = 0, ±1, ±2, ±3
(b) We have to find the probabilities associated with each
value
P( X 0) P(1 white and 1 red and 1 black) P( 3 black)
3 3 5 5
1 1 1 3 55
P ( X 0) 11
165
3
P( X 1) P( 2 white and 1 red ) P(1 white and 2 black)
3 3 3 5
2 1 1 2
P(X 1) 11
165
39
3
P( X 2) P( 2 white and 1 black )
3 5
2 1
P( X 2) 11
15
165
3
P( X 3) P( 3 white )
3
3
P ( X 3) 11
1
165
3
P( X 1) P(1 white and 2 red ) P(1 red and 2 black)
3 3 3 5
1 2 1 2
P( X 1) 11
165
39
3
P( X 2) P( 2 red and 1 black )
3 5
2 1
P( X 2) 11
165
15
3
P( X 3) P( 3 red )
3
3
P( X 3) 11
165
1
3
Thus , the probability distribution of X is
X -3 -2 -1 0 1 2 3
P(X=x) 1/165 15/165 39/165 55/16 39/16 15/16 1/165
5 5 5
(c)
(i) E(X) (3)(165
1
) (2)(165
15
) (1)(165
39
)
55
(0)(165 ) (1)(165
39
) (2)(165
15
) (3)(165
1
)
0
(ii) E ( X 2 ) ( 3) 2 ( 1 2 15 2 39
165 ) ( 2) ( 165 ) ( 1) ( 165 )
2 55 2 39 2 15 2 1
(0) ( 165 ) (1) ( 165 ) (2) ( 165 ) (3) ( 165 )
165
216
72
55 1.31
Then we have
E (X 1) 2 E (X 2 2X 1) E (X 2 ) 2E (X) 1
1.31 1 2.31
V (X ) E (X ) E (X ) 1.31
2 2
(iii)
Then we have
2
V(0.5X 1) (0.5) V(X) 1.431 0.33