0% found this document useful (0 votes)
246 views4 pages

STATS 100A Homework 4 Solution

The document is a homework solution that provides answers to 7 problems regarding probability distributions and calculations of expected value, variance, and standard deviation for discrete and continuous random variables. It includes determining the probability distribution for the number of successes in binomial experiments, proving properties of expected value and variance, and applying concepts like the central limit theorem to Monte Carlo estimation of pi.

Uploaded by

Billy Bob
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
246 views4 pages

STATS 100A Homework 4 Solution

The document is a homework solution that provides answers to 7 problems regarding probability distributions and calculations of expected value, variance, and standard deviation for discrete and continuous random variables. It includes determining the probability distribution for the number of successes in binomial experiments, proving properties of expected value and variance, and applying concepts like the central limit theorem to Monte Carlo estimation of pi.

Uploaded by

Billy Bob
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

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:

E(X) = 1 × 0.1 + 2 × 0.1 + 3 × 0.1 + 4 × 0.2 + 5 × 0.2 + 6 × 0.3 = 4.2


Var(X) = (1 − 4.2)2 × 0.1 + (2 − 4.2)2 × 0.1 + (3 − 4.2)2 × 0.1
+(4 − 4.2)2 × 0.2 + (5 − 4.2)2 × 0.2 + (6 − 4.2)2 × 0.3 = 2.76
p
SD(X) = Var(X) = 1.66

(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$

The units are attached in the above answers.


Problem 2 Suppose Z ∈ {0, 1}. P (Z = 1) = p, P (Z = 0) = 1 − p. Calculate E(Z), E(Z 2 ) and
Var(Z).
A: E(Z) = 1 × p + 0 × (1 − p) = p. Because Z 2 = Z, E(Z 2 ) = E(Z) = p. Var(Z) =
E(Z 2 ) − E(Z)2 = p − p2 = p(1 − p).
Problem 3 Suppose X is a discrete random variable following distribution p(x), where x takes
values in a discrete set.
(1) Prove E(aX) = aE(X).
A:
X X
E(aX) = axp(x) = a xp(x) = aE(X)
x x

(2) Prove E(X + b) = E(X) + b.


A:
X X X
E(X + b) = (x + b)p(x) = xp(x) + b p(x) = E(X) + b
x x x

(3) Prove Var(aX) = a2 Var(X).

1
A:

Var(aX) = E[aX − E(aX)]2 = E[aX − aE(X)]2


= E[a(X − E(X))]2 = a2 E[X − E(X)]2 = a2 Var(X)

(4) Prove Var(X + b) = Var(X).


A:

Var(X + b) = E[X + b − E(X + b)]2 = E[X + b − E(X) − b]2


= E[(X − E(X))]2 = E[X − E(X)]2 = Var(X)

(5) Prove Var(X) = E(X 2 ) − E(X)2 .


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:

E(X) = np = 100 × (1/2) = 50


Var(X) = np(1 − p) = 100 × (1/2) × (1 − 1/2) = 25
p
SD(X) = Var(X) = 5
E(X/100) = E(X)/100 = 1/2
Var(X/100) = Var(X)/1002 = 2.5 × 10−3
SD(X/100) = SD(X)/100 = .05
60 60  
X X 100
P (X ∈ [40, 60]) = P (X = k) = /2100
k
k=40 k=40
[40, 60]

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:

X ∼ Binomial(n = 100, p = .2)


E(X) = np = 100 × .2 = 20
Var(X) = np(1 − p) = 100 × .2 × (1 − .2) = 16
p
SD(X) = Var(X) = 4
E(X/100) = E(X)/100 = .2
Var(X/100) = Var(X)/1002 = 1.6 × 10−3
SD(X/100) = SD(X)/100 = .04
[.2 − 2 × .04, .2 + 2 × .04] = [.12, .28]

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:

m ∼ Binomial(n = 104 , p = π/4)


E(π̂) = E(4m/104 ) = (4/104 )E(m) = (4/104 ) × 104 × π/4 = π
Var(π̂) = Var(4m/104 ) = (4/104 )2 Var(m) = (4/104 )2 × 104 × π/4 × (1 − π/4) = π(4 − π)/104
p
SD(π̂) = π(4 − π)/102
p p
[π − 2 × π(4 − π)/102 , π + 2 × π(4 − π)/102 ]

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

You might also like