Vous êtes sur la page 1sur 66

CHAPTER IV

DISCRETE RANDOM VARIABLES

DISCRETE PROBABILITY DISTRIBUTIONS
DISCRETE RANDOM VARIABLES
• Illustrative Example:
• Consider the experiment of tossing a coin 3
times. It is known that the sample space is
• S = {HHH, HHT, HTH, THH, HTT, THT, TTH, TTT}
• Define X = the number of heads appeared
• The possible values of X are 0, 1, 2, 3.
• X is called a discrete random variable

Statistics Department - Faculty of Science

2
King Abdulaziz University
DISCRETE RANDOM VARIABLES
• Remarks:
• The discrete random variable X is a real-valued
function defined on the sample space S, such
that it assigns to each sample point in S, a real
number r in R.
• The function X is multi – valued.
• The values of the function X are discrete.
• X is random because its values are related to
the outcomes of a random experiment
Statistics Department - Faculty of Science
3
King Abdulaziz University
DISCRETE RANDOM VARIABLES
Examples of random variables

(1) The number of boys in a randomly chosen

family of a certain community
(2) The number of traffic accidents at a certain
time and in a certain point on a given road
(3) The number of smokers in a randomly
selected sample from a group of adults
Statistics Department - Faculty of Science
4
King Abdulaziz University
DISCRETE RANDOM VARIABLES
(4) The number of misprints in a given book
(5) The number of errors in a randomly selected
computer program
(6) The height of a person of a certain age
(7) The weight of a person of a certain age
(8) The temperature of a living sick man
(9) The air pressure at different heights

Statistics Department - Faculty of Science

5
King Abdulaziz University
DISCRETE RANDOM VARIABLES
• Based on the number and nature of values,
the random variables are classified into:
(i) Discrete random variables
(ii) Continuous random variables
• The discrete random variables assumes
values X = x1 , x2 , x3 , …
• The continuous random variables assumes
values: x > a, x <b, a < x < b
Statistics Department - Faculty of Science
6
King Abdulaziz University
Discrete Random Variables
• For a discrete random variables X we define:
• The Probability Mass Function (PMF), as
f (x) = P (X = x)
such that
(i) f (x) ≥ 0 for every value of X
(ii) i 1 f (x i )  i 1 P (X  x i ) 1
n n

(iii) P (X = k) = f (k)

Statistics Department - Faculty of Science

Dr. Mahmoud Abd Almo'men Atallah 7
King Abdulaziz University
Discrete Random Variables
• Example (1)
• Consider the PMF of the discrete r. v. X
f (x) = P (X = x) = k (5 x + 7) for x = 0, 1, 3, 4
Find the value of the constant k.
• Solution. X 0 1 3 4

f (x) 7k 12 k 22 k 27 k

Statistics Department - Faculty of Science

8
King Abdulaziz University
Discrete Random Variables
• Example (2)
The discrete r. v. X has the following PMF
f (x) = P (X = x) = k 5Px , x = 1, 3, 5
Find the value of the constant k
• Solution
X 1 3 5
f (x) 5P k 5P k 5P k
1 3 5

5k 60 k 120 k

• 5k + 60k + 120k = 1 => 185k = 1 = > k = 1/185

Statistics Department - Faculty of Science
9
King Abdulaziz University
Discrete Random Variables
• Example (3)
The discrete r. v. X has the following PMF
f (x) = P (X = x) = k 5Cx , x = 1, 2, 3, 4
Find the value of the constant k
Solution. X 1 2 3 4

f (x) 5C k 5C k 5C k 5C k
1 2 3 4

Statistics Department - Faculty of Science

10
King Abdulaziz University
Discrete Random Variables
• Example (4)
The discrete r. v. X has the following PMF
f (x) = P (X = x) = k 5Cx 8C 4 – x , x = 1, 2, 3, 4
Find the value of the constant k
Solution Form the table
X 1 2 3 4

f (x) 5C 8C k 5C 8 C k 5C 8C k 5C 8C k
1 3 2 2 3 1 4 0

• k [280 + 280 + 80 + 5 ] = 645 k = 1 => k = 1/645

Statistics Department - Faculty of Science
11
King Abdulaziz University
Discrete Random Variables
Expectation of the discrete r. v. X
(Expected value, Mean value, Mean)

  E (X )   x P (X  x )   x f (x )
all x all x

The expected value of the r. v. X determines the

value about which the values of X tend to
accumulate.

Statistics Department - Faculty of Science

12
King Abdulaziz University
Discrete Random Variables
Properties of E ( ) :
(1) E(X) can be positive, negative, or zero
(2) For a constant k: E(k) = k
(3) For any constants a and b:
E (a X + b) = a E(X) + b
(4) For the r. v. g (X):
E [ g (X )]   g (x ) f (x )
all x

Statistics Department - Faculty of Science

13
King Abdulaziz University
Discrete Random Variables
Higher moments of X

• The r-th non-central moment of the discrete

random variable X is denoted by

r  E (X r )   x r P (X  x )  x r f (x ), r  1, 2, 3,
x x

Statistics Department - Faculty of Science

14
King Abdulaziz University
Discrete Random Variables
• Example (5) Consider the probability
distribution
X 1 2 3 4
f (x) 1/6 1/3 1/3 1/6

• E(X)= 2.5
• E(X2 ) = 7.17
• E(5X + 2) = 5 E(X) + 2 = 5*2.5 + 2 = 14.5

Statistics Department - Faculty of Science

15
King Abdulaziz University
Discrete Random Variables
• E(2X2 + 5) = 2 E(X2 ) + 5 = 19.34
• E(3 X2 + 4 X +5) = 3 E(X2 ) + 4 E(X) + 5
= 36.51
• E[(4 X + 3)2 ] = E [16 X2 + 24 X + 9]
= 16 E(X2 ) + 24 E(X) + 9
= 183.72

Statistics Department - Faculty of Science

16
King Abdulaziz University
Discrete Random Variables
Variance of a random variable X
• It measures the degree of scatter (measured
in squared units of X) of the values of X about
its mean µ.
• It is denoted by Var (X) or σ2 and defined by

Statistics Department - Faculty of Science

17
King Abdulaziz University
Discrete Random Variables
Properties of the variance
(1) Var (X) ≥ 0
(2) Var (k) = 0, k is a constant
(3) Var (k X) = k2 Var (X), k is a constant
(4) Var (a X + b) = a2 Var (X), a & b are constants

Statistics Department - Faculty of Science

18
King Abdulaziz University
Discrete Random Variables
The standard deviation of X

• It measures the degree of scatter of the values

of X (measured in the same units as X) about
its mean µ.
• It is denoted by σ and defined as
   V ar (X )

Statistics Department - Faculty of Science

19
King Abdulaziz University
Discrete Random Variables
• Example (6)
• For the probability distribution
X 1 2 3 4
f (x) 1/6 1/3 1/3 1/6

X  0.92  0.96

Statistics Department - Faculty of Science

20
King Abdulaziz University
Discrete Random Variables
• It follows that
• Var (2 X + 3) = 4 * 0.92 = 3.68
• Var (3 X – 5) = 9 * 0.92 = 8.28
• Var (4 X) = 16 * 0.92 = 14.72

 2 X  3  Var (2X  3)  3.68  1.92

Statistics Department - Faculty of Science

21
King Abdulaziz University
Discrete Random Variables
Cumulative Distribution Function of X
• It is denoted by F (x) and defined as follows:
F (x )  P (X  x )   P (X  u )  f (u )
u x u x

• Some properties of F(x) :

(1) F(- ∞) = 0, F(+ ∞) = 1
(2) 0 ≤ F(x) ≤ 1

Statistics Department - Faculty of Science

22
King Abdulaziz University
Discrete Random Variables
(3) F(x) is a stepwise function
(4) F(x) is a nondecreasing function of X, i.e.
x < y => F(x) ≤ F(y)
(5) F(x) is continuous from the right, i.e.
F(a) = F(a + )

Statistics Department - Faculty of Science

23
King Abdulaziz University
Discrete Random Variables
Example (7)
Find the cumulative distribution function for
X 0 3 5
f (x) 0.25 0.5 0.25

Solution
X x <0 0≤x<3 3≤x<5 x≥5
F (x) 0 0.25 0.75 1

Statistics Department - Faculty of Science

24
King Abdulaziz University
Discrete Random Variables
The Probability Generating Function
• It is denoted by GX (t) and defined by
G X (t )  E (t X )  t x P (X  x )  t x f (x )
x x
• Such that
(1) G X (1)  1
(2) E (X )  G  (1), E [X (X  1)]  G  (1)
X X

X (1)  G 
X (1)  G  2
X (1)

Statistics Department - Faculty of Science

25
King Abdulaziz University
Discrete Random Variables
• Example (8) The PGF of the distribution of the r. v. X
is given by
4 6 4 1
G (t )  t  t2  t  t
15 15 15 15

• Find the value of E (X), E[X(X-1)], and Var (X).

• Solution
mean  E ( X )  G X (1)  2.133

Statistics Department - Faculty of Science

26
King Abdulaziz University
Discrete Random Variables
• Remark. The PMF f(x) can be determined from the
given PGF. We have
4 6 4 1
G (t )  t  t2  t  t
15 15 15 15

obtained PMF.

Statistics Department - Faculty of Science

27
King Abdulaziz University
Discrete Random Variables
• Example (9) The PGF of the distribution of the r. v. X
is given by
4 6 2 4 1
G (t )  t  t  t  t
15 15 15 15

• Find the probability mass function of X.

• Solution

X 1 2 3 4
f(x) 4/15 6/15 4/15 1/15

Statistics Department - Faculty of Science

28
King Abdulaziz University
Discrete Random Variables
• Example (10) The PGF of the distribution of the r. v. X
is given by
G (t )  0.08  0.14 t  0.20 t 2  0.26 t 3  0.32 t 4

• Solution

mean  E (X )  G X (1)  2.60 E [X (X  1)]  G X (1)  5.80

  
var iance  G X (1)  G X (1)  G X (1)  1.64
2

Statistics Department - Faculty of Science

29
King Abdulaziz University
Discrete Random Variables
• Example (11) The PGF of the distribution of the r. v. X
is given by

• Find the probability mass function of X.

• Solution
X 0 1 2 3 4
f (x) 0.08 0.14 0.20 0.26 0.32

Statistics Department - Faculty of Science

30
King Abdulaziz University
Discrete Random Variables
• Example (12) The PGF of the distribution of
the r. v. X is given by:
0.65t
G (t ) 
1  0.35 t

• Find the value of E (X), E[X(X-1)], and Var (X).

• Solution
mean  E (X )  G X (1)  1.538 E [X (X  1)]  G X (1)  1.657

Statistics Department - Faculty of Science

31
King Abdulaziz University
Discrete Random Variables
• Example (13) The PGF of the distribution of the r. v. X
is given by:
G (t )   0.25  0.75t 
5

• Find the value of E (X), E[X(X-1)], and Var (X).

• Solution
mean  E ( X )  G X (1)  3.75 E [X (X  1)]  G X (1)  11.25

Statistics Department - Faculty of Science

32
King Abdulaziz University
Discrete Random Variables
• Example (14) The PGF of the distribution of
the r. v. X is given by:
G (t )  e 5 (t  1)
• Find the value of E (X), E[X(X-1)], and Var (X).
• Solution
mean  E ( X )  G X (1)  5 E [ X ( X  1)]  G X (1)  25

Statistics Department - Faculty of Science

33
King Abdulaziz University
Discrete Random Variables
The Moment Generating Function

• It is denoted by MX (t) and defined by

M X (t )  E (e t X )   e t x P (X  x )   e t x f (x )
x x

• Such that

(1) MX (0) = 1

Statistics Department - Faculty of Science

34
King Abdulaziz University
Discrete Random Variables
Example (15)
Find the moment generating function, given that
X 1 3 5
f (x) 0.25 0.5 0.25

Solution
M X (t )   e t x f (x )  0.25e 1t  0.5 e 3t  0.25 e 5 t
x

Statistics Department - Faculty of Science

35
King Abdulaziz University
Discrete Random Variables
• Example (16)
• The MGF of the r. v. X is given by
M X (t )  0.125  0.375e 1t  0.375e 2t  0.125e 3t

• Solution
X 0 1 2 3

Statistics Department - Faculty of Science

36
King Abdulaziz University
Discrete Random Variables
1. Bernoulli distribution
Definition “Bernoulli trial”
It is a random experiment, whose outcomes is
either:
(a) “A = success” with probability p, 0<p<1, or
(b) “not A = failure” with probability 1 – p = q
Examples :
(i) Tossing a coin once and looking for “Head”
(ii) Rolling a die and looking for “face 1”
Statistics Department - Faculty of Science
37
King Abdulaziz University
Discrete Random Variables
Now let X denote the number of successes in
one Bernoulli trial.
The possible values of X are 0, 1.
It is clear that X is a discrete r. v. with
P(X = 1) = P(success) = p
P(X = 0) = P(failure) = q
Such that p + q = 1.

Statistics Department - Faculty of Science

38
King Abdulaziz University
Discrete Random Variables
The probability mass function (PMF) of X is
x 1 x
f (x )  P (X  x )  p q , x  0, 1, 0  p , q  1, p  q  1

This is called the Bernoulli distribution with

parameter p.
This is referred to simply, as
X  Ber ( p )

Statistics Department - Faculty of Science

39
King Abdulaziz University
Discrete Random Variables
Characteristics of Bernoulli distribution
(a) Mean E(X) = p
(b) Variance Var(X) = p q
(c) Standard deviation   p q
(d) The moment generating function
M X (t )  E [e t x ]  q  p e t

Statistics Department - Faculty of Science

40
King Abdulaziz University
Discrete Random Variables
Example (17): Let X ~ Ber (0.85).
This means that X has Bernoulli distribution
with p = 0.85.
f(x) = P(X = x) = (0,85)x (0.15)1 – x x = 0, 1
(a) Mean E(X) = 0.85
(b) Variance Var(X) = (0.85)(0.15) = 0.1275
(c) Standard deviation   0.1275  0.357
(d) MGF M X (t )  E [e t x ]  0.15  0.85e t

Statistics Department - Faculty of Science

41
King Abdulaziz University
Discrete Random Variables
2. Binomial distribution
Consider of n Bernoulli trials such that:
(1) The outcome of each trial is
(i) success with probability p, or
(ii) failure with probability 1 – p = q
(2) The probability p of success is constant, i.e. it
doesn’t change from trial to trial.
(3) The trials are independent.

Statistics Department - Faculty of Science

42
King Abdulaziz University
Discrete Random Variables
Let X be a r. v. denoting the number of successes in
these n trials
The possible values of X are X = 0, 1, 2, …, n
It is clear that X is a discrete r. v.
The probability mass function of X is
n
f (x )  P (X  x )    p x q n  x , x  0,1, 2,..., n
x 

This is called binomial distribution with parameters

n and p. We write X  Bin (n , p )
Statistics Department - Faculty of Science
43
King Abdulaziz University
Discrete Random Variables
Characteristics of binomial distribution

(a) Mean = E(X) = n p

(b) Variance = Var(X) = n p q
(c) Standard deviation   n p q
(d) Moment generating function
 
n
M X (t )  E [e tX
]  q  pe t

G (t )  q  p t 
n
(e) Probability generating function

Statistics Department - Faculty of Science

44
King Abdulaziz University
Discrete Random Variables
Example (18)
A fair coin is tossed 6 times. Find the probability
(a) Exactly 3 times
(b) At least 2 times
(c) At most 4 times
Solution

Statistics Department - Faculty of Science

45
King Abdulaziz University
Discrete Random Variables
We have
 6  1
6

f (x )  P (X  x )      , x  0,1,..., 6
 x  2 

(a) P(X=3) = f(3)=0.313

(b) P(X ≥ 2) = 0.891
(c) P(X ≤ 4) = 0.891

Statistics Department - Faculty of Science

46
King Abdulaziz University
Discrete Random Variables
Example (19)
The moment generating function of the r. v. X is
 0.25  0.75e 
6
M X (t )  t

Determine: the probability distribution, the mean

and variance.
Solution
X ~ Bin (6, 0.75). E(X) = 6*0.75 = 4.5
Var (X) = 6*0.75*0.25 = 1.125
Statistics Department - Faculty of Science
47
King Abdulaziz University
Discrete Random Variables
3. Poisson distribution
Let X be a r. v. denoting the number of successes
in a sequence of n (n ≥ 30) Bernoulli trials
with probability p (p < 0.5) of successes,
satisfying the conditions of the binomial
distribution such that n p = λ is finite.
The possible values of X are X = 0, 1, 2, …
It is clear that X is a discrete r. v.
Statistics Department - Faculty of Science
48
King Abdulaziz University
Discrete Random Variables
The probability mass function of X is
x
f (x )  P (X  x )  e   , x  0,1, 2,...
x!

In this case we say

X has a Poisson Distribution with parameter λ
and write
X  Poi ( )

Statistics Department - Faculty of Science

49
King Abdulaziz University
Discrete Random Variables
Characteristics of Poisson distribution
(a) Poisson distribution is a limiting distribution
of the binomial distribution as n tends to ∞.
(b) Poisson distribution is the distribution of rare
events. It is used when n is large and p is
small, such that λ = n p < ∞.
(c) Mean = variance = λ
(d) The MGF is M X (t )  e  (exp t 1)
Statistics Department - Faculty of Science
50
King Abdulaziz University
Discrete Random Variables
Example (20)
The number X of annual earthquakes in a certain
country has a mean 4. What is the probability
distribution of X.
Solution
Because of the earthquake is a rare event, then
the distribution of X is Poisson distribution
with parameter λ = 4.
Statistics Department - Faculty of Science
51
King Abdulaziz University
Discrete Random Variables
Example (21)
Consider the case when X has a Poisson
distribution with parameter 3.
In this case:
3x  3
(i) The PMF of X is f (x )  P (X  x )  x !e , x  0,1,2,...
(ii) E(X) = Var(X) = 3
(iii) P(X = 2) = f(2) = 4.5 e- 3 = 0.224

Statistics Department - Faculty of Science

52
King Abdulaziz University
Discrete Random Variables
(iv) P(X is at least 3) = P(X ≥ 3) = f(3) + f(4) + …
= 0.577

= 0.423

Statistics Department - Faculty of Science

53
King Abdulaziz University
Discrete Random Variables
4. Geometric distribution
Let X be a r. v. denoting the number of Bernoulli
trials, required to obtain the first success.
The possible values of X are X = 1, 2, …
It is clear that X is a discrete r. v. with
P(X = 1) = p
P(X = 2) = p q, …

Statistics Department - Faculty of Science

54
King Abdulaziz University
Discrete Random Variables
In general f (x )  P (X  x )  p q x 1 , x  1, 2,...
This is called the geometric distribution with
parameter p.
We denote this by writing X Geom ( p )
1 q p et
E (X )  ,V ar (X )  2 , M X (t ) 
p p 1 q et

pt
G X (t ) 
1q t

Statistics Department - Faculty of Science

55
King Abdulaziz University
Discrete Random Variables
Example (22)
Consider the case X  Geom (0.65)
This means that X has geometric distribution
with parameter p = 0.65.
Thus
f (x )  P (X  x )  (0.65)(0.35) x 1 , x  1, 2,...
We have:

Statistics Department - Faculty of Science

56
King Abdulaziz University
Discrete Random Variables

Statistics Department - Faculty of Science

57
King Abdulaziz University
Discrete Random Variables
5. Negative binomial distribution
Let X be a r. v. denoting the number of Bernoulli
trials required to obtain the first k successes.
The possible values of X are k, k+1, k+2, …
It is clear that X is a discrete random variable.
We can prove that the PMF of X has the form:
x 1 x k
f (x )  P (X  x )  C k 1 p q k
, x  k , k  1,...

Statistics Department - Faculty of Science

58
King Abdulaziz University
Discrete Random Variables
In this case, we say that X has a negative
binomial distribution with parameters k, p .
This is referred to by writing X  NB (k , p )
Note that
The negative binomial distribution reduces to
the geometric distribution when k = 1.
Thus the geometric distribution is a special case
of the negative binomial distribution.
Statistics Department - Faculty of Science
59
King Abdulaziz University
Discrete Random Variables
Characteristics of negative binomial distribution
(a) E(X) = k/p
(b) Var(X) = k q/p2
k
(c) The MGF is M  p et
( ) t 

X
 1 q e 

k
 pt 
G X (t )   
1q t 

Statistics Department - Faculty of Science

60
King Abdulaziz University
Discrete Random Variables
Example (23)
Consider the case when X  NB (5,0.8). This means
that X has the negative binomial distribution with
k = 5 and p = 0.8.
In this case
(a) E(X) = 5/0.8 = 6.25
(b) Var (X) = 5*0.2 / (0.8)2 = 1.563
(c) 6
P (X  7)    (0.8) (0.2)  0.197
5

 4

Statistics Department - Faculty of Science

61
King Abdulaziz University
Discrete Random Variables
6. Hyper-geometric distribution
Consider a collection of k of objects of a certain
Type and N – k of another Type.
A random sample of size n is drawn without
replacement.
Let X be a random variable denoting the number
of objects of the first type in the selected
sample.
Statistics Department - Faculty of Science
62
King Abdulaziz University
Discrete Random Variables
The PMF of X is
 k  N k 
  
x 
f (x )  P (X  x )    
x n
, x  max(0, n  k  N ),..., min(k , n )
N
 
n 

In this case, we say that X has a hyper-geometric

distribution with parameters N, k, n and write
X  HG (N , k , n )

Statistics Department - Faculty of Science

63
King Abdulaziz University
Discrete Probability Distributions
Characteristics of hyper-geometric distribution
X ~ HG (N, k, n)
(i) Mean
k
E (X )  n p  n  
N 

(ii) Variance
 k  k  N  n 
Var (X )  npq  n  1   
 N  N  N  1 

Statistics Department - Faculty of Science

64
King Abdulaziz University
Discrete Random Variables
Example (24)
From a group of 6 men and 4 women, a random sample
of size 5 persons is selected without replacement.
Let X denotes the number of men in the sample.
It is clear that X has HG(10, 6, 5). The PMF of X is
 6  4 
  
 x  5  x  , x  1,...,5
f (x )  P (X  x ) 
10
 
5

Statistics Department - Faculty of Science

65
King Abdulaziz University
Discrete Random Variables
We have : N = 10, k = 6, n = 5
(i) Mean = 3
(ii) Variance = 0.67
(iii) P(2 men are selected) = P(X=2) = f(2) = 0.238
(iv) P(selecting 2 women) = P(X=3) = f(3) = 0.476
(v) P(less than 3 men) = f(1)+f(2) = 0.262

Statistics Department - Faculty of Science

66
King Abdulaziz University