STATS 100A Homework 4 Solution
STATS 100A Homework 4 Solution
Problem 1 Suppose we roll a die, let X be the number we get. Suppose p(x) = P (X = x) is such
that p(1) = .1, p(2) = .1, p(3) = .1, p(4) = .2, p(5) = .2, p(6) = .3.
(1) Calculate P (X > 4).
A: P (X > 4) = p(5) + p(6) = .2 + .3 = .5.
(2) Calculate P (X = 6|X > 4).
A: P (X = 6|X > 4) = P (X = 6)/P (X > 4) = .3/.5 = .6.
(3) Calculate E(X), Var(X), and SD(X).
A:
(4) Suppose the reward for x is h(x), and h(1) = −$20, h(2) = −$10, h(3) = $0, h(4) = $10,
h(5) = $20, h(6) = $100. Calculate E(h(X)), Var(h(X)) and SD(h(X)). What are the units of
E(h(X)) and Var(h(X))?
A:
E(h(X)) = −20 × 0.1 − 10 × 0.1 + 0 × 0.1 + 10 × 0.2 + 20 × 0.2 + 100 × 0.3 = 33$
Var(h(X)) = (−20 − 33)2 × 0.1 + (−10 − 33)2 × 0.1 + (0 − 33)2 × 0.1
+(10 − 33)2 × 0.2 + (20 − 33)2 × 0.2 + (100 − 33)2 × 0.3 = 2061$2
p
SD(h(X)) = Var(h(X)) = 45.4$
1
A:
Var(X) = E[X − E(X)]2 = E[X 2 − 2XE(X) + E(X)2 ] = E(X 2 ) − 2E(X)E(X) + E(X)2 = E(X 2 ) − E(X)2
(6) Let µ = E(X), and σ 2 = Var(X). Let Z = (X − µ)/σ. Calculate E(Z) and Var(Z).
A:
X −µ 1 1
E(Z) = E( ) = (E(X) − µ) = (µ − µ) = 0
σ σ σ
X −µ 1 1
Var(Z) = Var( ) = 2 Var(X − µ) = 2 Var(X) = 1
σ σ σ
Problem 4 Suppose we flip a fair coin 100 times independently. Let X be the number of heads.
Calculate E(X), Var(X), SD(X), E(X/100), Var(X/100), SD(X/100). Write down the formula
for computing P (X ∈ [40, 60]). Calculate the interval [E(X) − 2SD(X), E(X) + 2SD(X)].
A:
Problem 5 Suppose within the population of voters, 20% of them support a candidate A. If
we randomly sample 100 people sequentially with replacement. Let X be the number of supporters
of A among these 100 people. Then what is the distribution of X? What are E(X), Var(X), and
SD(X)? What are E(X/100), Var(X/100), and SD(X/100)? Calculate the interval [E(X/100) −
2SD(X/100), E(X/100) + 2SD(X/100)].
2
A:
Problem 6 Suppose we randomly throw 10,000 points into the unit square [0, 1]2 . Let A be
the region x2 + y 2 ≤ 1. Let m be the number of points that fall into A. What is the distribution
of m? Let π̂ = 4m/10000 be our Monte Carlo estimate of π. What are E(π̂), Var(π̂) and SD(π̂)?
Calculate the interval [E(π̂) − 2SD(π̂), E(π̂) + 2SD(π̂)].
A:
Problem 7 Suppose a continuous random variable takes values within [0, 1], with a probability
density function f (x) = ax for x ∈ [0, 1], and f (x) = 0 otherwise. a is a positive constant.
(1) Calculate a.
R1
A: 0 axdx = 1. a = 2.
(2) Calculate F (x) = P (X ≤ x).
Rx
A: F (x) = 0 if x < 0. F (x) = 1 if x > 1. F (x) = 0 2xdx = x2 for x ∈ [0, 1].
(3) Calculate E(X) and Var(X).
R1 R1
A: E(X) = 0 xf (x)dx = 2/3. E(X 2 ) = 0 x2 f (x)dx = 1/2. Var(X) = E(X 2 ) − E(X)2 =
1/2 − 4/9 = 1/18.
(4) Please hand-draw a scatterplot of some points to illustrate the density.
3
4