Random Variables Discrete Random Variables

advertisement
Random Variables
„
Discrete Random Variables
„
Dr. Tom Ilvento
BUAD 820
We will look at:
„
„
„
We will look at the probability Distribution for
Random Variables
Expected Values (mean) and Variance of
Random Variables
Special Distributions
„ Binomial Distribution
„ Normal Distribution
Example of a random variable
„
„
Nitrous Oxide Example
„
„
Let X = number of dentists in a random sample
of five dentists that use use laughing gas.
X is a random variable that can take on the
following values:
„ 0, 1, 2, 3, 4, 5
Random Variables – variables that assume
numerical values associated with random
outcomes from an experiment
Random variables can be:
„ Discrete
„ Continuous
Suppose we were recording the number of
dentists that use nitrous oxide (laughing gas)
in their practice
We know that 60% of dentists use the gas (a
priori for this problem, but most likely based on
a survey result).
„ P(Yes) = .6
„ P(No) = .4
Nitrous Oxide Example
„
We can list the values of our random variable X
X
0
1
2
3
4
5
1
Nitrous Oxide Example
„
Probability Distribution
And then assign probabilities to each value of
the random variable X
X
0
1
2
3
4
5
P(X)
.0102
.0768
.2304
.3456
.2592
.0778
„
„
„
How I assigned probabilities:
P(Yes) = .6 P(No) = .4
„
„
„
P(0) = (.4)(.4)(.4)(.4)(.4) =
.45
= .01024
P(1) = (.6)(.4)(.4)(.4)(.4) x 5 = .0768
„ 5 is the the number of combinations with only 1
doctor using the gas:
Or use the Cn,r formula
„ Yes No No No No
„ No Yes No No No
5
5!
120
⎛
⎞
„ No No Yes No No
=
=5
⎜ ⎟=
„ No No No Yes No
⎝ 1 ⎠ 1!(5 − 1)! 24
„ No No No No Yes
Note: we are assuming independence
Nitrous Oxide Example
What is the probability of less than 2 of 5
using laughing gas?
If I randomly selected 5 dentists, how many
would I expect to use laughing gas?
The last table shows the probability
distribution for the discrete random variable
X
The table is also referred as probability
distribution table
Properties of probability distribution
„ Each probability is between 0 and 1
„ The sum of the probabilities for all values of
x is equal to 1
Nitrous Oxide Example
X
0
1
2
3
4
5
P(X)
.0102
.0768
.2304
.3456
.2592
.0778
What is the probability of 4 of 5 dentists
selected randomly Using laughing gas?
Nitrous Oxide Example
• If I randomly selected 5 dentists, how
many would I expect to use laughing
gas?
• Expectation = 3
• We don’t have a way to solve this
yet, but we will
2
Nitrous Oxide Example: Graph of the
Probability distribution
Probability
Distribution of X
Types of Random Variables
„
0.4
p(X)
0.3
0.2
„
0.1
0
0
1
2
3
4
5
The variable in the dentist example is called a
discrete random variable
„ Finite countable number of distinct
possible values
„ We can assume that the values can be
listed or counted
Random Variables that fall along points on an
interval, and can’t be fully counted, are call
Continuous Random Variables
Number of Dentists
How can you tell it is a discrete
random variable?
„
„
„
Countable
Usually is described as “the number of…”
Tends to be whole numbers
„ Number of students applying to a university
„ Number of errors on a test
„ Number of bacteria per cubic centimeter of
water
„ Number of heart beats of a patient
To describe a discrete random
variable
„
„
Specifying a discrete random variable –
The number of Shields when tossing
two coins
„
Let X=number of Shields observed
Shield
Shield
Number
Number
„
Shield
Number
Shield
Number
SS
SN
NN
NN
So X takes on the following values of
Shields
O
1
2
NN
SN or NS
SS
Specify all the possible values it can
assume
Assign corresponding probabilities to
each value
Specifying a discrete random variable –
Tossing two coins and noting the number
of Shields
„
We can a priori assign probabilities to X
Number of
Heads
Sample
Points
0
NN
1
SN NS
2
SS
p(x)
Probabilities
.5 * .5 = .25
2(.5 * .5) = .50
.5 * .5 = .25
3
Specifying a discrete random variable –
Tossing two coins and noting the number
of Shields
„
„
This completely defines
the discrete random
variable X
Connecting probabilities
to the values results in
the probability
distribution
0.6
Probability Distribution: P(x)
„
Can be shown by a
0.5
„
0.4
„
„
0.3
„
0.2
0.1
„
0
0
1
Specifies the probability associated with
each value
Requirements:
„
2
The probabilities are distributed
over the values
„
Probability Distribution: P(x) for
Flipping Two Coins and Noting the
Number of Shields
„
Notation
„ P(x = 0)
„ P(x = 1)
„ P(x = 2)
„ P(x < 2)
„ P(x > 1)
P(x) ≥ 0 and ≤ 1
3P(x) = 1
for all values of x
Probability Distributions of Discrete
Random Variables
„
=
=
=
=
=
Graph
Table
Formula – will come later
„
„
Sometimes the probabilities are known a
priori
Sometimes they are observed in
experiments, a posteriori
And sometimes we supply the
probabilities based on subjective
information or a simulation (a what if
scenario)
The manager of a large computer network has
developed the following probability distribution
of the number of interruptions per day
The data and assigned probabilities based on past
experience
Interruptions (x)
P(x)
0
0.32
1
0.35
2
0.18
3
0.08
4
0.04
5
0.02
6
0.01
Open up Excel and enter these numbers in a worksheet
Probability Distribution of Network Interuptions
P9x)
„
0.4
0.35
0.3
0.25
0.2
0.15
0.1
0.05
0
0
1
2
3
4
5
6
# of Interuptions
Graph it using Inset, Graph, Bar Chart
4
Mean and Variance of a Discrete
Variable
„
„
We can think of our observed probability
distribution for x as having a mean and
variance
An expected value is another term for the
mean when dealing with a probability
distribution
Expected Values of Discrete
Random Variables
„
The expected value of a discrete random
variable is
n
E ( x) = ∑ xi ⋅ p ( xi ) = µ
i =1
The sum of each value times the
probability of that value
The Expectation of a Discrete
Variable
Excel example of network disruptions
1. I take each value of the discrete variable
2. Multiply by the probability associated with
the value
3. Sum the calculations
Interruptions (x)
0
1
2
3
4
5
6
n
E ( x) = ∑ xi ⋅ p ( xi ) = µ
i =1
Sum
Use your Excel file to calculate the
components of the expected value –
enter a new column of x* P(x)
„
The variance of a discrete random variable is
given as the
Expectation of the squared deviations about
the population mean:
n
E[( x − µ ) 2 ] = ∑ ( xi − µ ) 2 p( xi ) = σ 2
i =1
Sum of the squared deviation of each value from the
mean times the probability of the value
x*P(x)
0.00
0.35
0.36
0.24
0.16
0.10
0.06
1.00
1.27
Expected Value
The Variance of a Discrete
Random Variable
„
P(x)
0.32
0.35
0.18
0.08
0.04
0.02
0.01
The Variance of a Discrete
Variable
1.
2.
3.
4.
I take each value of the discrete variable
Subtract the mean
Square the result
Multiply by the probability associated with the
value
5. Then sum each of these calculations
n
E[( x − µ ) 2 ] = ∑ ( xi − µ ) 2 p( xi ) = σ 2
i =1
Use Excel to create another column of data
for the variance
5
Mean and Variance of Discrete
Random Variable
Components of the Variance
Interruptions (x)
0
1
2
3
4
5
6
Sum
P(x)
0.32
0.35
0.18
0.08
0.04
0.02
0.01
„
x*P(x)
Var Calc
0.00
0.00
0.35
0.03
0.36
0.19
0.24
0.72
0.16
1.19
0.10
1.39
0.06
1.34
1.00
1.27
„
„
Remember, we said the variance is the mean
squared deviation about the mean
The standard deviation is the square root of
the variance
In our example, σ = 2.20
4.86
Variance
Nitrous Oxide Example Expectation
Nitrous Oxide Example
X
0
1
2
3
4
5
X
0
1
2
3
4
5
P(X)
.0102
.0768
.2304
.3456
.2592
.0778
P(X)
.0102
.0768
.2304
.3456
.2592
.0778
If I randomly selected 5 dentists, how many
would I expect to use laughing gas?
E(X)= 0(.0102) + 1(.0768) + 2(.2304) +
3(.3456) + 4(.2592) + 5(.0778)
E(X) = 3.0002
Nitrous Oxide Example Expectation
Nitrous Oxide Example
X
0
1
2
3
4
5
X
0
1
2
3
4
5
P(X)
.0102
.0768
.2304
.3456
.2592
.0778
P(X)
.0102
.0768
.2304
.3456
.2592
.0778
If I randomly selected 5 dentists, what is the
variance (σ2)?
σ2 = (0-3)2(.0102) + (1-3)2(.0768) +
(2-3)2(.2304) + (3-3)2(.3456)
+ (4-3)2(.2592) + (5-3)2(.0778)
σ2 = 1.1998
σ = 1.09535 = 1.10
6
Probability Distribution of the
Discrete Variable X
Probability
Distribution of X
Simplified formula for the Variance
• E(X) = 3
• σ2 = 1.20
• σ = 1.10
0.4
σ 2 = ∑ (xi2 ⋅ P ( x) ) − µ 2
n
i =1
p(X)
0.3
0.2
1. Square each x value
0.1
2. Then multiply by P(x)
0
0
1
2
3
4
3. Add them all together
5
4. Then subtract µ2
Number of Dentists
Portfolio Expected Return
„
„
Portfolio data under different market conditions
can be thought of as a Discrete random
variable
We designated expected returns (x) under
different scenarios, and then assign
probabilities to these outputs
Portfolio Example
„
„
Enter this data into a new Excel
worksheet
Portfolio Analysis
„
Market Conditions
Depression
Recession
Stable
Growth
Probability Dell Return Gold Return
0.05
-0.20
0.05
0.30
0.10
0.20
0.50
0.30
-0.12
0.15
0.50
0.09
„
„
Calculate the mean, variance, and standard
deviation for each investment strategy
An investor plans to invest in Dell Computers
or in gold. She figures probabilities under four
market conditions – depression, recession,
stable, growth
She then assigns probabilities to each scenario,
and then estimated returns for Dell stock or
gold. The returns are percent increase in
value.
When I am interested in finding an optimal
investment strategy between two investment
strategies
I must also take into account the Covariance
of the two random variables.
The covariance takes in count how x and y
vary about their means together, weighted by
their joint probabilities
N
Leave the data in this form and use other
cell areas to make the calculations
σ xy = ∑ [xi − E ( x )][ yi − E ( y )]P ( xi yi )
i =1
7
Portfolio Analysis
„
Expected Value of the Sum of Two Random
Variables
Portfolio Analysis
„
E ( x + y ) = E ( x) + E ( y )
„
Variance of the Sum of Two Random
Variables
Var ( x + y ) = σ x2+ y = σ x2 + σ y2 + 2σ xy
Expected Return is based on the expected values of
each investment times the weight (w) given to that
investment in the portfolio (i.e., how much is invested
in each strategy
E ( P ) = (w)E ( x) + (1 − w) E ( y )
„
Portfolio risk is the standard deviation of the Return
σ P = w2σ x2 + (1 − w) 2 σ y2 + 2w(1 − w)σ xy
PHStat will do all of this for you!
„
„
„
Decision-Making
„ Covariance and Portfolio Management
„ Number of outcomes – 4
„ Check the Portfolio Management Analysis
You can copy the labels and your data into the
worksheet.
PHStat will calculate these values for you –
check your expected values and variances
8
Download