0% found this document useful (0 votes)
8 views5 pages

Mit18 05 s22 Class05-Prep-D

Uploaded by

Nur Aidina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views5 pages

Mit18 05 s22 Class05-Prep-D

Uploaded by

Nur Aidina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Manipulating Continuous Random Variables

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.

2 Transformations of Random Variables

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:

• The cdf of 𝑋 is 𝐹𝑋 (𝑥) = 𝑃 (𝑋 ≤ 𝑥).



• The pdf of 𝑋 is related to 𝐹𝑋 by 𝑓𝑋 (𝑥) = 𝐹𝑋 (𝑥).

2.1 Transforming the cdf

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 ≤ 𝑦).

Step 3. Algebraically manipulate this to isolate the 𝑋:



𝑃 (𝑋 2 ≤ 𝑦) = 𝑃 (𝑋 ≤ 𝑦)

Step 4. Notice that this is exactly the definition of 𝐹𝑋 :


√ √
𝑃 (𝑋 ≤ 𝑦) = 𝐹𝑋 ( 𝑦)

1
18.05 Class 5, Manipulating Continuous Random Variables, Spring 2022 2

Step 5. Use the known formula for 𝐹𝑋 :


√ √
𝐹𝑋 ( 𝑦) = ( 𝑦)2 /4 = 𝑦/4.

Following the chain from step 1 to step 5 we have the cdf:


√ √
𝐹𝑌 (𝑦) = 𝑃 (𝑌 ≤ 𝑦) = 𝑃 (𝑋 2 ≤ 𝑦) = 𝑃 (𝑋 ≤ 𝑦) = 𝐹𝑋 ( 𝑦) = 𝑦/4.

Finally, to find the pdf we can just differentiate the cdf:


𝑑 1
𝑓𝑌 (𝑦) = 𝐹 (𝑦) = .
𝑑𝑦 𝑌 4

2.2 Transforming the pdf directly

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’.)

Solution: The trick is to remember that probability is given by an integral ∫ 𝑓𝑋 (𝑥)𝑑𝑥.


We are given the change of variable 𝑦 = 𝑥2 , so we change the integral from one in 𝑥 to one
in 𝑦.
𝑑𝑦
𝑦 = 𝑥2 ⇒ 𝑑𝑦 = 2𝑥 𝑑𝑥, therefore 𝑑𝑥 = √ .
2 𝑦

We are given 𝐹𝑋 (𝑥) = 𝑥2 /4, so we can compute 𝑓𝑋 (𝑥) = 𝐹𝑋 (𝑥) = 𝑥/2. Changing this to 𝑦
we have

𝑓𝑋 (𝑥) = 𝑦/2.
Putting the two pieces together we have the transformation

𝑦 𝑑𝑦 1
𝑓𝑋 (𝑥) 𝑑𝑥 = √ = 𝑑𝑦
2 2 𝑦 4
18.05 Class 5, Manipulating Continuous Random Variables, Spring 2022 3

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 .

Combining these we get,


√ 𝑑𝑦
𝑓𝑋 (𝑥) 𝑑𝑥 = 𝜆e−𝜆 𝑦
√ = 𝑓𝑌 (𝑦) 𝑑𝑦.
2 𝑦

𝜆 √
So we conclude that 𝑓𝑌 (𝑦) = √ e−𝜆 𝑦 .
2 𝑦

Example 5. Redo the previous example using the cdf.


Solution: The cdf for the exponential random variable 𝑋 is 𝐹𝑋 (𝑥) = 1 − e−𝜆𝑥 . Therefore,
for 𝑌 = 𝑋 2 we have
√ √ √
𝐹𝑌 (𝑦) = 𝑃 (𝑌 ≤ 𝑦) = 𝑃 (𝑋 2 ≤ 𝑦) = 𝑃 (𝑋 ≤ 𝑦) = 𝐹𝑋 ( 𝑦) = 1 − e−𝜆 𝑦 .

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

18.05 Introduction to Probability and Statistics


Spring 2022

For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.

You might also like