STT 200 (Section 102)

Download Report

Transcript STT 200 (Section 102)

STT 315
Ashwini Maurya
This lecture is based on Chapters 4.1-4.2
Acknowledgement: Author is thankful to Dr. Ashok Sinha, Dr. Jennifer Kaplan and Dr.
Parthanil Roy for allowing him to use/edit some of their slides.
Random Variable
• A random variable is a numerical variable, values of
which are associated to outcome(s) of some random
experiment.
• This means that the values of random variable depends
on chance.
• We usually denote them by capital letters like X, Y, Z etc.
Example:
• Suppose you toss a fair coin twice.
• Let X = the number of heads out of these two tosses.
• Then X is a variable which takes the values 0, 1, 2 but the
value depends on the outcome of two tosses, which is a
random event.
• Therefore, X is a random variable.
2
Two Types of Random Variables
• Discrete Random Variable:
These random variables can assume countable number
of values.
(e.g. – number of heads out of two tosses of a fair coin
– this random variable can only take values 0, 1, 2.)
• Continuous Random Variables:
These random variables can assume any value
contained in one or more intervals.
(e.g. – total amount of rainfall (in inches) in East
Lansing in 2011.)
We first discuss some discrete random variables, and
consider some continuous random variables later.
3
Probability distributions of
discrete random variables
4
Example
• X = number of heads in two tosses of a fair coin.
• X takes values 0, 1, 2.
Outcome of the tosses
TT
TH
HT
HH
Value of X
0
1
1
2
Probability
¼
¼
¼
¼
So, P(X=0) = ¼ , P(X=1) = ¼+¼ = ½ , P(X=2) = ¼.
We denote
p(x) = P(X=x).
x
p(x)
0
¼
½
¼
1
2
5
Probability distribution function
Consider a discrete random variable X and define the
function:
𝑝 𝑥 =𝑃 𝑋=𝑥 .
𝑝 𝑥 is called the probability distribution function of X.
𝑝 𝑥 satisfies the following two properties:
1. 0 ≤ 𝑝(𝑥) ≤ 1, for any real number 𝑥.
2. 𝑥 𝑝 𝑥 = 1 .
6
Another Example
• X = number of tails in three tosses of a fair coin.
• X takes values 0, 1, 2, 3.
Outcome of the tosses
HHH
HHT
HTH
THH
HTT
THT
TTH
TTT
Value of X
0
1
1
1
2
2
2
3
Probability
⅛
⅛
⅛
⅛
⅛
⅛
⅛
⅛
7
Another Example
Hence
• P(X=0) = ⅛,
• P(X=1) = ⅛ + ⅛+ ⅛ = ⅜,
• P(X=2) = ⅛ + ⅛+ ⅛ = ⅜, and
• P(X=3) = ⅛.
x
p(x)
0
1
⅛
⅜
2
⅜
3
⅛
8
Insurance Example
• Suppose the death rate in a year is 1 out of every 1000 people,
and another 2 out of 1000 suffer some kind of disability.
Suppose that an insurance company has to pay $10000 for death
and $5000 for disability.
• Define X = amount (in dollars) the insurance company has to pay
for one policyholder in a year.
• X takes values 10000, 5000, 0.
Policyholder
Outcome
Payout
(x)
Death
10000
1/1000 = 0.001
5000
2/1000 = 0.002
0
1-(0.001+0.002) = 0.997
Disability
Neither
Probability
p(x)
9
Expected Value
• For a discrete random variable X, the expected value of X (or
expectation of X) is defined as the sum of the terms value
times probability.
𝐸 𝑋 =
𝑥 𝑥𝑝
𝑥 = sum over (value × probability).
Suppose X takes values x1, x2,…, xn with probabilities p(x1),
p(x2),…, p(xn) respectively. Then
𝐸 𝑋 = 𝑥1 𝑝 𝑥1 + 𝑥2 𝑝 𝑥2 + ⋯ + 𝑥𝑛 𝑝 𝑥𝑛 .
• Often E(X) is also called mean of random variable X, and is
denoted by Greek letter μ.
• Roughly speaking, E(X) denotes the value you can expect X to
take on the average.
10
Insurance Example (revisited)
• Suppose the death rate in a year is 1 out of every 1000 people,
and another 2 out of 1000 suffer some kind of disability.
Suppose that an insurance company has to pay $10000 for death
and $5000 for disability.
• Define X = amount (in dollars) the insurance company has to pay
for one policyholder in a year.
• Then E(X) is computed as follows:
Policyholder
Outcome
Death
Disability
Neither
Payout
(x)
Probability
p(x)
10000
0.001
10000 × 0.001 = 10
5000
0.002
5000 × 0.002 = 10
0
0.997
0 × 0.997 = 0
xp(x)
[Summing] E(X) = 20
11
Tossing Coin Thrice Example (revisited)
• X = number of tails in three tosses of a fair coin.
• Then E(X) is computed as follows:
x
0
1
2
p(x)
⅛
⅜
⅜
xp(x)
0×⅛=0
1 × ⅜ = 0.375
2 × ⅜ = 0.75
3
⅛
3 × ⅛ = 0.375
E(X) = 1.5
On the average, you can expect 1.5 tails out of 3 tosses
of a fair coin.
12
Variance and Standard Deviation
• Variance of a random variable X is defined by
𝜎 2 = 𝑣𝑎𝑟(𝑋) =
𝑥 − 𝜇 2 𝑝(𝑥) .
𝑥
• Standard deviation of X is the square-root of the
variance of X
𝜎 = 𝑆𝐷 𝑋 = 𝑣𝑎𝑟(𝑋).
• If many random variables are involved we may write
𝜎(𝑋) or 𝜎𝑋 to identify.
• Variance has the square unit of the random variable,
whereas the standard deviation has the same unit as the
random variable.
13
Tossing Coin Thrice Example (revisited)
• X = number of tails in three tosses of a fair coin.
• Then var(X) is computed as follows:
x
0
1
2
3
p(x)
⅛
⅜
⅜
⅛
xp(x)
0×⅛=0
1 × ⅜ = 0.375
2 × ⅜ = 0.75
3 × ⅛ = 0.375
μ=E(X) = 1.5
[x – μ]2p(x)
(0-1.5)2 × ⅛ = 0.28125
(1-1.5)2 × ⅜ = 0.09375
(2-1.5)2 × ⅜ = 0.09375
(3-1.5)2 × ⅛ = 0.28125
σ2 = 0.75
Standard deviation: σ = √0.75 = 0.866.
14
TI 83/84 Plus commands
We can use TI 83/84 to compute mean and
standard deviation of a discrete random variable.
• Press [STAT]. Under EDIT select 1: Edit and press
ENTER.
• Columns with names L1, L2 etc. will appear.
• Type the values of random variable X under the
column L1 and the values of p(x) under the column
L2.
• Press [STAT] and choose CALC at the top.
• Then select 1: 1-Var Stats and press ENTER and 1Var Stats will appear on the screen. Press [2nd] & 1
(to get L1), then press , (comma) and then press
[2nd] & 2 (to get L2). Then press ENTER.
• We shall be needing mean (𝑥), standard deviation
(σx).
15
Properties: Expectation and Variance
• Expectation is the center of the probability
distribution of a random variable.
• Variance and standard deviations are measures of
spread of the probability distribution of a random
variable.
Larger the variance/standard deviation, larger the
spread (or dispersion).
• For any real numbers a and b
a) 𝐸 𝑎𝑋 + 𝑏 = 𝑎𝐸 𝑋 + 𝑏.
b) 𝜎 𝑎𝑋 + 𝑏 = |𝑎|𝜎 𝑋 .
• The Chebyshev and empirical rules are also valid
involving mean μ and standard deviation σ.
16
An example: A Gambling Game
• In a casino, you can play the following game: if you pay $10,
the game-manager will toss a fair coin 3 times. You will earn
$5 for every tail and nothing for the head(s).
What is your expected profit/loss from this game?
Is it wise to play this game over and over again?
• Let X = the number of tails out of 3 tosses of a fair coin, and Y
= your profit (in dollars) from this game.
• Then you will pay $10 and make $5X, and therefore,
Y = 5X - 10.
• From our previous calculation: 𝐸 𝑋 = 1.5, 𝜎 = 0.866.
• Your expected profit:
E(Y) = E(5X - 10) = 5E(X) - 10 = (5 × 1.5) - 10 = -2.5.
• It is not wise to play this game because on the average, you
are expected to lose $2.5 per game.
17
An example: A Gambling Game
• In a casino, you can play the following game: if you pay $10, the
game-manager will toss a fair coin 3 times. You will earn $5 for
every tail and nothing for the head(s).
What is the variance of your profit from this game?
What is the standard deviation of your profit from this game?
• As we have seen your profit (in dollars) from this game is
Y = 5X - 10.
Your expected profit:
E(Y) = E(5X - 10) = 5E(X) - 10 = (5 × 1.5) - 10 = -2.5.
• So standard deviation of your profit:
σ(Y) = σ(5X - 10) = 5σ(X) = 5 × 0.866 = 4.33,
and variance is
σ2 (Y) = (4.33)2 = 18.75.
18