You are on page 1of 11

Problem 2.

6 In each of the following find the pdf of 𝑌 and show that the pdf
integrates to 1.
(a) 𝑓𝑋 𝑥 = 12 𝑒− 𝑥 , −∞ < 𝑥 < ∞; 𝑌 = 𝑋 3 .
Solution
𝐹𝑌 𝑦 = 𝑃 𝑌 ≤ 𝑦
3
=𝑃 𝑋 ≤𝑦
1
=𝑃 𝑋 ≤ 𝑦3

1 1
= 𝑃 −𝑦3 ≤ 𝑋 ≤ 𝑦3

1 1
= 𝑃 𝑋 ≤ 𝑦3 − 𝑃 𝑋 < −𝑦3

1 1
= 𝑃 𝑋 ≤ 𝑦3 − 𝑃 𝑋 ≤ −𝑦3
1 1
𝑦3 −𝑦3
= 𝑓𝑋 𝑥 𝑑𝑥 − 𝑓𝑋 𝑥 𝑑𝑥
−∞ −∞
1 1
𝑦3 −𝑦3
1 −𝑥 1 −𝑥
= 𝑒 𝑑𝑥 − 𝑒 𝑑𝑥
−∞
2 −∞
2
So,
𝑑
𝑓𝑌 𝑦 = 𝐹 𝑦
𝑑𝑦 𝑌
1 1
𝑦3 −𝑦3
𝑑 1 −𝑥 1 −𝑥
= 𝑒 𝑑𝑥 − 𝑒 𝑑𝑥
𝑑𝑦 −∞
2 −∞
2

1 1 1 2 1 1 1 2
= 𝑒−𝑦3 ⋅ 𝑦−3 − 𝑒−𝑦3 ⋅ − 𝑦−3
2 3 2 3
1 2 1
= 𝑦−3 𝑒−𝑦3
3
Since 𝑋 ∈ −∞, ∞ and 𝑌 = 𝑋 3 , 𝑌 ∈ 0, ∞ . Hence,
∞ ∞
1 −2 −𝑦13
𝑓𝑌 𝑦 𝑑𝑦 = 𝑦 3𝑒 𝑑𝑦
−∞ 0
3

∞ 1 −2 −𝑦1 ∞ 1 −2 −𝑦1 ∞ −𝑢
Let 𝑢 = 𝑦1/3 , and we get 𝑦 3𝑒 3 𝑑𝑦 = 𝑦 3𝑒 3 𝑑𝑦 = 𝑒 𝑑𝑢 = 1.
0 3 0 3 0


(b) 𝑓𝑋 𝑥 = 38 𝑥 + 1 2 , −1 < 𝑥 < 1; 𝑌 = 1 − 𝑋 2 .
Solution
𝑃 𝑌 ≤ 𝑦 = 𝑃 1 − 𝑋2 ≤ 𝑦
= 𝑃 1 − 𝑦 ≤ 𝑋2
=𝑃 1 − 𝑦 ≤ 𝑋2 ∩ 𝑋 ≥ 0 +𝑃 1 − 𝑦 ≤ 𝑋2 ∩ 𝑋 < 0
=𝑃 1 − 𝑦 ≤ 𝑋 + 𝑃 −𝑋 ≤ − 1 − 𝑦
= 2 − 2𝐹𝑋 1−𝑦
So,
𝑑
𝑓𝑌 𝑦 = 2 − 2𝐹𝑋 1−𝑦
𝑑𝑦
1−𝑦
𝑑 3
= −2 ⋅ 𝑥 + 1 2 𝑑𝑥
𝑑𝑦 −1
8
3 1 −1
= −2 ⋅ 1−𝑦+1 2
⋅− 1−𝑦 2
8 2
3 2−𝑦
=
8 1−𝑦
Notice that
1 1
3 2−𝑦 3 2 𝑦
𝑑𝑦 = − 𝑑𝑦
0
8 1−𝑦 8 0
1−𝑦 1−𝑦
1
1
= 𝑦−4 −𝑦 + 1
4 0

=1

(c) 𝑓𝑋 𝑥 = 38 𝑥 + 1 2 , −1 < 𝑥 < 1; 𝑌 = 1 − 𝑋 2 if 𝑋 ≤ 0 and 𝑌 =
1 − 𝑋 if 𝑋 > 0.
Solution
𝑓𝑌 𝑦 𝑑𝑦 = −𝑓𝑋 𝑥 𝑑𝑥 𝑥>0 + 𝑓𝑋 −𝑥 −𝑑𝑥 𝑥≤0
3 3
=− 𝑥 + 1 2 𝑑𝑥 + −𝑥 + 1 2
−𝑑𝑥
8 𝑥>0 8 𝑥≤0

3 3
=− 2 − 𝑦 2 𝑑𝑥 + − 1−𝑦+1 2
−𝑑𝑥
8 𝑥>0 8 𝑥≤0

So,
3 2 𝑑𝑥 3 2 𝑑𝑥
𝑓𝑌 𝑦 = − 2−𝑦 + − 1−𝑦+1 −
8 𝑑𝑦 𝑥>0 8 𝑑𝑦 𝑥≤0
2
3 2 3 1− 1−𝑦
= 2−𝑦 +
8 8 2 1−𝑦
Notice that
1 2
3 2 3 1− 1−𝑦
2−𝑦 + 𝑑𝑦
0
8 8 2 1−𝑦
1 1 2
3 2 3 1− 1−𝑦
= 2−𝑦 𝑑𝑦 + 𝑑𝑦
0
8 0
8 2 1−𝑦
1 1
1 3 1 3
2
=− 2−𝑦 + − 2−𝑦 −3 −𝑦 + 1 − −𝑦 + 1 3 − 3𝑦
3 0 8 0

=1

𝑥 2
1
Problem 2.11 Let 𝑋 have the standard normal pdf, 𝑓𝑋 𝑥 = 2𝜋
𝑒− 2 .

(a) Find 𝐸 𝑋 2 directly, and then by using the pdf of 𝑌 = 𝑋 2 from


Example 2.1.7 and calculate 𝐸 𝑌 .
Solution
2 2
1 𝑥 ∞ 1 𝑥
Since 𝑥2 2𝜋
𝑒− 2 is an even function, 𝐸 𝑋 2 = 𝑥2 2𝜋
𝑒− 2 𝑑𝑥 =
−∞

2
∞ 1 𝑥 2
2 𝑥2 2𝜋
𝑒− 2 𝑑𝑥. Let 𝑦 = 𝑥2 . Then 𝑑𝑥 = 1
2𝑦
𝑑𝑦 and therefore
0

𝑒−𝑦 1
𝐸 𝑋2 = 2 2𝑦 𝑑𝑦
0 2𝜋 2𝑦

2 1
= 𝑦2 𝑒−𝑦 𝑑𝑦
𝜋 0

2 3
= 𝛤
𝜋 2
2 1 1
= 𝛤
𝜋2 2
=1
1
, using 𝛤 2
= 𝜋. By Example 2.1.7, 𝑓𝑌 𝑦 = 2 1 𝑦 𝑓𝑋 𝑦 +
1
𝑓
2 𝑦 𝑋
− 𝑦 , we have
1 1 −𝑦 1 𝑦
𝑓𝑌 𝑦 = 𝑒 2 ⋅2 = 𝑒−2 , ∀𝑦 ∈ 0, ∞
2 𝑦 2𝜋 2𝜋𝑦

(b) Find the pdf of 𝑌 = 𝑋 , and find its mean and variance.
Solution
𝑓𝑌 𝑦 𝑑𝑦 = 𝑓𝑋 𝑥 𝑑𝑥 − 𝑓𝑋 −𝑥 −𝑑𝑥 = 2𝑓𝑋 𝑥
2 −𝑦 2
= 𝑒 2 , ∀𝑦 ∈ 0, ∞
𝜋

Problem 2.12 A random right triangle can be constructed in the
following manner. Let 𝑋 be a random angle whose distribution is
uniform on 0, 𝜋2 . For each 𝑋, construct a triangle as pictures below.
Hence, 𝑌 = height of the random triangle. For a fixed constant 𝑑, find
the distribution of 𝑌 and 𝐸 𝑌 .

Solution
Since 𝑌 = 𝑑 tan 𝑋,
𝑃 𝑌 ≤ 𝑦 = 𝑃 𝑑 tan 𝑋 ≤ 𝑦
𝑦
= 𝑃 𝑋 ≤ tan−1
𝑑
𝑦
= 𝐹𝑋 tan−1
𝑑
𝑦
tan−1
𝑑 2
= 𝑑𝑥
0
𝜋
So,
𝑦
tan−1
𝑑 𝑑 2 2 1 1 2𝑑
𝑓𝑌 𝑦 = 𝑑𝑥 = ⋅ ⋅ = , ∀𝑦 ∈ 0, ∞
𝑑𝑦 0
𝜋 𝜋 1+ 𝑦 2 𝑑 𝜋 𝑑2 + 𝑦2
𝑑
Next, to evaluate 𝐸 𝑌 , let 𝑘 = 𝑑𝑦. Then
∞ ∞ ∞
2 1 1 2𝑑 𝑘 1
𝐸 𝑌 = ⋅ ⋅ 𝑑𝑦 = 𝑑𝑘 = ln 1 + 𝑥2 = ∞.
0
𝜋 1+ 𝑦 2 𝑑 𝜋 0
1+𝑘 2 2 0
𝑑

Problem 2.13 Consider a sequence of independent coin flips, each of
which has probability 𝑝 of being heads. Define a random variable 𝑋 as
the length of the run (of either heads or tails) started by the first trial.
(For example, 𝑋 = 3 if either TTTH or HHHT is observed.) Find the
distribution of 𝑋, and find 𝐸 𝑋 .
Solution
𝑃 𝑋 = 𝑘 = 𝑝𝑘 1 − 𝑝 + 1 − 𝑝 𝑘 𝑝, 𝐾 ∈ ℕ.
This is a legitimate distribution because

𝑝𝑘 1 − 𝑝 + 1 − 𝑝 𝑘 𝑝 = 1.
𝑘=1
And

𝐸 𝑋 = 𝑘 𝑝𝑘 1 − 𝑝 + 1 − 𝑝 𝑘 𝑝
𝑘=1
∞ ∞
= 1−𝑝 𝑘𝑝𝑘 + 𝑝 𝑘 1−𝑝 𝑘

𝑘=1 𝑘=1
𝑝 1−𝑝
= +
1−𝑝 𝑝
2𝑝2 − 2𝑝 + 1
=
𝑝 − 𝑝2

Problem 2.14
(a) Let 𝑋 be a continuous, nonnegative random variable, i.e. 𝑓 𝑥 =
0 for 𝑥 < 0. Show that

𝐸 𝑋 = 1 − 𝐹𝑋 𝑥 𝑑𝑥,
0

where 𝐹𝑋 𝑥 is the pdf of 𝑋.


Solution

𝐸 𝑋 = 𝑥𝑓𝑋 𝑥 𝑑𝑥
0


= 𝑥𝐹𝑋 𝑥 0 − 𝐹𝑋 𝑥 𝑑𝑥
0

=𝑥∞
0 − 𝐹𝑋 𝑥 𝑑𝑥
0

= 1 − 𝐹𝑋 𝑥 𝑑𝑥.
0

(b) Let 𝑋 be a discrete random variable whose range is the
nonnegative integers. Show that

𝐸 𝑋 = 1 − 𝐹𝑋 𝑘 ,
𝑘=0
where 𝐹𝑋 𝑘 = 𝑃 𝑋 ≤ 𝑘 . Compare this with part (a).
Solution
Observe that
𝑋 𝑤 = 1 0,𝑋 𝑤 −1 𝑥 .
𝑥∈ℕ

So,
𝐸 𝑋 = 𝑋 𝑤 𝑃 𝑋=𝑋 𝑤
𝑤∈Ω


= 𝑋 𝑤 1 0,𝑋 𝑤 −1 𝑘
𝑤∈Ω 𝑘=0


= 𝑋 𝑤 ∘ 1 0,𝑋 𝑤 −1 𝑘
𝑤∈Ω 𝑘=0


= 𝑋 𝑤 ∘ 1 0,𝑋 𝑤 −1 𝑘
𝑘=0 𝑤∈Ω


= 1 𝑋 𝑤 −1,∞ 𝑘 ∘ 𝑘
𝑘=0 𝑤∈Ω


= 𝑃 𝑋≥𝑘
𝑘=0

= 1 − 𝐹𝑋 𝑘 .
𝑘=0

Problem 2.17 A median of a distribution is a value 𝑚 such that
𝑃 𝑋 ≤ 𝑚 ≥ 0.5 and 𝑃 𝑋 ≥ 𝑚 ≥ 0.5. If 𝑋 is continuous, then 𝑚
𝑚 ∞
satisfies 𝑓 𝑥 𝑑𝑥 = 𝑓 𝑥 𝑑𝑥 = 0.5. Find the median of the
−∞ 𝑚
following distributions.
(a) 𝑓 𝑥 = 3𝑥2 , 0 < 𝑥 < 1
Solution
𝑋 is continuous. So
𝑚 1
2 1
3𝑥 𝑑𝑥 = 3𝑥2 𝑑𝑥 = 0.5 ⟹ 𝑚3 = 1 − 𝑚3 ⟹ 𝑚 = 3
.
0 𝑚 2

1
(b) 𝑓 𝑥 = 𝜋 1+𝑥 2 , −∞ < 𝑥 < ∞

Solution
Since 𝑓 𝑥 is an even function, 𝑚 = 0.

Problem 2.18 Show that if 𝑋 is a continuous random variable, then

min 𝐸 𝑋 − 𝑎 = 𝐸 𝑋 − 𝑚
𝑎

where 𝑚 is the median of the 𝑋.


Solution

𝐸 𝑋−𝑎 = 𝑥 − 𝑎 𝑓𝑋 𝑥 𝑑𝑥
−∞
𝑎 ∞
= 𝑎 − 𝑥 𝑓𝑋 𝑥 𝑑𝑥 + 𝑥 − 𝑎 𝑓𝑋 𝑥 𝑑𝑥
−∞ 𝑎
𝑑
Let 𝑑𝑎
𝐸 𝑋 − 𝑎 = 0. Then
𝑎 ∞
𝑑 𝑑
𝑎 − 𝑥 𝑓𝑋 𝑥 𝑑𝑥 + 𝑥 − 𝑎 𝑓𝑋 𝑥 𝑑𝑥
𝑑𝑎 −∞
𝑑𝑎 𝑎
𝑎 ∞
= 𝑓𝑋 𝑥 𝑑𝑥 − 𝑓𝑋 𝑥 𝑑𝑥
−∞ 𝑎

=0
𝑎 ∞ 𝑎 ∞
⟹ 𝑓 𝑥 𝑑𝑥 = 𝑓𝑋 𝑥 𝑑𝑥 and 𝑓 𝑥 𝑑𝑥 + 𝑓𝑋 𝑥 𝑑𝑥 =
−∞ 𝑋 𝑎 −∞ 𝑋 𝑎
1 ⟹ 𝑎 = 𝑚.

Problem 2.19 Prove that
𝑑 2
𝐸 𝑋−𝑎 =0⟺𝐸 𝑋 =𝑎
𝑑𝑎
by differentiating the integral. Verify, using calculus, that 𝑎 = 𝐸 𝑋 is
indeed a minimum. List the assumptions about 𝐹𝑋 and 𝑓𝑋 that are
needed.
Solution

To show that arg 𝑎∗ = min 𝐸 𝑋 − 𝑎 2


= 𝐸 𝑋 , it suffices to show that
𝑎

𝑑 2 𝜕 2
𝐸 𝑋−𝑎 =𝐸 𝑋−𝑎 .
𝑑𝑎 𝜕𝑎
In other words,
𝑑 𝜕
𝑥 − 𝑎 2 𝑓𝑋 𝑥 𝑑𝑥 = 𝑥 − 𝑎 2 𝑓𝑋 𝑥 𝑑𝑥.
𝑑𝑎 𝜕𝑎
The key step is exchanging the integration and the differentiation,
which is legitimate if and only if
- 𝑥 − 𝑎 2 𝑓𝑋 𝑥 is differentiable with respect to 𝑎,
𝜕
- 𝜕𝑎
𝑥 − 𝑎 2 𝑓𝑋 𝑥 exists.

Problem 2.33 In each of the following cases verify the expression given
for the moment generating function, and in each case use mgf to
calculate 𝐸 𝑋 and 𝑉𝑎𝑟 𝑋 .
−𝜆
𝜆𝑥 𝑡
(a) 𝑃 𝑋=𝑥 =𝑒 𝑥!
, 𝑀 𝑋 𝑡 = 𝑒𝜆 𝑒 −1
, 𝑥 = 0,1,2,3 ⋯ ; 𝜆 > 0
Solution
∞ ∞
𝑒−𝜆 𝜆𝑥 𝑒𝑡 𝜆 𝑥
𝑡 𝑡
𝑀𝑋 𝑡 = 𝐸 𝑒𝑡𝑋 = 𝑒𝑡𝑥 = 𝑒−𝜆 = 𝑒−𝜆 𝑒𝑒 𝜆
=𝑒𝑒 −1 𝜆
.
𝑥=0
𝑥! 𝑥=0
𝑥!
′ 𝑡
𝐸 𝑋 = 𝑀𝑋 0 = 𝜆𝑒𝜆𝑒 +𝑡−𝜆
𝑡=0 = 𝜆.
′′ 𝑡
𝐸 𝑋 2 = 𝑀𝑋 0 = 𝜆𝑒𝜆𝑒 +𝑡−𝜆
𝜆𝑒𝑡 + 1 𝑡=0 = 𝜆2 + 𝜆, and by 𝑉𝑎𝑟 𝑋 =
𝐸 𝑋 2 − 𝐸 𝑋 2 , we have 𝑉𝑎𝑟 𝑋 = 𝜆 . 2


𝑝
(b) 𝑃 𝑋 = 𝑥 = 𝑝 1 − 𝑝 𝑥 , 𝑀𝑋 𝑥 = 1− 1−𝑝 𝑒𝑡
, 𝑥 = 0,1,2,3, ⋯ ; 0 < 𝑝 <
1
Solution
∞ ∞
𝑥 𝑝
𝑀𝑋 𝑡 = 𝐸 𝑒𝑡𝑋 = 𝑒𝑡𝑥 𝑝 1 − 𝑝 𝑥
=𝑝 1 − 𝑝 𝑒𝑡 = .
𝑥=0 𝑥=0
1 − 1 − 𝑝 𝑒𝑡

′ 𝑒𝑡 𝑝 1 − 𝑝 1−𝑝
𝐸 𝑋 = 𝑀𝑋 0 = 2
= .
1 − 𝑒𝑡 1 − 𝑝 𝑝
𝑡=0
2 ′′ 𝑒𝑡 𝑝 𝑒𝑡 1 − 𝑝 + 1 1 − 𝑝 1−𝑝 2−𝑝
𝐸 𝑋 = 𝑀𝑋 0 = 3
= .
1 − 𝑒𝑡 1 − 𝑝 𝑝2
𝑡=0

1−𝑝 2−𝑝 1−𝑝 2


So, 𝑉𝑎𝑟 𝑋 = 𝑝2
− 𝑝
= 1−𝑝
𝑝2
.


𝑥−𝜇 2 𝜎 2 𝑡2
1
(c) 𝑓𝑋 𝑥 = 2𝜋𝜎
𝑒 2𝜎2 , 𝑀𝑋 𝑡 = 𝑒𝜇𝑡+ 2 , −∞ < 𝑥 < ∞; −∞ < 𝜇 <

∞, 𝜎 > 0
Solution
∞ 1 2 1 2
Let 𝑍 ≔ 𝑋−𝜇
𝜎
. Then 𝑀𝑍 𝑡 = 𝑒𝑧𝑡 1
2𝜋
𝑒−2𝑧 𝑑𝑧 = 𝑒2𝑡 and thus
−∞

𝜎 2 𝑡2
𝑀𝑋 𝑡 = 𝑀𝜎𝑍+𝜇 𝑡 = 𝑒𝜇𝑡 𝑒 2 .
′ ′′
𝐸 𝑋 = 𝑀𝑋 0 = 𝜇 and 𝑉𝑎𝑟 𝑋 = 𝐸 𝑋 2 − 𝜇2 = 𝑀𝑋 0 − 𝜇2 =
𝑉𝑎𝑟 𝑋 .

Problem 2.38 Let 𝑋 have the negative binomial distribution with pmf
𝑟+𝑥−1 𝑟
𝑓 𝑥 = 𝑝 1 − 𝑝 𝑥 , 𝑥 = 0,1,2, ⋯
𝑥
where 0 < 𝑝 < 1 and 𝑟 > 0 is an integer.
(a) Calculate the mgf of 𝑋.
Solution
Observe that for a negative binomial distribution 𝑋 with parameters 𝑟,
where 𝑟 is the number of given success, and 𝑋 is the number of
failures in a sequence of independent and identically distributed
Bernoulli trials before a specified number of success 𝑟 occurs,
𝑟
𝑋= 𝑌𝑖 ,
𝑖=1
where 𝑌𝑖 ~𝐺𝑒𝑜𝑚 𝑝 . The mgf of a sum of independent random variables
is just the product of their mgfs, so
𝑟
𝑀𝑋 = 𝑀 𝑟
𝑌 = 𝑀𝑌 𝑖
𝑖=1 𝑖
𝑖=1
To derive 𝑀𝑌𝑖 , it suffices to evaluate 𝑀𝑌1 since they are all identically
distributed.
𝑀 𝑌 1 𝑡 = 𝐸 𝑒𝑌 1 𝑡

= 𝑒𝑡𝑦 𝑃 𝑌 = 𝑦
𝑦=1

= 𝑒𝑡𝑦 𝑝 1 − 𝑝 𝑦−1

𝑦=1
𝑝 ∞ 𝑡 𝑦
= 𝑒 1−𝑝
1 − 𝑝 𝑦=1
𝑝 𝑒𝑡 1 − 𝑝
= ⋅
1 − 𝑝 1 − 𝑒𝑡 1 − 𝑝
𝑒𝑡 𝑝
=
1 − 𝑒𝑡 1 − 𝑝
Hence,
𝑟
𝑒𝑡 𝑝
𝑀𝑋 𝑡 =
1 − 𝑒𝑡 1 − 𝑝

(b) Define a new random variable by 𝑌 = 2𝑝𝑋. Show that, as 𝑝 → 0,
the mgf of 𝑌 converges to that of a Chi-squared random variable
with 2𝑟 degrees of freedom by showing that
𝑟
1 1
lim 𝑀𝑌 𝑡 = , 𝑡 < .
𝑝→0 1 − 2𝑡 2
Solution
Since 𝑀𝑌 𝑡 = 𝑀2𝑝𝑋 𝑡 = 𝑀𝑋 2𝑝𝑡 , we have
𝑟
𝑒2𝑝𝑡 𝑝
𝑀𝑌 𝑡 = 𝑀𝑋 𝑡 = ,
1 − 𝑒2𝑝𝑡 1 − 𝑝
and thus
𝑟
𝑒2𝑝𝑡 𝑝
lim 𝑀𝑌 𝑡 = lim
𝑝→0 𝑝→0 1 − 𝑒2𝑝𝑡 1 − 𝑝
𝑟
𝑒2𝑝𝑡 𝑝
= lim
𝑝→0 1 − 𝑒2𝑝𝑡 1 − 𝑝
𝑟
𝑝
= lim −2𝑝𝑡
𝑝→0 𝑒 +𝑝−1
𝑟
1
= lim
𝑝→0 −2𝑡𝑒−2𝑝𝑡 +1
𝑟
1
= ,
1 − 2𝑡
1
and 1−2𝑡
> 0 implies 𝑡 < 12.