Graphics Reference
In-Depth Information
The
expected value of a random variable
X
on a probability space
(
S
,
p
)
is
defined to be
E
[
X
]:=
X
(
s
)
p
(
s
)
ds
.
(30.18)
s
∈
S
As in the discrete case, expectation is linear.
Inline Exercise 30.6:
(a) In the special case where
S
is a space with a uniform
density, show that the expectation of the random variable
X
is just
E
[
X
]=
1
size
(
S
)
s
∈
S
X
(
s
)
ds
.
(b) What is the expectation of a random variable
Z
on the interval
[
a
,
b
]
with
uniform density?
We'll now apply the notion of expectation to the example code. The variable
u
in the program corresponds to a random variable
U
on the interval
[
0, 1
]
. Si
mi
larly,
the variable
w
in the program corresponds to a random variable
W
=
√
U
.The
expected value of
W
is, according to the definition,
E
[
W
]=
1
0
W
(
r
)
p
(
r
)
dr
,
(30.19)
=
1
0
√
rdr
=
2
3
.
(30.20)
This should match your intuition: The variable
U
is uniformly distributed
on
[
0, 1
]
, so its expected value is
2
. But for any number 0
<
√
u
,
so the average square root of any number should be bigger than the average num-
ber, that is, we anticipate that the expected value of
W
will be somewhat larger
than
2
.
<
u
<
1, we have
u
In analogy with the probability mass function for a random variable on a discrete
space described in Section 30.3.2, we'll now formulate the corresponding notion
for a random variable on a continuum.
It often happens that for a random variable
X
, and the special class of events of
the form
a
), there's a function
p
X
, called
the
probability density function
(pdf) or
density
or
distribution
for
X
, with the
property that
≤
X
≤
b
(i.e., the set
{
s
:
a
≤
X
(
s
)
≤
b
}
s
Y
(
s
)
Y
T
S
p
p
Y
=
b
a
{
≤
≤
}
p
X
(
r
)
dr
.
Pr
a
X
b
(30.21)
For the time being, we'll consider
only
random variables that have a pdf.
p
(
s
)
5
p
Y
(
Y
(
s
))
The intuition for
p
X
, for a random
variable X
, is that for small values of
Δ
,
the number
p
X
(
a
)Δ
is approximately the probability that
X
lies in an interval of
size
Δ
, centered at
a
,or
[
a
Figure 30.7: The density p
Y
is
defined so that starting from
a point s
∈
S, you get the
same result no matter which way
you traverse the arrows, that is,
p
(
s
)=
p
Y
(
Y
(
s
))
.
−
Δ
/
2,
a
+Δ
/
2
]
, with the approximation being better
and better as
Δ
→
0.
Inline Exercise 30.7:
Explain why, if
X
is a random variable on the probability
space
S
, with pdf
p
X
,
∞
−∞
p
X
(
r
)
dr
=
1.