DATA 208 Lecture 5 A
DATA 203 Lecture 5: Expectation
The Jones’ family height data is
hy=18, m=16, Ay=18, hy hy = 17
If we randomly pick a Jones’ 18,
family member, their height is a oa oa
random variable H with p.d.. fu =
The mean height jin is 1G 7B |
1 1 2 1
y= 1GX E417 X SH18x2419x=1.76 (1)
Effectively, this is,
"Sum over all h values of {value x probability that value occurs}”
which can be written in general terms as Ha
mean ie fe. fin(te) dh
where the integration picks up each >
probability mass, multiplies it by
the h value at which it occurs,
and sums them up. This yields (1)
The variance of the Joneses’ heights is of = (Iki — un)” :
which, in words is
"Sum over all A values of {(value - mean)® % probability that value occurs}
which we can write in integral form as
variancx i. (hi)? fir) dhDATA 208 Lacture 5 B
Expectation
For a random variable X with a pdf. fx() we can define the
expectation of a function g(X) as
Bg) = Btg1X)) = fafa). fala) ae
In particular g(X) = X gives
a)= [ x. f(z) de = mean
and g(X) = (X — 2)? gives
B((x-y)) -{ (e—)?.. fx(a) de = variance
# Example: Let X be a
uniformly distributed random
variable (RLV.) with a p.d.f
as shown,
To calculate the mean:
For the variance
B((x-29)= f° (@-2¥ fx) deDATA 208 Loeture 5 ©
-f (x2)? .0de+
(@-9"
6
(2)? 0dr
=04
+0= 3 = variance
lem 3
Basic properties of expectation
(2) E(k) =k for any constant k € R
(b) B(kg(X)) = kE(g(X)) for any constant & € Rand function
aX)
B(g(X) + W(X) = E(g(X)) + E(A(X)) for any functions
and h.
«© For (a) we have
kfe(a) de = af” fla) do =k
EX)
since [%, fxx() dx must equal 1 as
outcome occurs.
«For (b) we have
Beg) = [hate fuley de =k fafa) de = KEL)
© For (c)
the probability that any
Bg(x)+H(3)) = J (ola) +X) fal) dr
-[ 9 (2) Fx) + Rw) fx) dx
= [Oabertale) der J nla) fue) de = Bta(X))+B(H(0)DATA 208 Lecture 5 D
‘* Example: X is a continuous random variable with p.d-f
Pr 2/2 O