Week 8: Exercises
Date: November 10, 2024
Exercise 1. Suppose X is a random variable with values in [1, 2] and density
kx2 for 1 ≤ x ≤ 2
f (x) =
0
otherwise,
where k is a fixed constant.
(a). What is k?
(b). Find the CDF of X.
(c). Find P(X < 3/2).
(d). Find E(X).
Solution 1.
R
(a). Due to f (x)dx = 1, we have
Z 2
1 2 7
kx2 dx = k x3 =k· = 1.
1 3 1 3
3
Thus, k = 7.
(b). Since
x
x3 − 1
Z
3 2
t dt = ,
1 7 7
The CDF of X is
0 for x < 1
F (x) = x3 −1
7 for 1 ≤ x ≤ 2
1
for x > 2.
(c).
P(X < 3/2) = F (3/2) = 19/56.
(d).
Z 2
E(x) = x · (3x2 /7)dx = 45/28.
1
1
Exercise 2. A random variable X has a discrete uniform (1, N ) distribution if
1
P(X = x|N ) = , x = 1, 2, . . . , N,
N
where N is a specified integer. This distribution puts mass on each of the outcomes 1, 2, . . . , N . Compute
the following:
(a). E(X);
(b). Var(X).
Solution 2.
(a).
N
X 1 N +1
E(X) = x = .
N 2
x=1
PN N (N +1)(2N +1)
(b). Note the identity x=1 x2 = 6 . Since
N
2 1 (N + 1)(2N + 1)
X
2
E(X ) = x = ,
N 6
x=1
we have
(N + 1)(2N + 1) N + 1 2 (N + 1)(N − 1)
Var(X) = E(X 2 ) − (E(X))2 = −( ) = .
6 2 12
Exercise 3. If X has a binomial distribution, its PMF is given by
P (X = x) = nx px (1 − p)n−x , x = 0, 1, . . . , n,
where n is a positive integer, 0 ≤ p ≤ 1, and for every pair n and p the PMF sums to 1.
(a). Compute E(X)
(b). Compute Var(X)
(c). Define the independent random variables X1 , . . . , Xn by
1 with probability p,
Xi =
0 with probability 1 − p.
Define Y = ni=1 Xi . Compute E(Y ) and Var(Y ).
P
2
Pn n
(a). Note the identity (p + (1 − p))n = px (1 − p)n−x .
Solution 3. x=0 x
Xn
E(X) = xP (X = x)
x=0
n
X
n
px (1 − p)n−x
= x x
x=0
n
X
n−1
px−1 (1 − p)n−x
= np x−1
x=1
n−1
X
n−1
py (1 − p)n−1−y
= np y (let y = x − 1)
y=0
= np.
(b).
n
X
E(X 2 ) = x2 P (X = x)
x=0
n
X
n
x2 px (1 − p)n−x
= x
x=0
n
X
n−1
px−1 (1 − p)n−x
= npx x−1
x=1
n−1
X
n−1
py (1 − p)n−1−y
= np(y + 1) y
y=0
n−1
X n−1
X
n−1 n−1
py (1 − p)n−1−y + py (1 − p)n−1−y
= npy y np y
y=0 y=0
2 2
= np(n − 1)p + np = n p + np(1 − p).
Therefore,
Var(X) = E(X 2 ) − (E(X))2 = np(1 − p).
(c). Since X1 , . . . , Xn are independent, we have
X n n
X
E(Y ) = E( Xi ) = E(Xi ) = np,
i=1 i=1
n
X
Var(Y ) = Var(Xi ) = np(1 − p).
i=1