Cumulative distribution function and probability density function

advertisement
LECTURE 25: EXPECTED VALUE, VARIANCE, AND STANDARD DEVIATION
MINGFENG ZHAO
March 11, 2015
Cumulative distribution function and probability density function
Theorem 1. Let X be a continuous random variable, then
I. For the cumulative distribution function (CDF) F (x) = Pr(X ≤ x), we have
a. 0 ≤ F (x) ≤ 1 for all x.
b. F (x) is non-decreasing.
c.
lim
x→−∞
F (x) = 0.
d. lim F (x) = 1.
x→∞
II. For the probability density function (PDF) f (x) =
dF (x)
, we have
dx
a. f (x) ≥ 0 for all x.
Z ∞
b.
f (x) dx = 1.
−∞
Z x
c. F (x) =
f (t) dt.
−∞
Z b
d. Pr(a ≤ X ≤ b) =
f (t) dt.
a
Expected value, variance and standard deviation
Definition 1. Let f (x) be the PDF for a continuous random variable X, then
I. The expected value, or expectation, or mean, of X is defined by:
Z ∞
E(X) =
xf (x) dx.
−∞
II. The variance of X is defined by:
Z
∞
2
(x − E(X)) f (x) dx.
Var(X) =
−∞
1
2
MINGFENG ZHAO
III. The standard deviation of X is defined by:
σ(X) =
p
Var(X).
Theorem 2. Let f (x) be a PDF for a continuous random variable X and g(x) be a continuous function, then
Z ∞
g(x)f (x) dx.
E(g(X)) =
−∞
Theorem 3. For Var(X), we also have
Var(X) = E(X 2 ) − [E(X)]2 .
Proof. By the definition of Var(X), we have
Z ∞
2
Var(X) =
(x − E(X)) f (x) dx
−∞
∞
Z
=
2
x − 2xE(X) + [E(X)]2 f (x) dx
−∞
∞
Z
Z
2
∞
x f (x) dx − 2E(X)
=
−∞
2
Z
∞
xf (x) dx + [E(X)]
−∞
=
E(X 2 ) − 2E(X) · E(X) + [E(X)]2
=
E(X 2 ) − [E(X)]2 .
f (x) dx
−∞
Example 1. The length of time X, needed by students in a course to complete a 1 hour exam is a random variable X

 k(x2 + x), if 0 ≤ x ≤ 1,
with PDE given by f (x) =
, then
 0,
otherwise.
a. Find the value k.
b. Find the CDF.
c. Find the probability that a randomly selected student will finish the exam in less that half an hour.
d. Find the mean time needed to complete in an 1 hour exam.
e. Find the variance and standard deviation of X.
Solution: a. Since f (x) is a PDF, then
Z
1
∞
=
f (x) dx
−∞
Z
=
0
1
k(x2 + x) dx
LECTURE 25: EXPECTED VALUE, VARIANCE, AND STANDARD DEVIATION
1
1 3 1 2 x + x 3
2
0
1 1
= k·
+
3 2
=
k
=
5
k.
6
So
6
.
5

Z x
 k(x2 + x), if 0 ≤ x ≤ 1,
b. For the CDF , we have F (x) =
f (t) dt. Since f (x) =
, then
 0,
−∞
otherwise.
k=
• For x ≤ 0, we have
Z
x
x
Z
F (x) =
f (t) dt =
0 dt = 0.
−∞
−∞
• For x ≥ 1, we have
x
Z
F (x)
=
f (t) dt
−∞
0
Z
Z
=
1
f (t) dt +
−∞
Z
=
0 dt +
−∞
x
f (t) dt +
0
0
Z
Z
f (t) dt
1
1
Z
f (t) dt +
0
x
0 dt
1
1
Z
=
f (t) dt
0
=
1
By the computation in part a.
• For any 0 ≤ x ≤ 1, we have
Z
F (x)
x
=
f (t) dt
−∞
Z
0
=
Z
f (t) dt +
−∞
Z
=
=
Z
0 dt +
−∞
f (t) dt
0
0
=
x
0
x
6 2
(t + t) dt
5
x
6 1 3 1 2 t + t 5 3
2
0
6 1 3 1 2
x + x .
5 3
2
3
4
MINGFENG ZHAO
In summary, we have



0,
if x ≤ 0,


 6 1
1
F (x) =
x3 + x2 , if 0 ≤ x ≤ 1,

5
3
2



 1,
if x ≥ 1.
c. By the result of part b, we have
" 2 #
3
1
1
6
1
1
1
1
6
1
1
6 4
1
Pr X <
=F
= ·
·
+ ·
= ·
+
= ·
= .
2
2
5
3
2
2
2
5 24 8
5 24
5
d. In fact, we have
∞
Z
E(X)
=
xf (x) dx
−∞
1
Z
6
x · (x2 + x) dx
5
=
0
=
=
=
=
=
1
Z
6
5
(x3 + x2 ) dx
0
1
6 1 4 1 3 x + x 5 4
3
0
6 1 1
·
+
5 4 3
6 7
·
5 12
7
.
10
e. In fact, we have
2
E(X )
∞
Z
x2 f (x) dx
=
−∞
1
Z
6
x2 · (x2 + x) dx
5
=
0
=
=
=
=
=
6
5
Z
1
(x4 + x3 ) dx
0
1
6 1 5 1 4 x + x 5 5
4
0
6 1 1
·
+
5 5 4
6 9
·
5 20
54
100
LECTURE 25: EXPECTED VALUE, VARIANCE, AND STANDARD DEVIATION
5
= E(X 2 ) − [E(X)]2
2
54
7
=
−
100
10
Var(X)
54
49
−
100 100
5
=
100
1
=
20
p
σ(X) =
Var(X)
r
1
=
20
1
√
=
2 5
√
5
=
.
10

 2(1 − x), if 0 ≤ x ≤ 1,
Example 2. A random variable X is given by the PDF f (x) =
, compute the cumulative
 0,
otherwise.
distribution function, the expected value, variance, and standard deviation.
Z x
For the CDF, we have F (x) =
f (t) dt, then
=
−∞
• If x ≤ 0, then
Z
x
Z
F (x) =
x
f (t) dt =
0 dt = 0.
−∞
−∞
• If 0 ≤ x ≤ 1, then
Z
x
F (x) =
Z
f (t) dt =
−∞
0
x
x
2(1 − t) dt = (2t − t2 )0 = 2x − x2 .
• If x ≥ 1, then
Z
x
1
Z
F (x) =
2(1 − t) dt = 1.
f (t) dt =
−∞
0
In summary, we get



0,



F (x) =
2x − x2 ,




 1,
Notice that
Z
E(X)
∞
=
xf (x) dx
−∞
if x ≤ 0,
if 0 < x < 1,
if x ≥ 1.
6
MINGFENG ZHAO
1
Z
x · 2(1 − x)
=
0
1
Z
[2x − 2x2 ] dx
=
0
=
1
2 3 2
x − x 3
0
=
1−
=
E(X 2 )
1
3
Z
2
3
∞
x2 f (x) dx
=
−∞
1
Z
x2 · 2(1 − x) dx
=
0
1
Z
2
2x − 2x3 dx
=
0
=
=
=
Var(X)
=
=
=
=
σ(X)
=
=
=
=
1
2 3 2 4 x − x 3
4
0
2 1
−
3 2
1
6
E(X 2 ) − [E(X)]2
2
1
1
−
6
3
By Theorem 3
1 1
−
6 9
1
18
p
Var(X)
r
1
18
1
√
3 2
√
2
.
6
Department of Mathematics, The University of British Columbia, Room 121, 1984 Mathematics Road, Vancouver, B.C.
Canada V6T 1Z2
E-mail address: mingfeng@math.ubc.ca
Download