You are on page 1of 48

Random Variable

Chocolate Data
Random Variables and Discrete
Probability Distributions

Random variable
A function that assigns numerical values to the

outcomes of a random experiment.


Denoted by uppercase letters (e.g., X ).

Values of the random variable are denoted by


corresponding lowercase letters.
Corresponding values of the random variable:

x1, x2, x3, . . .

LO 5.1
Random Variables and Discrete
Probability Distributions
Random variables may be classified as:
Discrete

The random variable assumes a countable number


of distinct values.
Continuous
The random variable is characterized by (infinitely)
uncountable values within any interval.

LO 5.1
Random Variables and Discrete
Probability Distributions
Consider an experiment in which two shirts are selected
from the production line and each is either defective (D)
or non-defective (N).
Here is the sample space:
(D,D)
The random variable X is (D,N)
the number of defective shirts. (N,D)
(N,N)
The possible number of
defective shirts is the set {0, 1, 2}.
Since these are the only a countable number of possible
outcomes, this is a discrete random variable.

LO 5.1
Random Variables and Discrete
Probability Distributions
Every random variable is associated with a probability
distribution that describes the variable completely.
A probability mass function is used to describe discrete
random variables.
A probability density function is used to describe
continuous random variables.
A cumulative distribution function may be used to
describe either discrete or continuous random variables.

LO 5.2
Random Variables and Discrete
Probability Distributions
The probability mass function for a discrete random
variable X is a list of the values of X with the associated
probabilities, that is, the list of all possible pairs

x,P X x
The cumulative distribution function for X is defined as

P X x

LO 5.2
Random Variables and Discrete
Probability Distributions
Two key properties of discrete probability distributions:
The probability of each value x is a value between
0 and 1, or equivalently

0 P X x 1
The sum of the probabilities equals 1. In other words,

= =1
where the sum extends over all values x of X.

LO 5.2
EXAMPLE

A random variable has the following probability


distribution:
x :0 1 2 3 4 5 6 7 8
P(x): k 2k 4k 6k 8k 10k 12k 14k 16k
Find
i) k, ii) P(X<3), iii) P ( X 3)
Solution
Soln. Since P(x) is a pmf,
i) k+2k+4k+6k+8k+10k+12k+14k+16k=1
k =1/73
ii) P(X=0)+P(X=1)+P(X=2)=7k=7/73
iii)1-P(X<3)=7/73
Random Variables and Discrete
Probability Distributions
Example: Consider the probability distribution
that reflects the number of credit cards that
Bankrate.coms readers carry:
Is this a valid probability
distribution?
What is the probability that a
reader carries no credit cards?
What is the probability that a
reader carries fewer than two?
What is the probability that a reader carries at least two credit
cards?
LO 5.2
Random Variables and Discrete
Probability Distributions
Consider the probability distribution that reflects the
number of credit cards that Bankrate.coms readers
carry:
Yes, because 0 < P(X = x) < 1
and SP(X = x) = 1.
P(X = 0) = 0.025
P(X < 2) = P(X = 0) + P(X = 1)
= 0.025 + 0.098 = 0.123.
P(X > 2) = P(X = 2) + P(X = 3)
+ P(P = 4*) = 0.166 + 0.165 + 0.546 = 0.877.
Alternatively, P(X > 2) = 1 P(X < 2) = 1 0.123 = 0.877.

LO 5.2
Expected Value, Variance, and Standard
Deviation
Summary measures for a random variable
include the
Mean (Expected Value)

Variance

Standard Deviation

LO 5.3
Expected Value, Variance, and Standard
Deviation
Expected Value Population Mean
E(X)
E(X) is the long-run average value of the random variable over
infinitely many independent repetitions of an experiment.
For a discrete random variable X with values x1, x2, x3, . . .
that occur with probabilities P(X = xi), the expected value
of X is the probability weighted average of the values:

E X xi P X x i

LO 5.3
Expected Value, Variance, and Standard
Deviation
Variance and Standard Deviation
For a discrete random variable X with values x1, x2, x3, . . . that
occur with probabilities P(X = xi), the variance is defined as:

Var X xi P X xi
2 2

xi2P X xi 2
The standard deviation is the square root of the variance.

SD X 2

LO 5.3
Expected Value, Variance, and Standard
Deviation
Example: Brad Williams, owner of a car dealership in
Chicago, decides to construct an incentive
compensation program based on performance.

Calculate the expected value of the annual bonus amount.


Calculate the variance and standard deviation of the annual
bonus amount.

LO 5.3
Expected Value, Variance, and Standard
Deviation
Solution: Let the random variable X denote the bonus
amount (in $1,000s) for an employee.

. = = xi P(X = xi) = 4.2, or $4,200


E(X)

Var(X) = 2 = (xi )2P(X = xi) = 9.97, or 9.97 (in ($1,000s)2)

SD(X) = = 9.97 = 3.158, or $3,158


LO 5.3
pmf (example)

x P(x)
0 0.05
1 0.05
The probability distribution of 2 0.06
booking of rooms of a hotel in 3 0.10
Waynad during December is: 4 0.13
5 0.20
6 0.15
7 0.26
Total 1.00
pmf (example)
x P(x) x P(x)
0 0.05 0.00
First find the expected value 1 0.05 0.05
7 2 0.06 0.12
E ( X ) xi P ( xi ) 3 0.10 0.30
i 1 4 0.13 0.52
5 0.20 1.00
= 4.71 rooms 6 0.15 0.90
7 0.26 1.82
Total 1.00 = 4.71
pmf (example)
7
V ( X ) 2 [ xi ]2 P ( xi )
The E(X) is then
used to find i 1
the variance: x P(x) x P(x) [x]2 [x]2 P(x)

= 4.2259 0 0.05 0.00 22.1841 1.109205


1 0.05 0.05 13.7641 0.688205
The standard 2 0.06 0.12 7.3441 0.440646
deviation is: 3 0.10 0.30 2.9241 0.292410
4 0.13 0.52 0.5041 0.065533
= 4.2259 5 0.20 1.00 0.0841 0.016820
= 2.0577 rooms 6 0.15 0.90 1.6641 0.249615
7 0.26 1.82 5.2441 1.363466
Total 1.00 = 4.71 2 =
4.225900
pmf (example)

The histogram shows that the distribution is skewed


to the left and bimodal.
0.30

0.25
The mode is 7 0.20

Probability
rooms rented but 0.15

the average is only 0.10

4.71 room rentals. 0.05

0.00
0 1 2 3 4 5 6 7
Num ber of Room s Rented

= 2.06 indicates considerable variation around .


Laws of Expected Value
E(c) = c
The expected value of a constant (c) is just the value of the constant.

E(X + c) = E(X) + c
E(cX) = cE(X)
We can pull a constant out of the expected value expression (either as part of
a sum with a random variable X or as a coefficient of random variable X).
Example
Monthly sales have a mean of $25,000 and a standard deviation of
$4,000. Profits are calculated by multiplying sales by 30% and
subtracting fixed costs of $6,000.
Find the mean monthly profit.

1) Describe the problem statement in algebraic terms:


sales have a mean of $25,000 E(Sales) = 25,000
profits are calculated by Profit = .30(Sales) 6,000
Example
Monthly sales have a mean of $25,000 and a standard deviation of
$4,000. Profits are calculated by multiplying sales by 30% and
subtracting fixed costs of $6,000.
Find the mean monthly profit.

E(Profit) =E[.30(Sales) 6,000]


=E[.30(Sales)] 6,000 [by rule #2]
=.30E(Sales) 6,000 [by rule #3]
=.30(25,000) 6,000 = 1,500
Thus, the mean monthly profit is $1,500
Laws of Variance
V(c) = 0
The variance of a constant (c) is zero.

V(X + c) = V(X)
The variance of a random variable and a constant is just the variance of the
random variable (per 1 above).

V(cX) = c2V(X)
The variance of a random variable and a constant coefficient is the coefficient
squared times the variance of the random variable.
Example
Monthly sales have a mean of $25,000 and a standard deviation of $4,000.
Profits are calculated by multiplying sales by 30% and subtracting fixed costs
of $6,000.
Find the standard deviation of monthly profits.

1) Describe the problem statement in algebraic terms:


sales have a standard deviation of $4,000
V(Sales) = 4,0002 = 16,000,000
(remember the relationship between standard deviation and variance
)
profits are calculated by Profit = .30(Sales) 6,000
Example
Monthly sales have a mean of $25,000 and a standard deviation of $4,000. Profits
are calculated by multiplying sales by 30% and subtracting fixed costs of $6,000.
Find the standard deviation of monthly profits.

2) The variance of profit is = V(Profit)


=V[.30(Sales) 6,000]
=V[.30(Sales)] [by rule #2]
=(.30)2V(Sales) [by rule #3]
=(.30)2(16,000,000) = 1,440,000
Again, standard deviation is the square root of variance,
so standard deviation of Profit = (1,440,000)1/2 = $1,200
Example
Monthly sales have a mean of $25,000 and a standard deviation of
$4,000. Profits are calculated by multiplying sales by 30% and
subtracting fixed costs of $6,000.
Find the mean and standard deviation of monthly profits.

The mean monthly profit is $1,500

The standard deviation of monthly profit is $1,200


Bivariate Data
Scatter Plots and Correlation

A scatter plot (or scatter diagram) is used to


show the relationship between two variables
Correlation analysis is used to measure
strength of the linear association between
two variables
Only concerned with strength of the
relationship
No causal effect is implied
Scatter Plot Examples

Linear relationships Curvilinear relationships

y y

x x

y y

x x
Strong relationships Weak relationships

y y

x x

y y

x x
No relationship

x
Correlation Coefficient

The correlation coefficient (r) is used


to measure the strength of the linear
relationship in the sample observations
Calculating sample Correlation Coefficient

cov( x, y )
rxy
sx s y
1
cov( x, y ) ( xi x )( yi y )
n
1 1
sx
n
( xi x ) 2
s y
n
( y i y ) 2
Features of correlation coefficient

Unit free
Range between -1.00 and 1.00
-1r<0 implies that as X (), Y ( )
0< r1 implies that as X (), Y ()
The closer to -1.00, the stronger the negative linear relationship
The closer to 1.00, the stronger the positive linear relationship
The closer to 0.00, the weaker the linear relationship
r=0 implies that X and Y are not linearly associated
Examples of Approximate r Values

y y y

x x x
r = -1.00 r = -.60 r = 0.00
y y

x x
r = 0.20 r = 1.00
Portfolio Returns
Investment opportunities often use
Expected return as a measure of reward.
Variance or standard deviation of return as a measure of risk.
A portfolio is defined as a collection of assets such as stocks
and bonds.
Let X and Y represent two random variables of interest, denoting the
returns of two assets.
If an investor has invested in both assets, we want to evaluate the
return generated by the portfolio, which is a linear combination of X
and Y.
Portfolio Returns
Properties of random variables useful in evaluating
portfolio returns.
Given two random variables X and Y,
The expected value of X and Y is

E X Y E X E Y
The variance of X and Y is
Var X Y Var X Var Y 2Cov X ,Y
where Cov(X,Y) is the covariance between X and Y.
For constants a, b, the formulas extend to
E aX bY aE X bE Y
Var aX bY a2Var X b2Var Y 2abCov X ,Y
LO 5.5
Portfolio Returns
Expected return, variance, and standard
deviation of portfolio returns.
Given a portfolio with two assets, Asset A and Asset
B, the expected return of the portfolio E(Rp) is
computed as:
E Rp w AE RA wBE RB

wA and wB are the portfolio weights


wA + w B = 1
E(RA) and E(RB) are the expected returns on assets A and B,
respectively.
LO 5.5
Portfolio Returns
Expected return, variance, and standard deviation of
portfolio returns.
Using the covariance or the correlation coefficient of the two
returns, the portfolio variance of return is:

Var Rp w A2 A2 wB 2 B 2 2w AwB AB A B
2 and 2 are the variances of the returns for Asset A and Asset
B
is the covariance between the returns for Asset A and Asset
B
is the correlation coefficient between the returns for Asset A
and Asset B.
LO 5.5
Portfolio Diversification and Asset Allocation

Consider an investor who forms a portfolio, consisting of only two stocks, by


investing $4,000 in one stock and $6,000 in a second stock. Suppose that the results
after 1 year are:
One-Year Results
Initial Value of Investment Rate of Return
Stock Investment After One Year on Investment
1 $4,000 $5,000 R1 = .25 (25%)
2 $6,000 $5,400 R2 =-.10 (-10%)
Total $10,000 $10,400 Rp = .04 ( 4%)

OR
Rp = w1R1 + w2R2 = (.4)(.25) + (.6)(-.10) = .04
Portfolio Diversification and Asset Allocation

Mean and Variance of a Portfolio of Two Stocks

E(Rp) = w1 E(R1) + w2 E(R2)


V(Rp) = w12 V(R1) + w22 V(R2) + 2w1w2 COV(R1, R2)
= w1212 + w2222 + 2w1w212

where w1 and w2 are the proportions or weights of investments 1 and


2, E(R1) and E(R2) are their expected values, 1 and 2 are their standard
deviations, and is the coefficient of correlation
Example

An investor has decided to form a portfolio by putting 25% of his money into
McDonalds stock and 75% into Cisco Systems stock. The investor assumes
that the expected returns will be 8% and 15%, respectively, and that the
standard deviations will be 12% and 22%, respectively.
a Find the expected return on the portfolio.
b Compute the standard deviation of the returns on the portfolio assuming
that
(i) the two stocks returns are perfectly positively correlated
(ii) the coefficient of correlation is .5
(iii) the two stocks returns are uncorrelated
Solution

The expected values of the two stocks are


E(R1) = .08 and E(R2) = .15
The weights are w1 = .25 and w2 = .75.
Thus,

E(R2) = w1E(R1) + w2E(R2)


= .25(.08) + .75(.15)
= .1325
Solution

The standard deviations are 1 = .12 and 2 = .22. Thus,


V(Rp) = w1212 + w2222 + 2w1w212
= (.252)(.122) + (.752)(.222) + 2(.25)(.75) (.12)(.22)
= .0281 + .0099

When = 1
V(Rp) = .0281 + .0099(1) = .0380
When = .5
V(Rp) = .0281 + .0099(.5) = .0331
When = 0
V(Rp) = .0281 + .0099(0) = .0281
Portfolios with More Than Two Stocks
We can extend the formulas that describe the mean and variance of the returns of a
portfolio of two stocks to a portfolio of any number of stocks.

Mean and Variance of a Portfolio of k Stocks


k
E(Rp ) =
w E(R )
i 1
i i

k k k
V(Rp ) =

i 1
w w COV(R , R )
w i2 i2 2
i 1 ji 1
i j i j

Where Ri is the return of the ith stock, wi is the proportion of the portfolio invested in stock i, and k is the number of
stocks in the portfolio.
Portfolios with More Than Two Stocks

When k is greater than 2 the calculations can be tedious and time-


consuming. For example, when k = 3, we need to know the values of
the three weights, three expected values, three variances, and three
covariances. When k = 4, there are four expected values, four variances
and six covariances. [The number of covariances required in general is
k(k-1)/2.] To assist you we have created an Excel worksheet to perform
the computations when k =2, 3, or 4. (For larger values of k, see the
reference at the end of the chapter.) To demonstrate well return to the
problem described in this chapters introduction.

You might also like