Chapter 4
Discrete Random Variables and Probability
Distributions
Dr. Hui Feng
King’s University College
2022 Fall
Outline
• Random Variable: Discrete and Continuous
• Probability Distributions
• Properties of Discrete Random Variable: Mean & Variance
• Binomial Distribution
• Jointly Distributed Random Variables
Fall 2022
ECO2222
4.1
Random Variables
• Random Variable
• Represents a possible numerical value from a
random experiment
Random
Variables
Ch. 4 Discrete Continuous Ch. 5
Random Variable Random Variable
Fall 2022
ECO2222
Discrete Probability Distributions
• Probability Distribution Function (p.d.f.), P(x), of a
discrete random variable X expresses the probability that X
takes the value x, as a function of x:
P(x) = P(X=x), for all values of x
Other textbook refers this to the probability mass function
• Cumulative Probability Function, F(x ), for a random
0
variable X, denotes the probability that X does not exceed
the value x .
0
F(x ) = P (X ≤ x )
0 0
Where the function is evaluated at all values of x0
Fall 2022 ECO2222
4.2
Discrete Probability Distribution
Experiment: Toss 2 Coins. Let X = # heads.
Show P(x) , i.e., P(X = x) , for all values of x:
4 possible outcomes Probability Distribution
x P(x) F(x)
T T
0 ¼=0. 0.25
T H 25
1 2/4=0 0.75
H T .5
Probability
.50
.25 2 ¼=0. 1
H H 25
Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall
0 1 2 x Ch. 4-5
4.2 Discrete Probability Distribution
• Properties of p.d.f:
1. 0 ≤ P(x) ≤ 1
2. P( x) 1
x
• Properties of c.p.f for discrete random variables
1. 0 ≤ F(x ) ≤ 1 for every number of x
0 0
2. If x and x are two numbers with x ≤ x then,
0 1 0 1
F( x ) ≤ F( x )
𝐹 (𝑥0 )=∑ 𝑃(𝑥)
0 1
• Relationship between p.d.f. and c.d.f
𝑥0
Where the notation implies that summation is over all possible values of x that
les than or equal to x0
Fall 2022 ECO2222
Expected Value
• Expected Value (or mean) of a discrete distribution
μ E(X) xP(x)
x
x P(x)
• Example: Toss 2 coins,
0 .25
x = # of heads,
1 .50
compute expected value of x:
2 .25
E(x) = (0 x .25) + (1 x .50) + (2 x .25) = 1.0
Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-7
Variance & Standard Deviation
• Variance of a discrete random variable X
σ 2 E[(X μ)2 ] (x μ)2 P(x)
x
Can also be expressed as σ 2 E[X 2 ] μ2 x 2 P(x) μ2
x
• Standard Deviation of a discrete random variable X
σ σ 2
(x μ) P(x)
x
2
Standard Deviation Example
σ (x
x
μ) 2
P(x)
• Example: Toss 2 coins, X = # heads,
compute standard deviation (recall E(x) = 1)
σ (0 1)2 (.25) (1 1)2 (.50) (2 1)2 (.25) .50 .707
Possible number of heads
= 0, 1, or 2 Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-9
Expected Value of Functions of a Random Variable
• E (k) = k Var (k) = 0
• E[g(x)] = g ( x) P( x)
x
• E (kX) = k E(X) =k µ Var (kX) = k2 Var(X) = k2 2
• For linear Function: y = a + bx
y E (a bx) (a bx)P( x) aP ( x) bxP ( x)
x x x
a b xP ( x) a b x
x
• Variance and Standard Deviation:
y2 Var (a bx) b 2 x2
y | b | x
• Standardized form X x E(Z) = ? Var(Z)
Z
= ?? x
Fall 2022 ECO2222
Probability Distributions
Probability
Distributions
Ch. 4 Discrete Continuous Ch. 5
Probability Probability
Distributions Distributions
Binomial Uniform
Hypergeometric Normal
Poisson t-distribution Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-11
4.4 Binomial Distribution
• Bernoulli distribution:
• Each repetition of an experiment involving only two
mutually exclusive and collectively exhaustive outcomes.
• Bernoulli Random Variable: X={0,1}
p.d.f. P(x=1)= P and P(x=0)= 1-P
E ( X ) xP( x) 0 (1 P) 1P P
x
2 E[( x ) 2 ] ( x ) 2 P( x)
x
Fall 2022 ECO2222
(0 P ) 2 (1 P ) (1 P ) 2 P P (1 P )
• Suppose that a random experiment can result in two possible mutually
exclusive and collectively exhaustive outcomes, “success” and “failure,” and
that p is the probability of a success resulting in a single trial. If n independent
trials are carried out, the distribution of the resulting number of successes “x” is
called the binomial distribution.
Its probability distribution function for the binomial random
variable X = x is:
n x ( n x)
P (x successes in n independent trials) = P ( x) C p (1 p )
x
for x = 0, 1, 2 . . . , n
• Mean and Variance
• Mean =E(X)=np
• Variance 2 E[( x ) 2 ] np(1 p )
Fall 2022 ECO2222
Possible Binomial Distribution Settings
• A manufacturing plant labels items as either defective or
acceptable
• A firm bidding for contracts will either get a contract or not
• A marketing research firm receives survey responses of “yes I
will buy” or “no I will not”
• New job applicants either accept the offer or reject it
Fall 2022
ECO2222
Binomial Probability Distribution
A fixed number of observations, n
e.g., 15 tosses of a coin; ten light bulbs taken from a warehouse
Two mutually exclusive and collectively exhaustive categories
e.g., head or tail in each toss of a coin; defective or not defective light bulb
Generally called “success” and “failure”
Probability of success is P , probability of failure is 1 – P
Constant probability for each observation
e.g., Probability of getting a tail is the same each time we toss the coin
Observations are independent
The outcome of one observation does not affect the outcome of the other
Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-15
The Binomial Distribution
n! X n- X
P(x) = P (1- P)
x ! (n - x )!
n!
P(x) = probability of x successes in n trials, Cnx
x! (n x)!
with probability of success P on each trial
Example: Flip a coin four Example: Flip a coin
x = number of ‘successes’ in sample, times, let x = # heads: twice, let x = # heads:
(x = 0, 1, 2, ..., n)
n=4 n=2
n = sample size (number of independent
P = 0.5 P = 0.5
trials or observations) 1 - P = (1 - 0.5) = 0.5 1 - P = (1 - 0.5) = 0.5
P = probability of “success” x = 0, 1, 2, 3, 4 x = 0, 1, 2
Calculating a Binomial Probability
What is the probability of one success in five observations if
the probability of success is 0.1?
x = 1, n = 5, and P = 0.1
n X n!
P(x 1) C P (1 P) n
x
X
P X (1 P) n X
x!(n x)!
5!
(0.1)1 (1 0.1)5 1
1!(5 1)!
(5)(0.1)(0.9) 4
.32805 Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-17
Binomial Distribution
• The shape of the binomial distribution depends on the values of P and n
Mean P(x) n = 5 P = 0.1
.6
Here, n = 5 and P = 0.1 .4
μ nP (5)(0.1) 0.5 .2
0 x
σ nP(1- P) (5)(0.1)(1 0.1) 0 1 2 3 4 5
0.6708
P(x) n = 5 P = 0.5
Here, n = 5 and P = 0.5 .6
μ nP (5)(0.5) 2.5 .4
.2
σ nP(1- P) (5)(0.5)(1 0.5) 0 x Fall 2022
ECO2222
1.118 0 1 2 3 4 5
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-18
Using Binomial Tables
N x … p=.20 p=.25 p=.30 p=.35 p=.40 p=.45 p=.50
10 0 … 0.1074 0.0563 0.0282 0.0135 0.0060 0.0025 0.0010
1 … 0.2684 0.1877 0.1211 0.0725 0.0403 0.0207 0.0098
2 … 0.3020 0.2816 0.2335 0.1757 0.1209 0.0763 0.0439
3 … 0.2013 0.2503 0.2668 0.2522 0.2150 0.1665 0.1172
4 … 0.0881 0.1460 0.2001 0.2377 0.2508 0.2384 0.2051
5 … 0.0264 0.0584 0.1029 0.1536 0.2007 0.2340 0.2461
6 … 0.0055 0.0162 0.0368 0.0689 0.1115 0.1596 0.2051
7 … 0.0008 0.0031 0.0090 0.0212 0.0425 0.0746 0.1172
8 … 0.0001 0.0004 0.0014 0.0043 0.0106 0.0229 0.0439
9 … 0.0000 0.0000 0.0001 0.0005 0.0016 0.0042 0.0098
10 … 0.0000 0.0000 0.0000 0.0000 0.0001 0.0003 0.0010
Examples:
n = 10, x = 3, P = 0.35: P(x = 3|n =10, p = 0.35) = .2522
n = 10, x = 8, P = 0.45: P(x = 8|n =10, p = 0.45) = .0229
Fall 2022
ECO2222
10 students invited to a party, p(attending)=0.85, P(x>8)=?
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-19
Two-Variable Case: Jointly Distributed Discrete Random Variables
P( x y) = P(X = x Y = y) Joint Probability Function
P ( x) P ( xy )
y
P ( y ) P ( xy )
x
Marginal Probability Function
P( xy )
P( y | x)
P( x)
P( xy )
P( x | y )
P( y ) Conditional Probability Function
Good and Defective Batteries Produced in Three Different Plants
Plant Plant Plant y/x X=1 X=2 X=3
1 2 3
Good 490 1970 1455 3915
Y=1 490 1970 /4000 1455
/4000 /4000
Bad 10 30 45 85
Fall 2022 ECO2222 Y=0 10 /4000 30 /4000 45 /4000
500 2000 1500 4000
• Properties of Joint Probability Functions
1. 0 < P( xy ) < 1 for any pair of values x and y.
2. The sum of the joint probabilities P( x, y) over all possible pairs of values must be
1.
• Independence of Joint Distributed Variables
X and Y are independent if and only if
P(xy) = P(x) P(y)
Cov( x, y ) E[( X x )(Y y )] ( x x )( y y ) P ( xy )
• Covariance and Correlation x y
Cov( X , Y )
Corr ( X , Y )
x y
E[ g ( X , Y )] g ( x, y ) P ( xy )
x y
• Statistical independence Covariance is 0
(However, the converse is not necessarily true)
Fall 2022 ECO2222
• Summary Results
1. E ( X Y ) x y
2 2
2. Var ( X Y ) x y 2Cov( X , Y )
2 2
3. Var ( X Y ) x y 2Cov( X , Y )
4. E ( X 1 X 2 ... X k ) 1 2 ... k
2 2 2
5. Var ( X 1 X 2 ... X k ) 1 2 ... k if Cov( X i , X j ) 0
i, j 1, 2, ..., k
Fall 2022 ECO2222
Portfolio Analysis
• Let random variable X be the price for stock A
• Let random variable Y be the price for stock B
• The market value, W, for the portfolio is given by the linear
function
W aX bY
(a is the number of shares of stock A, b is the number of shares of
stock B) Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-23
Portfolio Analysis (continued)
• The mean value for W is
μW E[W] E[aX bY]
aμX bμY
• The variance for W is
2 2 2
σ W a σ X b 2σ 2Y 2abCov(X, Y)
or using
σ 2W the
acorrelation
σ X b 2σ 2Yformula
2 2
2abCorr(X, Y)σ Xσ Y Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-24
Example: Investment Returns
Return per $1,000 for two types of investments
Investment
P(xi), P(yi) Economic condition Passive Fund X Aggressive Fund Y
.2 Recession - $ 25 - $200
.5 Stable Economy + 50 + 60
.3 Expanding Economy + 100 + 350
E(x) = μx = (-25)(.2) +(50)(.5) + (100)(.3) = 50
E(y) = μy = (-200)(.2) +(60)(.5) + (350)(.3) = 95 Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-25
Computing the Standard
Deviation for Investment Returns
Investment
P(xiyi) Economic condition Passive Fund X Aggressive Fund Y
0.2 Recession - $ 25 - $200
0.5 Stable Economy + 50 + 60
0.3 Expanding Economy + 100 + 350
σ X (-25 50)2 (0.2) (50 50)2 (0.5) (100 50)2 (0.3)
43.30
σ y (-200 95)2 (0.2) (60 95)2 (0.5) (350 95)2 (0.3)
Fall 2022
193.71 ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-26
Covariance for Investment
Returns
Investment
P(xiyi) Economic condition Passive Fund X Aggressive Fund Y
.2 Recession - $ 25 - $200
.5 Stable Economy + 50 + 60
.3 Expanding Economy + 100 + 350
Cov(X, Y) (-25 50)(- 200 95)(.2) (50 50)(60 95)(.5)
(100 50)(350 95)(.3)
8250
r = Corr(X,Y) = Cov(X,Y) / (xy) = 8250 / (44.3×193.71) = 0.961 Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-27
Interpreting the Results for Investment Returns
• The aggressive fund has a higher expected return, but much more risk
μy = 95 > μx = 50
but
σy = 193.21 > σx = 43.30 r=0.961
CVy = 193.21/95 > CVx= 43.3/50
• Both correlation coefficient and covariance indicate that the
two investments are positively related and will vary in the Fall 2022
ECO2222
same direction, while fund Y has a relatively volatile move.
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-28
Portfolio Example
Investment X: μx = 50 σx = 43.30
Investment Y: μy = 95 σy = 193.71
σxy = 8250 rxy=0.961
Suppose 40% of the portfolio (P) is in Investment X and 60% is in Investment Y:
P=0.4X+0.6Y
E(P) .4 (50) (.6) (95) 77
σ P (.4) 2 (43.30) 2 (.6)2 (193.21) 2 2(.4)(.6)( 8250)
133.04 Fall 2022
ECO2222
Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall Ch. 4-29
Chapter Summary
• Defined discrete random variables and probability
distributions
• Discussed the Binomial distribution
• Reviewed the Poisson distribution (read)
• Discussed the Hypergeometric distribution (skipped)
• Defined covariance and the correlation between two
random variables
• Examined application to portfolio investment
Fall 2022 ECO2222