Discrete Random Variable Overview
Discrete Random Variable Overview
Topic
Probabilityy Distribution
1
Section 1 – Discrete Random Variable
Section 1.1 Probability Distribution
Examples (of discrete random variables):
2
Section 1 – Discrete Random Variable
Section 1.1 Probability Distribution
Example:
3
Section 1 – Discrete Random Variable
Section 1.1 Probability Distribution
Definitions:
P( X ) 1
P( x) P( X x)
4
Section 1 – Discrete Random Variable
Section 1.1 Probability Distribution
Example (revisit):
Suppose
pp the followingg ggives the frequency
q y and relative
frequency distributions of the vehicles owned by all 2000
families living in a small town.
5
Section 1 – Discrete Random Variable
Section 1.1 Probability Distribution
When the relative frequencies are known for the population,
they give the actual (theoretical) probabilities of outcomes.
Using the relative frequencies,
frequencies we can write the probability
distribution of the discrete random variable X:
Number of Probability
Vehicles Owned (x) P( x) P( X x)
0 00.015
015
1 0.235
2 0.425
3 0.245
4 0.080
Probability distribution
6
Section 1 – Discrete Random Variable
Section 1.1 Probability Distribution
Definitions:
Let X be a discrete random variable with probability
di ib i
distribution P( X ) .
The mean or expected value is
E ( X ) x P( x)
7
Section 1 – Discrete Random Variable
Section 1.1 Probability Distribution
Solution:
Let X denote the number of breakdowns for this machine
during a given week.
( a ) the probability of exactly two breakdowns
P ( X 2) 0.35
P (0 X 2) P ( X 0) P ( X 1) P( X 2)
P ( X 1) P ( X 2) P ( X 3)
0.35 0.30 0.65
P ( X 1) P( X 0) P ( X 1)
8
Section 1 – Discrete Random Variable
Section 1.1 Probability Distribution
Further question:
Find the mean number of breakdowns per week for this
machine
machine.
Recall: E ( X ) x P ( x)
x P( x) x P ( x)
0 0.15 0.00
1 0 20
0.20 0 20
0.20
2 0.35 0.70
3 0.30 0.90
x P( x) 1.80
The mean is 1.80
9
Section 1 – Discrete Random Variable
Section 1.1 Probability Distribution
Example:
x 0 1 2 3
P( X ) 0.2 0.1 0.3 0.4
x P( x) x P ( x) ( x ) 2 P( x)
0 0.2 0.0 0.722
1 0.1 0.1 0.081
2 03
0.3 06
0.6 0 003
0.003
3 0.4 1.2 0.484
x P( x) 1.9 ( x )2 P( x) 1.29
The variance is 2 1.29
10
Section 1 – Discrete Random Variable
Section 1.1 Probability Distribution
By alternative formula
2 Var ( X ) x 2 P( x) 2
x P( x) x P ( x) x 2 P( x)
0 0.2 0.0 0.0
1 0.1 0.1 0.1
2 03
0.3 06
0.6 12
1.2
3 0.4 1.2 3.6
x P( x) 1.9 x2 P( x) 4.9
The variance is 2 4.9 1.92 1.29
11
Section 1 – Discrete Random Variable
Section 1.2 Binomial Probability Distribution
There are n identical trials. In other words, the given
experiment is repeated n times. All these repetitions are
performed under identical conditions.
conditions
Example:
12
Section 1 – Discrete Random Variable
Section 1.2 Binomial Probability Distribution
Solution:
13
Section 1 – Discrete Random Variable
Section 1.2 Binomial Probability Distribution
Binomial Formula
For a binomial experiment, the probability of exactly x
successes in n trials is given by the binomial formula
n
P ( x) P( X x) p x (1 p ) n x x 0,1,, n
x
14
Section 1 – Discrete Random Variable
Section 1.2 Binomial Probability Distribution
Example:
The chance
Th h ( b bilit ) that
(probability) th t the
th student
t d t will
ill guess the
th
correct answer to the first question is 0.50. Likewise, the
probability of guessing each of the remaining questions
correctly is 0.50.
15
Section 1 – Discrete Random Variable
Section 1.2 Binomial Probability Distribution
16
Section 1 – Discrete Random Variable
Section 1.2 Binomial Probability Distribution
4
P ( X 0) (0.5)0 (1 0.5) 40 0.0625
0
4
P ( X 1) (0.5)1 (1 0.5) 41 0.25
1
17
Section 1 – Discrete Random Variable
Section 1.2 Binomial Probability Distribution
4
P ( X 2) (0.5) 2 (1 0.5) 42 0.375
2
Independence
p of occurrences means that one occurrence
(or nonoccurrence) of an event does not influence the
successive occurrences or nonoccurrence of that event.
18
Section 1 – Discrete Random Variable
Section 1.3 Poisson Probability Distribution
19
Section 1 – Discrete Random Variable
Section 1.3 Poisson Probability Distribution
x e x 0,1,2,
P ( x) P ( X x)
x!
h is
where i the
h mean number
b off occurrences in
i that
h interval.
i l
E( X ) and 2 Var ( X )
20
Section 1 – Discrete Random Variable
Section 1.3 Poisson Probability Distribution
Example:
A washing
hi machine
hi in
i a laundry
l d breaks
b k down
d an average off
three times per month.
Solution:
3x e 3
P ( X x)
x!
21
Section 1 – Discrete Random Variable
Section 1.3 Poisson Probability Distribution
( a ) The probability that exactly two breakdowns will be
observed during the next month
32 e 3
P ( X 2) 0.224
2!
30 e 3 31 e 3
P ( X 1) 0.1992
0! 1!
In the situation,
situation the Poisson distribution can be used to
approximate the binomial probabilities when the number
of trials n is large and at the same time the probability p is
small (generally such that np 7 ).
22
Section 1 – Discrete Random Variable
Section 1.3 Poisson Probability Distribution
Proposition
Let X be
L b the
h number b off success resulting
li f
from n
independent trials, each with probability of success p. The
distribution of the number of success X is binomial, with
mean np .
The pprobability
y of the approximating
pp g distribution is then:
(np ) x e np x 0,1,2,
P( x) P( X x)
x!
23
Section 1 – Discrete Random Variable
Section 1.3 Poisson Probability Distribution
Example:
1 P ( X 0) P( X 1) P( X 2)
(3.5)0 e 3.5 (3.5)1 e 3.5 (3.5) 2 e 3.5
1 0.679
0! 1! 2!
24
Section 1 – Discrete Random Variable
Section 1.4 Hypergeometric Probability Distribution
25
Section 1 – Discrete Random Variable
Section 1.4 Hypergeometric Probability Distribution
The hypergeometric
Th h t i random
d variable
i bl X is
i the
th number
b off
“successes” in the draw of n elements.
r N r
x n x
P ( x) P ( X x)
N
n
26
Section 1 – Discrete Random Variable
Section 1.4 Hypergeometric Probability Distribution
Assumptions:
•The sample of n elements is randomly selected from the
N elements of the population.
r N r N n
2 Var ( X ) n
N N N 1
N n
The expression is known as the finite
N 1
population correction factor.
27
Section 1 – Discrete Random Variable
Section 1.4 Hypergeometric Probability Distribution
Example:
Solution:
4 6 4
2 3 2
P ( X 2) 0.6
6
3
28
Section 1 – Discrete Random Variable
Section 1.5 Negative Binomial Distribution
k 1 r
P( X k ) p (1 p ) k r k r , r 1,
r 1
29
Section 1 – Discrete Random Variable
Section 1.5 Negative Binomial Distribution
r r (1 p )
E( X ) and 2 Var ( X )
p p2
Solution:
Note that r successes will occur before m failures if and
only if the rth success occurs no later than the ( r m 1) th
trial.
r m 1
k 1 r
Hence, the desired probability is
k r
r 1 p (1 p )
k r
30
Section 1 – Discrete Random Variable
Section 1.5 Negative Binomial Distribution
Example:
Solution:
P ( X 4) 1 P ( X 3)
3
3 k
1 (0.6) 4 (1 0.6) k 0.2898
k 0 k
31
Section 2 – Continuous Random Variable
Section 2.1 Probability Distribution
Definitions:
32
Section 2 – Continuous Random Variable
Section 2.1 Probability Distribution
Definition:
If X is
i a continuous
ti random
d i bl andd y f ( x) is
variable i a
function such that f ( x) 0 for all X, then y f ( x) is
called the probability density function (pdf) of
the continuous random variable X if for any numbers a and
b, the area under the graph of y f ( x) from X a to
X b equals the probability that X lies between a and b.b
0 t 1
0.25 1 t 3
F (t ) 0.5 3 t 5
0.75 5 t 7
1 t7
33
Discrete Random Variable
Calculate:
( a ) P (T 5) ( b ) P (T 3) ( c ) P (1.4 T 6)
Solution:
( a ) P (T 5) 0 .25
( a ) P (2 X 2.5)
( b ) P ( X 16)
34
Section 2 – Continuous Random Variable
Section 2.1 Probability Distribution
Solution:
f ( x)
( a ) P (2 X 2.5) 0.25
( b ) P ( X 16) 1 0.5
0 1 3 x
1
f ( x) e ( x ) /2
2 2
2
35
Section 2 – Continuous Random Variable
Section 2.2 Normal Distribution
The random variable X that has a normal distribution is
called a normal random variable.
Examples
E l off continuous
i random
d variables
i bl that
h have
h all
ll been
b
observed to have a (approximate) normal distribution:
36
Section 2 – Continuous Random Variable
Section 2.2 Normal Distribution
E( X ) and Var ( X ) 2
N (0,0.25)
N (0,1)
(0 1)
N (1,1)
N (1,1)
N (0, 4)
37
Section 2 – Continuous Random Variable
Section 2.2 Normal Distribution
Notation: Z ~ N (0, 1)
The
h probability
b bili or area under
d theh standard
d d normall curve
can be found from the standardized normal table.
38
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
Examples:
P ( Z 1.95)
0.0256
0 0256
P ( Z 1.32)
0.9066
39
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
X
Z
Example:
Lett X be
L b a continuous
ti random
d variable
i bl that
th t is
i normally
ll
distributed with a mean of 25 and a standard deviation of 4.
( a ) between X 25 and X 32
40
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
Solution:
For the given information, 25 4
18 25 34 25
P (18 X 34) P Z
4 4
41
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
Determining the Z values when an area under the
Normal Distribution Curve is Known
Example:
Find the value of Z such that the area under the standard
normal curve in the right tail is 0.05.
S l ti
Solution:
P ( Z z ) 0.05
z 1.645
Solution:
P ( Z z ) 0.005 z 2.575
42
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
Example:
Find a point Z such that the area under the standard normal
curve between 0 and Z is 0.4251 and the value of Z is
positive.
Solution: P (0 Z z ) 0.4251 P ( Z z ) 0.0749
z 1.44
Th the
Then, th X value
l isi calculated
l l t d using
i the
th formula
f l
X
Z X Z
43
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
Example:
44
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
np np(1 p)
45
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
46
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
Example:
Assume that
A th t X ~ Bin
Bi (100,
(100 0.36)
0 36) .
Use the normal approximation of binomial distribution to
find the following probability:
Solution:
51.5 36
( a ) P ( X 51) P( X 51.5) P Z
23.04
P( Z 3.22) 0.00064
47
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
50.5 36
( b ) P ( X 51) P ( X 50.5) P Z
23.04
P( Z 3.02) 0.00126
44.5 36
( c ) P ( X 45) P ( X 44.5) P Z
23.04
P( Z 1.77) 0.9616
48
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
Example:
Solution:
Let X be
L b the
h numberb off persons in
i the
h sample
l who
h have
h at
least one credit card.
X ~ Bin(30, 0.5)
Required
q probability:
p y
30
P ( X 19) (0.5)19 (1 0.5)11 0.0509
19
(Exact Solution)
49
Section 2 – Continuous Random Variable
Section 2.3 Standard Normal Distribution
P ( X 19) P (18.5
(18 5 X 19
19.5)
5)
18.5 15 19.5 15
P Z
7.5 7.5
P(1.28
(1 28 Z 11.64)
64) 00.0498
0498
Using the binomial formula, the exact probability is
0.0509. The error due to using the normal approximation
is 0.0011. Thus, the exact probability is underestimated
by 0.0011 if the normal approximation is used.
50
Section 2 – Continuous Random Variable
Section 2.4 Uniform Probability Distribution
For example:
The time that a commuter waits to board a MTR train from
Central to Causewayy Bay
y has a uniform distribution.
1/ (b a ) if a x b
f ( x)
0 elsewhere
51
Section 2 – Continuous Random Variable
Section 2.4 Uniform Probability Distribution
Remarks:
There
e e iss a ddifferent
e e uuniform
o ddistribution
s bu o from o thee familyy oof
uniform distributions for each pair of values for a and b.
ab (b a ) 2
E( X ) and Var ( X )
2
2 12
52
Section 2 – Continuous Random Variable
Section 2.4 Uniform Probability Distribution
53
Section 2 – Continuous Random Variable
Section 2.4 Uniform Probability Distribution
Solution:
( a ) f ( x), E ( X ), Var ( X )
1 1
if 9 x 15
f ( x) 15 9 6
0 elsewhere
a b 9 15
E( X ) 12
2 2
(b a ) 2 (15 9) 2
Var ( X ) 3
12 12
13 9 2
( b ) P ( X 13) 0.6667
6 3
( c ) P (4 X 7) 0 because f ( x) 0 everywhere
except in the interval 9 X 15 .
15 9
( d ) P (6 X 18) P(9 X 15) 1
6
54
Section 2 – Continuous Random Variable
Section 2.5 Exponential Distribution
f ( x) e x for x 0, 0
1
Denote .
The mean and the variance of the exponential distribution
are
E( X ) and Var ( X ) 2
55
Section 2 – Continuous Random Variable
Section 2.5 Exponential Distribution
Computing Probabilities for the Exponential
Distribution
P ( X c) 1 e c
P ( X c) e c
P (c X d ) e c e d
Example:
Suppose X has
S h an exponentiali l distribution
di ib i with i h mean equall
to 10. Determine the following:
( a ) P ( X 10)
( b ) P ( X 20)
( c ) P (15 X 30)
( d ) Find the value of x such that P ( X x) 0.95
56
Section 2 – Continuous Random Variable
Section 2.5 Exponential Distribution
Solution:
1
Given E ( X ) 10 0.1
01
P ( X x) 0.95
1 e (0.1) x 0.95
e 0.1x 0.05
0.1x ln(0.05)
x 29.957
57
Section 2 – Continuous Random Variable
Section 2.5 Exponential Distribution
Relationship Between the Poisson and Exponential
Distributions
Recall that the Poisson distribution,
distribution as a discrete probability
distribution, is often useful when dealing with the number
of occurrences of an event over a specified interval of time
or space.
e x e 10 (10) x
f ( x) P( X x)
x! x!
58
Section 2 – Continuous Random Variable
Section 2.5 Exponential Distribution
Since the average number of arrivals is 10 cars per hour, the
average time between cars arriving is
1 hour
0.1 hour / car
10 cars
59
Section 2 – Continuous Random Variable
Section 2.5 Exponential Distribution
Solution:
( a ) Find the mean and standard deviation of the time X
between customer arrivals at the teller
teller’ss window.
Since the number of arrivals in one minute has a Poisson
distribution, the time between arrivals is exponentially
distributed.
P ( X 3) 1 e 3/1.33 0.895
60