Probability and Engineer ing
Statistics
INE-201
Chapter VI
Random Variables &
Probability Distributions
Content
6.1 Introduction 137
6-2 Discrete Random Variables 137
6.3 The Hypergeometric Distribution 147
6.4 Binomial Distribution 151
6.5 The Poisson Distribution 159
6.6 Poisson Approximation Of Binomial
Probabilities 163
6.8 Continuous Random Variables 169
3
Introduction
Random Variable
A random variable is a variable that assumes
numerical values associated with the random
outcomes of an experiment, where one (and only
one) numerical value is assigned to each sample
point.
Introduction
Random Variable (RV):
A random variable is a function that assigns a real number
to each outcome in the sample space of a random
experiment
(S )
Random Variables are denoted by upper case letters (X)
Individual outcomes for an RV are denoted by lower
case letters (x)
Types of Random Variables
Random Variables RV
Quantitative RV
Continuous RV
Length
Depth
Volume
Time
Weight
Discrete RV
Number of sales
Number of calls
Shares of stock
People in line
Mistakes per page
Qualitative RV
Non Ordinal
Can't be
arranged
Green
Blue
Red
Black
Ordinal
Can be arranged
Excellent
Very Good
Good
Discrete Probability Distribution
The probability distribution of a discrete
random variable is called a probability
function if
Probability (Mass) Function :
f ( x) 0 x
f ( x) = 1
all x
Continuous Probability Distribution
The probability distribution of a continuous
random variable is called a probability
function if
Probability (Density) Function :
f ( x) 0 x
f ( x) = 1
all x
Cumulative Probability Function
The cumulative probability function, denoted
F(xn), shows the probability that X is less than or
equal to xn
F( x n ) = f( X x n )
In other words,
F( x n ) =
f(
x x
x)
F( x n ) = f( x) dx
Ch. 4-9
Example 6.2:
Page 139
2x +1
f ( x) = 25
x = 0, 1, 2, 3, 4
otherwise
Required:
(b) P (2 x 4)
(d) P(x>-6)
(a) P(x=4)
(c) P ( x 1)
Solution:
x
sum
f(x)
0.04
0.12
0.2
0.28
0.36
Cumulative F(x) 0.04
0.16
0.36
0.64
(a) P(x=4)=0.36
or P(x=4) = F(4) F(3) = 1- 0.64 = 0.36
10
Solution:
(b)
P (2 x 4) = p (2) + p (3) + p (4) =
0.2+0.28+0.36=0.84
or = F(4) F( 1) = 1 0.16 = 0.84
(c) P( x 1) = 0.16
(d) P(x>- 6) =1
11
Example 4.6:
Page 142
Determine the value of K so that each of the
following functions can serve as a probability
distribution of the discrete random variable X:
K ( X 2 + 4)
f ( x) =
0
for X = 0, 1, 2, 3;
Otherwise
Solution:
X
Sum
f(x)
4k
5K
8K
13K
30K
30K=1 , then K=1/30
( X 2 + 4)
f ( x) =
30
for X = 0, 1, 2, 3.;
12
Example 6.36:
Page 170
0 X 1
aX
a
f ( x) =
- aX + 3a
0
1 X 2
2X3
elsewhere
1. Find the constant a
2. Find the probability
Solution:
1
f ( x)dx + f ( x)dx + f ( x)dx = 1
1
ax dx + a dx + (ax + 3a)dx = 1
13
Solution:
1
x
x
2
+ 3aX = 1
a
+ a[x ]1 + a
2
2
2 0
2
2a=1, then a=0.5
X
2
1
f ( x) = 2
-X
3
+
2
2
0
0 X 1
1 X 2
2X3
elsewhere
1
1
1
P ( x 1.5) = xdx +
20
2
1.5
1 1
1 dx = 4 + 2 (1.5 1) = 0.5
14
Example
The probability mass function of the random variable X is given
as
x
f(x)
1/2
1/3
1/6
Find the distribution function F(x) and graph this distribution
function.
Solution:
0
x <1
1
2 1 x < 2
F (x ) = 5
2 x<3
6
x3
1
Graph of F(x) (step function)
15
Expected Value
Discrete RV
E( X) = x P( x) =
x
E( X ) = x P( x)
2
Continuous RV
E( X) =
x
f(
x
)
=
range x
E( X 2 ) =
2
x
f( x )
range x
E( X
) = x K P( x)
x
V( X) = ( x - ) 2 f( x) = 2
x
V( X) = E( x ) [ E ( x)] =
2
E( X
V( X) =
)=
K
x
f( x )
range x
2
( x - ) f( x ) = 2
range x
V( X) = E( x 2 ) [ E ( x)]2 =16 2
Discrete Probability Distribution
Experiment: for toss 2 coins, Calculate the mean and
variance
Let X = # heads.
Show P(x) , i.e., P(X = x) , for all values of x:
T
T
H
H
T
H
T
H
Probability Distribution
x Value Probability
0
1/4 = .25
2/4 = .50
1/4 = .25
Probability
4 possible outcomes
.50
.25
Ch. 4-17
Summary Measures
1. Expected Value (Mean of probability distribution)
Weighted average of all possible values
= E(x) = x p(x)
2. Variance
Weighted average of squared deviation about
mean
2 = E[(x )2] = (x )2 p(x)
3.
Standard Deviation
= 2
18
Summary Calculation Table
p(x)
Total
x p(x)
x p(x)
x (x )2 (x )2p(x)
(x )2 p(x)
19
Expected Value & Variance
Solution
2 = E[(x )2]
x (x ) 2 (x ) 2p(x)
p(x)
x p(x)
.25
1.00
1.00
.25
.50
.50
.25
.50
1.00
1.00
.25
= 1.0
2 = .50
= .71
20
Expected Value & Variance
Solution
2 = E(x 2) [(x)]2
x (x ) 2 (x ) 2p(x)
p(x)
x p(x)
.25
1.00
1.00
.50
.50
.5
.25
.50
1.00
1.00
= 1.0
2 = 1.5 1.0 =0.5
(x) 2 = 1.50
= .71
21
Discrete uniform distribution
Discrete uniform
X U (1,2,..., k )
1
P( X = i) =
i = 1,2,..., k
k
k
=1
k
1
k
0
1
f (x)
2
k
1
k
1
k-1
F (x)
22
22
Hypergeometric Distribution
The experiment consists of randomly drawing n elements
without replacement from a set of N elements, T of which
are Ss (for success) and (N T) of which are Fs (for
failure).
=nT
N T T
N
n X X
P ( X N , T , n) =
N
n
T N T N n
=n *
*
N
N
N 1
2
N = Lot Size or Total number of elements
T= Number of success in the N elements
n = Sample size
x = Number of success drawn in the n elements
23
Hypergeometric Distribution
The experiment consists of randomly drawing n elements
without replacement from a set of N elements, T of which
are Ss (for success) and (N T) of which are Fs (for
failure).
=nT
N T T
N
n X X
P ( X N , T , n) =
N
n
T N T N n
=n *
*
N
N
N 1
2
N = Lot Size or Total number of elements
T = Number of success in the N elements
n = Sample size
x = Number of success drawn in the n elements
24
Hypergeometric Distribution
Np
X
P( X N , Np, n) =
N Np
n X
N
n
= n Np
Np N Np N n
=n
*
*
N
N 1
N
2
N = Lot Size or Total number of elements
Np = Number of success in the N elements
n = Sample size
x = Number of success drawn in the n elements
25
Example
A manufacturing company uses an acceptance scheme
on production items before they are shipped. Boxes of
25 are readied for shipment and samples of 3 are tested
for defectives. If any defectives are found, the entire
box is sent back for 100% screening. If no defectives
are found, the box is shipped.
a-What is the probability that a box containing 3
defectives will be shipped?
b-What is the probability that a box containing only one
defective will be sent back for screening?
26
Solution
22
n=3
G
NP=3
G
N=25
{3
X represent the defectives 2
1
0
D
0 }box is shipped.
1 sent back for
2 100% screening
3
Np N Np
n X
P ( X = 0) =
N
3 22
= 0.669
P(X = 0) =
25
27
Solution
n=3
NP=22
N=25
X represent the good
22
G
{3
3
1
0
D
0 }box is shipped.
1 sent back for
2 100% screening
3
Np N Np
n X
P ( X = 3) =
N
22 3
= 0.669
P(X = 3) =
25
28
Solution
n=3
NP=1
N=25
X represent the defectives
Np N Np
X
n X
P ( X 0) =
N
1 24
= 0.12
= 1 P ( X = 0) =
25
29
Binomial Distribution
n x n x
=
p ( x ) =
p q
x
n!
p x (1 p ) n x
x ! ( n x )!
p (x) = Probability of getting x Successes
n = Sample size
p = Probability of a Success on a single trial
q = 1 p ()
x = Number of Successes in n trials
(x = 0, 1, 2, ..., n )
Mean
= E ( x) = np
Standard Deviation
30
= npq
Binomial Distribution
Experiment: Toss 1 coin 5 times in a row. Note
number of tails. Whats the probability of 3 tails?
n
p
q
x
=
=
=
=
5
0.5 Probability of getting tail
0.5
3 Getting three tails
=
p( x)
n!
p x (1 p ) n x
x !( n x)!
5!
=
p (3)
.53 (1 .5)53
3!(5 3)!
= .3125
31
Binomial Probability Table
n=5
k
p
.01
0.50
.99
.951
.031
.000
.999
.188
.000
1.000
.500
.000
1.000
.812
.001
1.000
.969
.049
Cumulative Probabilities
p(x 3) p(x 2) = .812 .500 = .312
32
Example
A marksman hits a target 80% of the
time. He fires five shots at the target. What is the
probability that exactly 3 shots hit the target?
n= 5
success = hit
P ( x = 3) = C p q
n
3
n 3
p = .8
x = # of hits
5!
=
(.8)3 (.2)53
3!2!
= 10(.8)3 (.2) 2 = .2048
33
Example
What is the probability that more than 3 shots
hit the target?
P ( x > 3) = C45 p 4 q 54 + C55 p 5 q 55
5!
5!
4
1
=
(.8) (.2) +
(.8)5 (.2) 0
4!1!
5!0!
= 5(.8) (.2) + (.8) = .7373
4
34
Example
The probability that a patient recovers from a rare blood
disease is 0.4. If 15 people are known to have contracted
this disease, what is the probability that
1-At least 10 survive?
X= number of people that survive
P(X 10) = 1 - P(X < 10) = 1 P(X 9) = 1 F(9) = 1 - 0.9662 = 0.0338
2-From 3 to 8 survive?
P(3 X8) = F(8) - F(2) = 0.9050 -0.0271 = 0.8779
3-Exactly 5 survive?
P(X=5)= F(5)-F(4)=0.4032-0.2173=0.1862
or
P(X =5) = f(5) =
15
5
(0.4)5(0.6)10 = 0.1862
35
36
Poisson Distribution
1. Number of events that occur in an interval
events per unit
Time, Length, Area, Space
2. Examples
Number of customers arriving in 20 minutes
Number of strikes per year in the U.S.
Number of defects per lot (group) of DVDs
37
Poisson Distribution
p( x) =
x!
(x = 0, 1, 2, 3, . . .)
p (x) = Probability of x given
= Mean (expected) number of events in unit
e = 2.71828 . . . (base of natural logarithm)
x = Number of events per unit
mean =
variance 2 =
38
Example
Customers arrive at a rate of
72 per hour. What is the
probability of 4 customers
arriving in 3 minutes?
1995 Corel Corp.
39
Solution
72 Per Hr. = 1.2 Per Min.
= 3.6 Per 3 Min.
p( x) =
e
x
x!
3.6 ) e
(=
4
p (4)
=
4!
-3.6
.1912
40
Poisson Probability Table
.02
:
3.4
3.6
3.8
:
0
.980
:
.033
.027
.022
:
x
3
:
:
.558 .744
.515 .706
.473 .668
:
:
:
.997
.996
.994
:
Cumulative Probabilities
p(x 4) p(x 3) = .706 .515 = .191
41
Example
Suppose that the average number of telephone calls arriving
at the switchboard of a small corporation is 30 calls per hour.
1. What is the probability that 3 calls will arrive in a 1-minute period
30 calls ------ 60 min
? Calls -------- 1min
? = 30 = 0.5
f (3) = e -0.5 0.5 3
60
3!
2.What is the probability that no calls will arrive in a 3-minute period
0.5 calls ---- 1 min
? Calls ----- 3 min
?= 0.5 * 3 = 1.5
f(0)= e -1. 5 1.5 0 = 0.223
0!
3. What is the probability that more than five calls will arrive
in a 5 minutes interval
( Answer 0.042)
42
Continuous Uniform Distribution
X U [ a, b]
for a < x < b
f ( x) = b a
0 otherwise
0 for x < a
x a
for a x < b
F ( x) =
b a
1 for x b
1
ba
f(x)
a
f (x)
xa
ba
F(x)
F (x)
43
43
Continuous Uniform Distribution
Probability density function:
1
f ( x) =
ba
Mean:
a xb
a+b
=
2
Variance:
2
b
a
(
)
2 =
12
P (a < x < b ) = (b a ) (d c ), c a < b d
44
Example
Youre production manager of a
soft drink bottling company. You
believe that when a machine is set
to dispense 12 oz., it really
dispenses between 11.5 and 12.5
oz. inclusive. Suppose the
amount dispensed has a uniform
distribution. What is the
probability that less than 11.8 oz.
is dispensed?
SODA
45
Solution
f (x )
1
ba
1.0
1
=1
12.5 11.5
x
11.5 11.8
12.5
P (11.5 x 11.8) = (Base)*(Height)
= (11.8 11.5)*(1) = .30
46
Exponential Distributiom
x
1
Density function
e
for x > 0
f ( x) =
0 for x 0
0 for x < 0
F ( x) =
x
for x 0
1 e
Cumulative function
1/
F(x)
f(x)
0
f (x)
F (x)
47
47
Exponential Distribution
Probability density function:
f ( x) =
for
x>0
Mean:
=
Standard Deviation:
=
48
Example
An electrical firm manufactures light bulbs that have a
length of life is approximately negative exponential
distribution with mean 1500 hr and density function is
f ( x) = e
- x
What is the probability that a
given bulbs will last;
a. More than 2000 hours;
b. b. Less than 300 hours
c. Find the value of true mean to give the probability of
a given bulbs will last less than 10 hours at most 0.001.
49
Solution
Approximately negative exponential distribution with
mean 1500 hr and
f ( x) = e
Mean:
- x
Variance:
a- More than 2000 hours; P(X>2000) = e
- X
dx
2000
=e
2000
1500
=0.264
X
Or F(x) =
f ( x)dx =
e -x dx = 1 e X
P(X>2000)=1-P(X<2000)=1-F(2000)=1-( 1 e
) =0.264
50
Solution
300
b. Less than 300 hours P(X<300) =
- X
e
dx
= 1-
e 1 / 5
Or P(X<300) = F(300) = P(X<300) = 1 e
= 0.181
1 e 300 / 1500
= 0.181
c. Find the value of true mean to give the probability of a given bulbs will last
less than 10 hours at most 0.001.
F (10) 0.001
1 e
e
10
= 1 e 10 0.001
0.999
10 ln 0.999
ln0.999/ - 10 = 1(10 4 )
9995
Normal Distribution
1
f (x) =
e
2
1. Bell-shaped &
symmetrical
1 x
2
f (x )
2. Mean, median, mode
are equal
where
x
Mean
Median
Mode
= Mean of the normal random variable x
= Standard deviation
52
Normal Distribution
1
f (x) =
e
2
Probability is
area under
curve!
1 x
2
P(c x d) =
f (x)dx ?
f (x )
53
Standard Normal Distribution
The standard normal distribution is a normal
distribution with = 0 and = 1. A random variable
with a standard normal distribution, denoted by the
symbol z, is called a standard normal random variable.
x
z=
54
Non-standard Normal
Distribution
Normal distributions differ by
mean & standard deviation.
Each distribution would
require its own table.
f(x)
Thats an infinite
number of tables!
55
Standardize the
Normal Distribution
z=
Normal
Distribution
Standardized Normal
Distribution
=1
=0
One table!
z
56
Standard Normal Distribution
Area from
to a equal area from
a to +
-a
=0
57
Standard Normal Distribution
Area from
a to 0 equal area from
0 to a
-a
=0
58
Example:
Find the probability of P (0 < z < 1.96)
Standardized Normal
Probability Table (Portion)
Z
.04
.05
=1
.06
1.8 .4671 .4678 .4686
.4750
1.9 .4738 .4744 .4750
2.0 .4793 .4798 .4803
= 0 1.96 z
2.1 .4838 .4842 .4846
Probabilities
Shaded area
exaggerated
59
Example
A certain type of storage battery lasts on the average 5
years, with a standard deviation of 10 years.
Assuming the battery lives are normally distributed,
find the Probability that a given battery will last
1. Between 5 and 6.2 years
2. Between 3.8 and 5years
3. Between 2.9 and 7.1years
4. More than 8 years
5. Between 7.1 and 8 years
6. More than 4 years
60
Solution
1-Between 5 and 6.2 years
P (5 < x < 6.2)
Normal
Distribution
x 6.2 5
z=
=
= .12
10
Standardized Normal
= 10
Distribution
=1
.0478
= 5 6.2 x
= 0 .12
P( 0 < Z < 0.12) = P(Z< 0.12) P(Z< 0)
= 0.5478 0.5000 = 0.0478
61
Standard Normal
Distribution
62
2-Between 3.8 and 5years
P (3.8 x 5)
x 3.8 5
= .12
=
z=
10
Normal
Standardized Normal
Distribution
Distribution
= 10
=1
.0478
3.8 = 5
-.12 = 0
P( -0.12 < Z < 0) = P(Z< 0.12) P(Z< 0)
= 0.5478 0.5000 = 0.0478
63
3-Between 2.9 and 7.1years
P (2.9 x 7.1)
x 2.9 5
z=
=
= .21
10
Normal
Distribution
x 7.1 5
z=
=
= .21
10
Standardized Normal
Distribution
=1
= 10
.1664
.0832 .0832
2.9 5 7.1
-.21 0 .21
P( -0.21 < Z < 0.21) = 2*[ P(Z< 0.21) P(Z< 0)]
= 2*[ 0.5832 0.5000] = 0.1664
64
Standard Normal
Distribution
65
4-Mor e than 8 years
P (x 8)
Normal
Distribution
x 85
z=
=
= .30
10
Standardized Normal
= 10
Distribution
=1
.5000
=5
.1179
P( Z > 0.3) = 1 -[ P(Z< 0.3)
= 1- 0.6179 = 0.3821
=0
.3821
.30 z
66
5-Between 7.1 and 8 years
P(7.1 X 8)
x 7.1 5
= .21
=
z=
10
Normal
Distribution
= 10
x 85
z=
=
= .30
10
Standardized Normal
Distribution
=1
.1179
=5
7.1 8
=0
.0347
.0832
.21 .30
P( 0.21 < Z < 0.30) = P(Z< 0.3) P(Z< 0.21)
= [ 0.6179 0.5832] = 0.0.0347
67
Standard Normal
Distribution
68
6-More than 4 years
P( X > 4)
z=
Normal
Distribution
45
=
= 0.1
10
Standardized Normal
Distribution
= 10
=1
.5389
=5
7.1 8
-0.1
=0
P( Z > -0.1) = P(Z< 0.1)
= 0.5398
69
The Standard Normal Table:
P (1.26 z 1.26)
Standardized Normal Distribution
=1
.3962
.3962
P (1.26 z 1.26)
= .3962 + .3962
= .7924
1.26 z
=0
1.26
Shaded area exaggerated
70
Standard Normal
Distribution
71
The Standard Normal Table:
P (z > 1.26)
Standardized Normal Distribution
=1
P (z > 1.26)
.5000
= .5000 .3962
.3962
= .1038
1.26
=0
72
The Standard Normal Table:
P (2.78 z 2.00)
Standardized Normal Distribution
=1
P (2.78 z 2.00)
.4973
= .4973 .4772
.4772
2.78 2.00
=0
= .0201
Shaded area exaggerated
73
The Standard Normal Table:
P (z > 2.13)
Standardized Normal Distribution
=1
.4834
P (z > 2.13)
.5000
= .4834 + .5000
2.13
=0
= .9834
Shaded area exaggerated
74
Approximation
Hypergeometric
N >> 50
q=1-p
Binomial
Np
__
P= N
Poisson
=np
Normal
=np
2 =npq
75
Example
Among the 120 applicants for a job only 80 are actually qualified. If
5 of these applicants are randomly selected for an interview, find the
probability that only 2 of the 5 will be qualified for the job by using
1. The hyper geometric distribution
X=2, n=5, N=120 ,Np=80
f(2)=
80
2
40
3
120
5
= 0.164
2.The binomial distribution as an approximation.
2
f(2) =
5
2
= 0.165
As can be seen these results are close .
76
Example
If 0.8% of the fuses delivered to an arsenal are defective, what is the
probability that four fuses will defective in random sample of 400?
The binomial distribution.
4
p= 0.008
q=0.992
n=400
f(4) =
400
4
0.008
396
0.992
= 0.1788
The Poisson distribution as an approximation.
= n*p = 400*0.008 = 3.2
e 3.2 3.2 4
p ( 4) =
= 0.178
4!
77
Example
Only one personal computer per thousand is
found to be defective after assembly in a
manufacturing plant, and the defective PCs are
distributed randomly throughout the production
run.
(a) What is the probability that a shipment of 500
PCs includes no defective computer?
(b) What is the probability that a shipment of 100
PCs includes at least one defective computer?
78
Solution
By the Poisson approximation of binomial probabilities,
P=0.001
q=0.999
=500(0.001)=0.5
e 0.5
= 0.6065
P( X = 0 = 0.5) =
0!
P=0.001
q=0.999
=100(0.001)=0.1
e 0.1 (0.1) 0
P( X 1 = 0.1) = 1
= 0.09516
0!
79
Example
A multiple-choice quiz has 200 questions, each with 4 possible
answers of which only 1 is correct. What is the probability that sheer
guesswork yields from 25 to 30 correct answers for the 80 of the 200
problems about which the student has no knowledge?
P = 0.25 q = 0.75 n = 80
30.5
24.5
P( 25<= X <= 30) = f(25)+ f(26) +f(27)+f(28)+f(29) +f(30)
=0.0433 + 0.03058 + 0.02039 + 0.0128 + 0.00769 + 0.00435
=0.11476
31
25 26 27 28 29 30
30.5
.0
24.5
24
x
80
80
Example
Binomial distribution
p (x)
.3
.2
.1
.0
81
Solution
The Normal distribution as an approximation.
= np = 80*0.25 = 20
2 = npq = 80*0.25*.75 = 15
P( 24.5< X < 305) = P( z1 < Z < z2 )
24.5 20
z1 =
= 1.16
3.873
30.5 20
z2 =
= 2.71
3.873
25
24.5
25.5
(25 .5) (25 + .5)
P(1.16 Z 2.71) = P( z < 2.71) P( z < 1.16)
= 0.9966 0.8770 = 0.1196
82
Brain Storming
You work in Quality
Assurance for an investment
firm. A clerk enters 75
words per minute with 6
errors per hour. What is the
probability of 0 errors in a
255-word bond transaction?
83
Solution
Finding
75 words/min = (75 words/min)(60 min/hr)
= 4500 words/hr
6 errors/hr = 6 errors/4500 words
= .00133 errors/word
In a 255-word transaction (interval):
= (.00133 errors/word )(255 words)
= .34 errors/255-word transaction
84
Solution
p( x) =
e
x
x!
.34 ) e
(=
0
p (0)
=
0!
-.34
.7118
85
Brain Storming
You work in Quality Control for
GE. Light bulb life has a normal
distribution with = 2000 hours
and = 200 hours. Whats the
probability that a bulb will last
A. between 2000 and 2400
hours?
B. less than 1470 hours?
86
Solution
P (2000 x 2400)
x 2400 2000
z=
=
= 2.0
200
Normal
Distribution
Standardized Normal
Distribution
= 200
=1
.4772
= 2000 2400
=0
2.0
z
87
Solution
P (x 1470)
x 1470 2000
=
= 2.65
z=
200
Normal
Distribution
Standardized Normal
Distribution
= 200
=1
.5000
.0040
1470
= 2000
.4960
2.65 = 0
z
88
Finding z-Values
for Known Probabilities
What is Z , given
P (z) = .1217?
.1217
Standardized Normal
Probability Table (Portion)
=1
.00
.01
0.2
0.0 .0000 .0040 .0080
0.1 .0398 .0438 .0478
=0
Shaded area
exaggerated
.31
?
0.2 .0793 .0832 .0871
0.3 .1179 .1217 .1255
89
Finding x Values
for Known Probabilities
Normal Distribution
Standardized Normal Distribution
= 10
=1
.1217
= 5 8.1
?
.1217
= 0 .31
x = + z = 5 + (.31)(10 ) =
90
91
91