Upload
others
View
1
Download
0
Embed Size (px)
Citation preview
Expectation of Discrete and Continuous Random
Variables
Previously on CSCI 3022Def: a probability mass function is the map between the discrete random variable’s values and the probabilities of those values
f(a) = P (X = a)
Def: A random variable X is continuous if for some function and for any numbers and with
The function has to satisfy for all x and . We call the probability density function of X.
f : R ! Ra b a b
f(x) � 0R1�1 f(x) dx = 1 f
P (a X b) =
Z b
af(x) dx
Chuck-a-LuckRecall: Chuck-a-luck involves placing a bet on a number and rolling 3 dice. If your number appears you win your bet times the number of times your number appears. If your number does not appear you lose your bet.
Question: How much money to you expect to win/lose on average if you play many games?LET X BE Blnomlal R✓w/ na ] & p= 16
3- (3) a) 3+2 ( ZKIIYE )+l( 3.)HHE)?i(keep= Eet Eta + EE - El.=fDEiE -0.079
t 3 PCZFNES ) + ZPCZFNES ) HPaFN8) -IPLOFNID=
Expectation of a Discrete RVDef: The expectation, expected value, or mean of a discrete random variable X taking the values and with probability mass function p is the numbera1, a2, . . .
E[X] =X
i
aiP (X = ai) =X
i
aip(ai)= =
I =±§±xi = ,±§±×i
Expectation of a Discrete RVDef: The expectation, expected value, or mean of a discrete random variable X taking the values and with probability mass function p is the numbera1, a2, . . .
Intuition: Think of masses of weight placed at the points p(ai) ai
E[X] =X
i
aiP (X = ai) =X
i
aip(ai)
.in#Hs
Expectation of a Discrete RVExample: Let X be a Bernoulli random variable with parameter p. What is ? E[X]
X - { 0,1 } pco )=CtP) pa )=p
EFX ]= o.fi#tl.p=p
Expectation of a Discrete RVExample: Suppose you and a friend are avoiding studying by each rolling a fair die. You decide that the first time that you roll the same number you’ll go back to work. What is the expected number of times you’ll roll the dice before getting a match?
I aipl Xeai ) p= 116i
LET X Be THE RV PESCR (Bing# of Rolls
EFXI = 1. p+ 2 . PA - F) + 3. pctppt - . .
oo oo
Efx ] = 2 ,
Ipa-
p
)kt=Z ,1M¥ ) pa - pm
K =/ m=o
00 00
= Epa- pm + I, mpa - pm
m=o m=o
Expectation of a Discrete RVExample: Suppose you and a friend are avoiding studying by each rolling a fair die. You decide that the first time that you roll the same number you’ll go back to work. What is the expected number of times you’ll roll the dice before getting a match?
Efx ] = IT pa - pm + Egg mpa - pm
=p Egg a- pm + it'sE?mP' ' PM
"
EIXI =p- tTp , + a-PETITE
E EX ] + Cp - DE Ix ] =/ ¥ELIE /
From Discrete to ContinuousExample: Let X be a continuous random variable whose density function is nonzero on [0,1].
DISCRETE CONTINUOUS- -
EfxJ=§aiPlX=aD EtXT=[o§fcx)d×
Expectation of a Continuous RVDef: The expectation, expected value, or mean of a continuous random variable X with probability density function is the numberf
E[X] =
Z 1
�1xf(x)dx
Expectation of a Continuous RVDef: The expectation, expected value, or mean of a continuous random variable X with probability density function is the numberf
E[X] =
Z 1
�1xf(x)dx
Intuition: Think of a big (one-dimensional) rock balancing on a fulcrum
Expectation of a Continuous RVExample: The lifetime (in years) of a certain brand of battery is Exponentially distributed with parameter . How long, on average, will this battery last? � = 0.25 0+4 YEARS
Xrexpex ) fix)={te→××> 0
0 ×< o
E[xT=[a0xfix)dx= fPx(xe→×)dx= . .joie . EE Xttz
Expectation of a Continuous RVExample: The lifetime (in years) of a certain brand of battery is Exponentially distributed with parameter . How long, on average, will this battery last? � = 0.25
Follow-Up: Suppose you have observed that, on average, 300 cars cross a particular bridge every day. How much time do you expect to wait between two cars crossing the bridge?
Tv Exp(X=3oo) El'TJ=¥ = ztoo
Expectation of Functions of RVsOften times we want to compute the expectation of a function of a random variable instead of the random variable itself. For instance, we might want to compute instead of E[X2] E[X]
Example: Suppose an architect is designing a community and wants to maximize the diversity in the size of his square buildings that are of both width and depth , but is uniformly distributed between 0 and 10 meters. What is the distribution of the area
of a building?
X X
X2
Lxgx*
vetoo±x±io
Y = X2= AREA OF House
OEYELOO
Fyly )=P(Y±y)=PCX'a- g)
=P(X±Fy)='I10
Expectation of Functions of RVsOften times we want to compute the expectation of a function of a random variable instead of the random variable itself. For instance, we might want to compute instead of E[X2] E[X]
Example: Suppose an architect is designing a community and wants to maximize the diversity in the size of his square buildings that are of both width and depth , but is uniformly distributed between 0 and 10 meters. What is the distribution of the area
of a building?
X X
X2
fy ( y ) =§y FYCY)= IfYIO I = zotyg
←
Expectation of Functions of RVsOften times we want to compute the expectation of a function of a random variable instead of the random variable itself. For instance, we might want to compute instead of E[X2] E[X]
Example: Suppose an architect is designing a community and wants to maximize the diversity in the size of his square buildings that are of both width and depth , but is uniformly distributed between 0 and 10 meters. What is the distribution of the area
of a building?
X X
X2
EFXT =fgEfandx= ftp.xjdxafo.gl "
= log = 33 tz MEUR5
Expectation of Functions of RVsOften times we want to compute the expectation of a function of a random variable instead of the random variable itself. For instance, we might want to compute instead of E[X2] E[X]
Change-of-Variables Formula: Let X be a random variable and let be a function.
If X is discrete, take the values then
If X is continuous, with probability density function , then
g : R ! R
a1, a2, . . . ,
E[g(x)] =X
i
g(ai)P (X = ai)
E[g(X)] =
Z 1
�1g(x)f(x)dx
Linearity of ExpectationSuper-Useful Fact: Expectation is a linear function.
E[aX + b] = aE[X] + b
OK! Let’s Go (Back) to Work! Get in groups, get out laptop, and open the Lecture 10 In-Class Notebook
Let’s:
o Look at the (un)profitability of playing Casino Roulette
o Get some practice computing expected values of continuous random variables