Mit18 05 s22 Class05-Prep-D
Mit18 05 s22 Class05-Prep-D
Class 5, 18.05
Jeremy Orloff and Jonathan Bloom
1 Learning Goals
1. Be able to find the pdf and cdf of a random variable defined in terms of a random variable
with known pdf and cdf.
We frequently transform a known random variable into a new one by applying a formula.
For example we might look at 𝑌 = 𝑎𝑋 + 𝑏 or 𝑌 = 𝑋 2 . In this section we will see how to
find the probability density and cumulative distribution of 𝑌 from those of 𝑋.
For discrete random variables it was often possible do this by looking at probability tables.
For continuous random variables we will need to use systematic algebraic techniques. We
will see that transforming the pdf is just the change of variables (‘𝑢-substitution’) from
calculus. To transform the cdf directly we will rely on its definition as a probability.
Let’s remind ourselves of the basics:
Example 1. Suppose 𝑋 has range [0, 2] and cdf 𝐹𝑋 (𝑥) = 𝑥2 /4. What is the range, pdf
and cdf of 𝑌 = 𝑋 2 ?
Solution: The range is easy: [0, 4].
To find the cdf we work systematically from the definition. For this example we will break
it down into tiny steps, so you can see the thought process in detail.
Step 1. Use definition:
𝐹𝑌 (𝑦) = 𝑃 (𝑌 ≤ 𝑦).
Step 2. Replace 𝑌 by its formula in 𝑋:
𝑃 (𝑌 ≤ 𝑦) = 𝑃 (𝑋 2 ≤ 𝑦).
1
18.05 Class 5, Manipulating Continuous Random Variables, Spring 2022 2
An alternative way to find the pdf directly is by change of variables. We present this for
completeness and for anyone who prefers it as a method. Our observation is that most
people find the cdf easier to transform.
In calculus you learned the ‘u’-substitution. We’ll do a calculus example to remind you how
this goes and then apply it to the pdf.
Example 2. Calculus example. Convert the integral ∫(𝑥2 + 1)7 𝑑𝑥 into an integral in
𝑢 = 𝑥2 + 1.
Solution: We have to convert each part of the integral from 𝑥 to 𝑢:
(𝑥2 + 1)7 = 𝑢7
𝑑𝑢 𝑑𝑢
𝑑𝑢 = 2𝑥 𝑑𝑥, therefore 𝑑𝑥 = = √
2𝑥 2 𝑢−1
Now we replacing each piece in the integral we get
𝑑𝑢
∫(𝑥2 + 1)7 𝑑𝑥 = ∫ 𝑢7 √ .
2 𝑢−1
Example 3. Find the pdf of 𝑌 in Example 1 directly using the method of ‘u’-substitution.
(In this case, ‘u’ will actually be ‘y’.)
Since this is a probability, the factor in front of 𝑑𝑦 is the probability density. That is,
𝑓𝑌 (𝑦) = 1/4, exactly as in Example 1.
Here are a few more examples. We do them a little more quickly than the above examples.
Example 4. Let 𝑋 ∼ exp(𝜆), so 𝑓𝑋 (𝑥) = 𝜆e−𝜆𝑥 on [0, ∞]. What is the probability density
of 𝑌 = 𝑋 2 ?
Solution: We will do this using the change of variables for the pdf.
𝑑𝑦
𝑦 = 𝑥2 ⇒ 𝑑𝑦 = 2𝑥 𝑑𝑥, therefore 𝑑𝑥 = √
2 𝑦
√
−𝜆𝑥 −𝜆 𝑦
𝑓𝑋 (𝑥) = 𝜆e = 𝜆e .
𝜆 √
So we conclude that 𝑓𝑌 (𝑦) = √ e−𝜆 𝑦 .
2 𝑦
We have found 𝐹𝑌 (𝑦). If we wanted 𝑓𝑌 (𝑦) we could take the derivative. We would get the
same answer as in the previous example.
𝑋−5
Example 6. Assume 𝑋 ∼ N(5, 32 ) then 𝑍 = is standard normal, i.e., 𝑍 ∼ N(0, 1).
3
Solution: Again using the change of variables and the formula for 𝑓𝑋 (𝑥) we have
𝑥−5 𝑑𝑥
𝑧= ⇒ 𝑑𝑧 = , therefore 𝑑𝑥 = 3 𝑑𝑧
3 3
For this example we will transform 𝑓𝑋 (𝑥) 𝑑𝑥 in one line instead of two.
1 2 2 1 2 1 2
𝑓𝑋 (𝑥) 𝑑𝑥 = √ e−(𝑥−5) /(2⋅3 ) 𝑑𝑥 = √ e−𝑧 /2 3 𝑑𝑧 = √ e−𝑧 /2 𝑑𝑧 = 𝑓𝑍 (𝑧) 𝑑𝑧
3 2𝜋 3 2𝜋 2𝜋
1 2
Therefore 𝑓𝑍 (𝑧) = √ e−𝑧 /2 . Since this is exactly the density for N(0, 1) we have shown
2𝜋
that 𝑍 is standard normal.
This example shows an important general property of normal random variables which we
state as a theorem.
Theorem. Standardization of normal random variables.
𝑋−𝜇
Assume 𝑋 ∼ N(𝜇, 𝜎2 ). Show that 𝑍 = is standard normal, i.e., 𝑍 ∼ N(0, 1).
𝜎
18.05 Class 5, Manipulating Continuous Random Variables, Spring 2022 4
Proof. This is exactly the same computation as the previous example with 𝜇 replacing 5
and 𝜎 replacing 3. We show the computation without comment.
𝑥−𝜇 𝑑𝑥
𝑧= ⇒ 𝑑𝑧 = ⇒ 𝑑𝑥 = 𝜎 𝑑𝑧
𝜎 𝜎
1 2 2 1 2 1 2
𝑓𝑋 (𝑥) 𝑑𝑥 = √ e−(𝑥−𝜇) /(2⋅𝜎 ) 𝑑𝑥 = √ e−𝑧 /2 𝜎 𝑑𝑧 = √ e−𝑧 /2 𝑑𝑧 = 𝑓𝑍 (𝑧) 𝑑𝑧
𝜎 2𝜋 𝜎 2𝜋 2𝜋
1 2
Therefore 𝑓𝑍 (𝑧) = √ e−𝑧 /2 . This shows 𝑍 is standard normal.
2𝜋
We call the change from 𝑋 to 𝑍 in this theorem standardization because it converts 𝑋 from
an arbitrary normal random variable to a standard normal variable.
MIT OpenCourseWare
https://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.