chapter iv random variables and probability...
TRANSCRIPT
CHAPTER IVDISCRETE RANDOM VARIABLES
DISCRETE PROBABILITY DISTRIBUTIONS
DISCRETE RANDOM VARIABLES
• Illustrative Example:
• Consider the experiment of tossing a coin 3times. 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
2Statistics Department - Faculty of Science
King Abdulaziz University
DISCRETE RANDOM VARIABLES
• Remarks:
• The discrete random variable X is a real-valuedfunction defined on the sample space S, suchthat it assigns to each sample point in S, a realnumber 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 tothe outcomes of a random experiment
3Statistics Department - Faculty of Science
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
4Statistics Department - Faculty of Science
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
5Statistics Department - Faculty of Science
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 assumesvalues X = x1 , x2 , x3 , …
• The continuous random variables assumesvalues: x > a, x <b, a < x < b
6Statistics Department - Faculty of Science
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)
(iii) P (X = k) = f (k)
7Statistics Department - Faculty of Science
King Abdulaziz University
1 1( ) ( ) 1
n n
i ii if x P X x
Dr. Mahmoud Abd Almo'menDr. Mahmoud Abd Almo'men Atallah
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.
• 7k +12k + 22K + 27k = 1 => 68k = 1 => K = 1/68
X 0 1 3 4
f (x) 7 k 12 k 22 k 27 k
8Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
• Example (2)The discrete r. v. X has the following PMFf (x) = P (X = x) = k 5Px , x = 1, 3, 5Find the value of the constant k
• Solution
• 5k + 60k + 120k = 1 => 185k = 1 = > k = 1/185
X 1 3 5
f (x) 5P1 k 5P3 k5P5 k
5 k 60 k 120 k
9Statistics Department - Faculty of Science
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.
5k + 10k + 10k + 5k = 30 k = 1 => k = 1/30
X 1 2 3 4
f (x) 5C1 k 5C2 k 5C3 k 5C4 k
10Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
• Example (4)
The discrete r. v. X has the following PMF
f (x) = P (X = x) = k 5Cx8C 4 – x , x = 1, 2, 3, 4
Find the value of the constant k
Solution Form the table
• k [280 + 280 + 80 + 5 ] = 645 k = 1 => k = 1/645
X 1 2 3 4
f (x) 5C18C 3 k 5C2
8C 2 k 5C38C 1 k 5C4
8C 0 k
11Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
Expectation of the discrete r. v. X
(Expected value, Mean value, Mean)
The expected value of the r. v. X determines the value about which the values of X tend to accumulate.
( ) ( ) ( )all x all x
E X x P X x x f x
12Statistics Department - Faculty of Science
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):
[ ( )] ( ) ( )all x
E g X g x f x
13Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
Higher moments of X
• The r-th non-central moment of the discreterandom variable X is denoted by
( ) ( ) ( ), 1, 2, 3,r r r
r
x x
E X x P X x x f x r
14Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
• Example (5) Consider the probabilitydistribution
• E(X)= 2.5
• E(X2 ) = 7.17
• E(5X + 2) = 5 E(X) + 2 = 5*2.5 + 2 = 14.5
X 1 2 3 4
f (x) 1/6 1/3 1/3 1/6
15Statistics Department - Faculty of Science
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
16Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
Variance of a random variable X
• It measures the degree of scatter (measuredin squared units of X) of the values of X about its mean µ.
• It is denoted by Var (X) or σ2 and defined by
σ2 = Var (X) = E[(X - µ)2 ] = E(X2 ) - µ2
17Statistics Department - Faculty of Science
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
18Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
The standard deviation of X
• It measures the degree of scatter of the valuesof X (measured in the same units as X) aboutits mean µ.
• It is denoted by σ and defined as
( )Var X
19Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
• Example (6)• For the probability distribution
We have: E(X) = 2.5 and E(X2 ) = 7.17
• Var (X) = 7.17 – (2.5)2 = 0.92
X 1 2 3 4
f (x) 1/6 1/3 1/3 1/6
0.92 0.96X
20Statistics Department - Faculty of Science
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 3 (2 3) 3.68 1.92X Var X
21Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
Cumulative Distribution Function of X
• It is denoted by F (x) and defined as follows:
• Some properties of F(x) :
(1) F(- ∞) = 0, F(+ ∞) = 1
(2) 0 ≤ F(x) ≤ 1
( ) ( ) ( ) ( )u x u x
F x P X x P X u f u
22Statistics Department - Faculty of Science
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 + )
23Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
Example (7)
Find the cumulative distribution function for
Solution
X 0 3 5
f (x) 0.25 0.5 0.25
X x < 0 0 ≤ x < 3 3 ≤ x < 5 x ≥ 5
F (x) 0 0.25 0.75 1
24Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
The Probability Generating Function
• It is denoted by GX (t) and defined by
• Such that
(1)
(2)
(3)
Statistics Department - Faculty of Science King Abdulaziz University
25
( ) ( ) ( ) ( )X x x
X
x x
G t E t t P X x t f x
(1) 1XG
( ) (1), [ ( 1)] (1)X XE X G E X X G
2var (1) (1) (1)X X Xiance G G G
Discrete Random Variables
• Example (8) The PGF of the distribution of the r. v. Xis given by
• Find the value of E (X), E[X(X-1)], and Var (X).
• Solution
Statistics Department - Faculty of Science King Abdulaziz University
26
24 6 4 1( )
15 15 15 15G t t t t t
( ) (1) 2.133Xmean E X G
2var (1) (1) (1) 0.782X X Xiance G G G
[ ( 1)] (1) 3.2XE X X G
Statistics Department - Faculty of Science King Abdulaziz University
27
Discrete Random Variables
• Remark. The PMF f(x) can be determined from thegiven PGF. We have
• Then, we can find the requirements using theobtained PMF.
24 6 4 1( )
15 15 15 15G t t t t t
Statistics Department - Faculty of Science King Abdulaziz University
28
Discrete Random Variables
• Example (9) The PGF of the distribution of the r. v. Xis given by
• Find the probability mass function of X.
• Solution
24 6 4 1( )
15 15 15 15G t t t t t
X 1 2 3 4
f(x) 4/15 6/15 4/15 1/15
Discrete Random Variables
• Example (10) The PGF of the distribution of the r. v. Xis given by
• Find the value of E (X), E[X(X-1)], and Var (X).
• Solution
Statistics Department - Faculty of Science King Abdulaziz University
29
2var (1) (1) (1) 1.64X X Xiance G G G
2 3 4( ) 0.08 0.14 0.20 0.26 0.32G t t t t t
( ) (1) 2.60Xmean E X G [ ( 1)] (1) 5.80XE X X G
Statistics Department - Faculty of Science King Abdulaziz University
30
Discrete Random Variables
• Example (11) The PGF of the distribution of the r. v. Xis given by
• Find the probability mass function of X.
• Solution
2 3 4( ) 0.08 0.14 0.20 0.26 0.32G t t t t t
X 0 1 2 3 4
f (x) 0.08 0.14 0.20 0.26 0.32
Discrete Random Variables
• Example (12) The PGF of the distribution ofthe r. v. X is given by:
• Find the value of E (X), E[X(X-1)], and Var (X).
• Solution
Statistics Department - Faculty of Science King Abdulaziz University
31
0.65( )
1 0.35
tG t
t
( ) (1) 1.538Xmean E X G [ ( 1)] (1) 1.657XE X X G
2var (1) (1) (1) 0.828X X Xiance G G G
Discrete Random Variables
• Example (13) The PGF of the distribution of the r. v. Xis given by:
• Find the value of E (X), E[X(X-1)], and Var (X).
• Solution
Statistics Department - Faculty of Science King Abdulaziz University
32
5
( ) 0.25 0.75G t t
( ) (1) 3.75Xmean E X G [ ( 1)] (1) 11.25XE X X G
2var (1) (1) (1) 0.938X X Xiance G G G
Discrete Random Variables
• Example (14) The PGF of the distribution ofthe r. v. X is given by:
• Find the value of E (X), E[X(X-1)], and Var (X).
• Solution
Statistics Department - Faculty of Science King Abdulaziz University
33
5 ( 1)( ) tG t e
( ) (1) 5Xmean E X G [ ( 1)] (1) 25XE X X G
2var (1) (1) (1) 5X X Xiance G G G
Discrete Random Variables
The Moment Generating Function
• It is denoted by MX (t) and defined by
• Such that
(1) MX (0) = 1
(2)
( ) ( ) ( ) ( )t X t x t x
X
x x
M t E e e P X x e f x
( ) (0) ( ), 0,1,2,r r
XM E X r
34Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
Example (15)
Find the moment generating function, given that
Solution
1 3 5( ) ( ) 0.25 0.5 0.25t x t t t
X
x
M t e f x e e e
X 1 3 5
f (x) 0.25 0.5 0.25
35Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
• Example (16)
• The MGF of the r. v. X is given by
Find the corresponding PMF f(x).
• Solution
1 2 3( ) 0.125 0.375 0.375 0.125t t t
XM t e e e
X 0 1 2 3
f (x) 0.125 0.375 0.375 0.125
36Statistics Department - Faculty of Science
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”
37Statistics Department - Faculty of Science
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.
38Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
The probability mass function (PMF) of X is
This is called the Bernoulli distribution with parameter p.
This is referred to simply, as
1( ) ( ) , 0, 1, 0 , 1, 1x xf x P X x p q x p q p q
( )X Ber p
39Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
Characteristics of Bernoulli distribution
(a) Mean E(X) = p
(b) Variance Var(X) = p q
(c) Standard deviation
(d) The moment generating function
( ) [ ]t x t
XM t E e q pe
p q
40Statistics Department - Faculty of Science
King Abdulaziz University
Statistics Department - Faculty of Science King Abdulaziz University
41
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
(d) MGF ( ) [ ] 0.15 0.85t x t
XM t E e e
0.1275 0.357
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.
42Statistics Department - Faculty of Science
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
This is called binomial distribution with parameters n and p. We write
( ) ( ) , 0,1,2,...,x n xn
f x P X x p q x nx
( , )X Bin n p
43Statistics Department - Faculty of Science
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(d) Moment generating function
(e) Probability generating function
n p q
( ) [ ]n
t X t
XM t E e q p e
44Statistics Department - Faculty of Science
King Abdulaziz University
( )n
G t q p t
Discrete Random Variables
Example (18)
A fair coin is tossed 6 times. Find the probability that the Head will appear:
(a) Exactly 3 times
(b) At least 2 times
(c) At most 4 times
Solution
45Statistics Department - Faculty of Science
King Abdulaziz University
We have
(a) P(X=3) = f(3)=0.313
(b) P(X ≥ 2) = 0.891
(c) P(X ≤ 4) = 0.891
Discrete Random Variables
66 1
( ) ( ) , 0,1,..., 62
f x P X x xx
46Statistics Department - Faculty of Science
King Abdulaziz University
Example (19)
The moment generating function of the r. v. X is
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
Discrete Random Variables
6
( ) 0.25 0.75 t
XM t e
47Statistics Department - Faculty of Science
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.
48Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
The probability mass function of X is
In this case we say
X has a Poisson Distribution with parameter λand write
( ) ( ) , 0,1,2,...!
x
f x P X x e xx
( )X Poi
49Statistics Department - Faculty of Science
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 (exp 1)( ) t
XM t e
50Statistics Department - Faculty of Science
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.
51Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
Example (21)
Consider the case when X has a Poisson distribution with parameter 3.
In this case:
(i) The PMF of X is
(ii) E(X) = Var(X) = 3
(iii)P(X = 2) = f(2) = 4.5 e- 3 = 0.224
33( ) ( ) , 0,1,2,...
!
x
f x P X x e xx
52Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
(iv) P(X is at least 3) = P(X ≥ 3) = f(3) + f(4) + …
= 0.577
(v) P(X is at most 2) = P(X ≤ 3) = f(0) + f(1) + f(2)
= 0.423
53Statistics Department - Faculty of Science
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, …
54Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
In general
This is called the geometric distribution with parameter p.
We denote this by writing
1( ) ( ) , 1,2,...xf x P X x p q x
( )X Geom p
2
1( ) , ( ) , ( )
1
t
X t
p eqE X Var X M t
p p q e
55Statistics Department - Faculty of Science
King Abdulaziz University
( )1
X
p tG t
q t
Discrete Random Variables
Example (22)
Consider the case
This means that X has geometric distribution with parameter p = 0.65.
Thus
We have:
(0.65)X Geom
1( ) ( ) (0.65)(0.35) , 1,2,...xf x P X x x
56Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
(i) E(X) = 1/0.65 = 1.538
(ii) Var(X) = 0.35 / (0.65)2 = 0.828
(iii) P(X = 3) = f(3) = 0.080
(iv) P(X > 2) = 1 – f(1) – f(2) = 1 – 878 = 0.122
(v) P(X < 4) = f(1) + f(2) + f(3) = 0.957
57Statistics Department - Faculty of Science
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:
1
1( ) ( ) , , 1,...x k x k
kf x P X x C p q x k k
58Statistics Department - Faculty of Science
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
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.
( , )X NB k p
59Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
Characteristics of negative binomial distribution
(a) E(X) = k/p
(b) Var(X) = k q/p2
(c) The MGF is
(d) The probability generating function is
( )1
kt
X t
p eM
q e
60Statistics Department - Faculty of Science
King Abdulaziz University
( )1
k
X
p tG t
q t
Discrete Random Variables
Example (23)
Consider the case when . 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)
(5,0.8)X NB
56
( 7) (0.8) (0.2) 0.1974
P X
61Statistics Department - Faculty of Science
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.
62Statistics Department - Faculty of Science
King Abdulaziz University
Discrete Random Variables
The PMF of X is
In this case, we say that X has a hyper-geometric distribution with parameters N, k, n and write
( ) ( ) , max(0, ),...,min( , )
k N k
x n xf x P X x x n k N k n
N
n
( , , )X HG N k n
63Statistics Department - Faculty of Science
King Abdulaziz University
Statistics Department - Faculty of Science King Abdulaziz University
64
Discrete Probability Distributions
Characteristics of hyper-geometric distribution
X ~ HG (N, k, n)
(i) Mean
(ii) Variance
( )k
E X n p nN
( ) 11
k k N nVar X npq n
N N N
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
5( ) ( ) , 1,...,5
10
5
x xf x P X x x
65Statistics Department - Faculty of Science
King Abdulaziz University
Dr. Mahmoud Abd Almo
men
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
66Statistics Department - Faculty of Science
King Abdulaziz University