ISE 205 - Discrete Random Variable - CH 3

Download as pdf or txt
Download as pdf or txt
You are on page 1of 61

Discrete Random Variables and

Probability Distribution (Ch. 3 )


Prof. Muhammad Al-Haboubi
2-8 Random Variables

Definition

• It is called a variable because the values it assumes varies due


to some sources of variation
• It is called random because the values it assumes are the result
of a random process
2-8 Random Variables

Definition
2-8 Random Variables

Examples of Random Variables


Random Variables

• X (capital letter) represents the random


variable
• x ( small letter ) represent the values of the
random variable
• x = a constant + error (changes due to
factors that appears random)
Discrete Random Variables

• Example : two components are inspected as


Defective (D) or Non-defective ( N )
X: number of defective items
S = {DD,DN,ND,NN)
X = 0,1,2
• Example : Two dices are tossed
X : Sum of dots appearing after the toss
X = 2,3,4,5,6,7,8,9,10,11,12
3-2 Probability Distributions and
Probability Mass Functions
• Example : Tossing two fair coins
S = {HH, TH, HT, TT}
P(HH) = P(TH) = P(HT) = P(TT) = ¼
X: number of heads, then X = 0,1,2
P(X=0) = ¼
P(X=2)= ¼
P(X=1)= ¼+¼= ½
3-2 Probability Distributions and
Probability Mass Functions

Figure 3-1 Probability distribution for bits in error.


3-2 Probability Distributions and
Probability Mass Functions
Definition
3-3 Cumulative Distribution Functions

Definition
Cumulative Distribution Functions

• Example : Tossing two fair coins

i xi f ( xi ) F ( x)

1 x1=0 f (0) = 1/4 F (0) = P ( X <= 0) = f (0) = ¼


2 x2=1 f (1) = 1/2 F (1) = P ( X <= 1) = f (0) + f (1) = ¼ + ½ = ¾
3 x3=2 f (2) = 1/4 F (2) = P ( X <= 2) = f (0) + f (1) + f (2) = ¼ + ½ +¼ = 1
Cumulative Distribution Functions

• Example
F(x) = 0 x<0
¼ 0 <= x <1
¾ 1 <= x < 2
1 2 <= x
Cumulative Distribution Functions - Example
P(X=0)=¼
P(X=1)=½
P(X=2)=¼
P(X<0)=0
P ( X <= 0 ) = ¼
P ( X <= 1 ) = ¾
P ( X <= 2 ) = 1
P ( X <= 1.5 ) = ¾
P ( X > 0) = 1 - P ( X <= 0 ) = 1 - ¼ = ¾
P ( X > 2) = 1 - P ( X <= 2 ) = 1 – 1 = 0
Example 3-8 ( Hyper geometric Distribution)

 50  800   800  50 
    
 850  849   850  849 
Example 3-8

Figure 3-4 Cumulative distribution function for


Example 3-8.
3-4 Mean and Variance of a Discrete
Random Variable
Definition
Expected value is equivalent to long – term average
Example : X : the outcome of a roll of a fair die
E(X) = (1+2+3+4+5+6) . 1/6 = 3.5
Mean of a Discrete Random Variable

• Example : Tossing two fair coins


X: number of heads, then X = 0,1,2
P(X= 0) = ¼ = f ( x1)
P(X= 2)= ¼ = f ( x3)
P(X= 1)= ¼ + ¼ = ½ = f ( x2)
E ( X ) = 0 (¼) + 2 ( ¼) + 1 ( ½ ) = 1 head
Variance of a Discrete Random
Variable

x x2 f(x) x. f(x)
0 0 ¼ 0 * 1/4
1 1 1/2 1*1/2
2 4 ¼ 4*1/4

V(X) = 0(1/4) + 1(1/2) + 4(1/4) – (1)2


= 3/2 -1 = 1/2
Example 3-11
Theorem 1 :
Expected Value of a Function of a Discrete
Random Variable
Example : h(x) = 1+ 3x

x f(x) x f(x) h(x)=1+3x f(x) h(x)


0 1/8 0 1 1/8
1 ¼ ¼ 4 1
2 3/8 6/8 7 21/8
3 ¼ ¾ 10 10/4
sum 1.0 1.75 6.25
Theorem 2:
If a and b are constants, then E ( a + b X ) = a + b E(X)

• Example :
E( 1 + 3 X ) = 1 + 3 E (X) = 1 + 3(1.75) = 6.25
V(X) = (0-1.75)2 *1/8 + (1-1.75)2 * ¼ +
(2-1.75)2 * 3/8 + (3-1.75)2 * ¼ = 0.9375
Theorem 3:

E[g(X) + h(X) ] = E[g(X)] + E[h(X)]


and
E[g(X) - h(X) ] = E[g(X)] - E[h(X)]
Theorem 4 :
 x2  E ( X 2 )   2
Pr oof
 x2  E[( X   ) 2 ]  E[ X 2  2X   2 ]  E ( X 2 ]  2E[ X ]   2 
E[ X 2 ]  2 2   2  E ( X 2 ]   2

Example
E[ X 2 ]   x 2 f ( x)  1 / 8(0) 2  1 / 4(1) 2  3 / 8(2) 2  1 / 4(3) 2  4
 x2  E ( X 2 )   2  4  (1.75) 2  0.9375
3-5 Discrete Uniform Distribution

Definition
3-5 Discrete Uniform Distribution

Example 3-13
3-5 Discrete Uniform Distribution

Figure 3-7 Probability mass function for a discrete uniform


random variable.
3-5 Discrete Uniform Distribution

Mean and Variance


Mean and Variance
• Example : Tossing a fair dice once
S = {1,2,3,4,5,6}
Note : numbers should be consecutive
E(X) = (1+6)/2 = 3.5
   x f (x) = (1+2+3+4+5+6)/6 = 3.5

V(X) = [ (6-1+1)2 -1 ]/12 = 2.917


n
 2   ( xi   ) 2 f ( x)  [(1  3.5) 2  ...  (6  3.5) 2 ] / 6  2.917
i 1
3-6 Binomial Distribution

Random experiments and random variables


3-6 Binomial Distribution

Random experiments and random variables


3-6 Binomial Distribution
Definition
3-6 Binomial Distribution

Figure 3-8 Binomial distributions for selected values of


n and p.
3-6 Binomial Distribution
Example 3-18
3-6 Binomial Distribution
Example 3-18
3-6 Binomial Distribution

Mean and Variance


3-6 Binomial Distribution

Example 3-19
Example : Consider three parts inspected and
classified as either defective (success) or non-
defective ( failure) with p=0.25 and q=0.75.
X : number of defective parts
X = 0,1,2,3 and n = 3
Note : n!/[x!(n-x)!] represents the number of
possible outcomes for a certain x
f (0) = 1 * (0.25)0 * (.75) 3-0 =0.422
f (1) = 3 * (0.25)1 * (.75) 3-1 =0.422
f (2) = 3 * (0.25)2 * (.75) 3-2 =0.141
f (3) = 1 * (0.25)3 * (.75) 3-3 =0.0156
Mean and Variance
E(X) = np = 3 (0.25) =.75
V(X) = npq = 3 (0.25) (0.75) = 0.56
What is the probability that at least two defectives
are found ?
P( X >= 2 ) = P(X = 2) + P(X = 3)
= 0.141 + 0.0156 = 0.1566
Another way :
P( X >= 2 ) = 1- P( X < 2 )
= 1- [P(X=0) + P(X=1)] = 1 - (0.422 + 0.422) =
0.1566
3-7 Geometric Distributions

Example 3-20
3-7 Geometric Distributions

Definition
3-7 Geometric Distributions

Figure 3-9. Geometric distributions for selected values


of the parameter p.
3-7 Geometric Distributions

3-7.1 Geometric Distribution


Example 3-21
3-7 Geometric Distributions

Definition
3-8 Hypergeometric Distribution

Definition
3-8 Hypergeometric Distribution

Figure 3-12.
Hypergeometric
distributions for
selected values of
parameters N, K, and n.
3-8 Hypergeometric Distribution

Example 3-27
3-8 Hypergeometric Distribution
Example 3-27
3-8 Hypergeometric Distribution

Mean and Variance


Binomial Approximation to the
Hypergeometric Distribution
• If n is small relative to N, the Hypergeometric
Distribution is approximated by the Binomial
Distribution
• Example: N=1000, K=700, n=50, P(X>45) = ?
• By Hypergeometric Distribution , P(X > 45) =
0.00013
• By Binomial Distribution( p = K/N = 700/1000) ,
P(X > 45) = 0.00017
3-9 Poisson Distribution
Definition
Poisson Distributions
• poisson-diagrams.pdf
Example : The number of accidents per month in a
certain intersection follows a Poisson distribution
with a mean of 4 per month.
• What is the probability that 6 accidents occur per
month ?
P(X = 6 ) = [46 * e-4]/6!= 0.1042
• What is the probability that more than two
accidents occur per month ?
P(X > 2) = P(X=3) + P(x=4) + …………
P(X > 2) = 1- P (X<= 2)
= 1 - [P (X=0) + P (X=1) + P (X=2) ]
= 1 – [ 0.0183 + .0733 + 0.1465] = 0.7619
3-9 Poisson Distribution

Consistent Units
3-9 Poisson Distribution
Example 3-33
3-9 Poisson Distribution
Example 3-33
3-9 Poisson Distribution

Mean and Variance

Example: E(X) = 4 accidents/ month then V(X) = 4


and the standard deviation = 2 accidents/ month
Poisson Approximation to the Binomial
Distribution
• Let X be a binomial random variable with
f(x). When n  , p  0, and   np remains
constant, the binomial distribution could be
approximated by the Poisson Distribution.
Poisson Approximation to the Binomial
Distribution
• Example : X is the number of defective parts and
follows a binomial distribution with p = 0.001.
What is the probability that a sample of 8000
parts will yield fewer than 7 defective parts ?
P( X < 7 ) = p(0) + p(1) + p(2) + p(3) + p(4) +
p(5) + p(6) = 0.297
Poisson Approximation to the Binomial
Distribution
• Since p is very small and n is very large,
approximate by the Poisson Distribution
E ( X ) = np = 8000 ( 0.001) = 8 = 
P( X < 7 ) = p(0) + p(1) + p(2) + p(3) + p(4) + p(5) +

e   x
p(6) =  f ( x)  x  0
6 6
x 0
 0.313
x!

You might also like