Functions of One dimensional random variables
If X is a discrete random variable and 𝑌 = 𝐻(𝑋) is a continuous function of X,
then Y is also a Discrete Random Variable.
Eg:
𝑋 -1 0 1
𝑃(𝑥) 1 1 1
3 2 6
Suppose 𝑌 = 3𝑋 + 1,then pmf of Y is given by
𝑌 -2 1 4
𝑃(𝑦) 1 1 1
3 2 6
2
Suppose 𝑌 = 𝑋 , then pmf of 𝑌is
𝑌 1 0
𝑃(𝑦) 1 1
2 2
Suppose X is a continuous random variable with pdf 𝑓(𝑥) and 𝐻(𝑋) is a
continuous function of 𝑋. Then 𝑌 is a continuous random variable. To obtain pdf
of Y we follow the following steps.
1. Obtain cdf of 𝑌, i.e., 𝐺(𝑦) = 𝑃(𝑌 ≤ 𝑦).
2. Differentiate 𝐺(𝑦) with respect to 𝑦 to get pdf of 𝑦 i.e., 𝑔(𝑦).
3. Determine the range space of 𝑌 such that 𝑔(𝑦) > 0.
Problems:
2𝑥; 0 < 𝑥 < 1
1. If 𝑓(𝑥) = { , and 𝑌 = 3𝑋 + 1, find pdf of 𝑌.
0; 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
𝑦−1
Soln: 𝐺(𝑦) = 𝑃(𝑌 ≤ 𝑦) = 𝑃(3𝑋 + 1 ≤ 𝑦) = 𝑃 (𝑋 ≤ ) 3
𝑦−1
𝑦−1 2
𝐺(𝑦) = ∫0 3 2𝑥𝑑𝑥 = ( ) .
3
2(𝑦−1)
𝑔(𝑦) = 𝐺’(𝑦)= .
9
𝑦−1
0<𝑥<1⟹0< < 1 ⟹ 1 < 𝑦 < 4.
3
2(𝑦−1)
; 1<𝑦<4
Therefore, 𝑔(𝑦) = { 9 .
0; 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
2𝑥; 0 < 𝑥 < 1
2. If 𝑓(𝑥) = { , and 𝑌 = 𝑒 −𝑋 , find pdf of 𝑌.
0; 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
1
Soln: 𝐺(𝑦) = 𝑃(𝑌 ≤ 𝑦) = 𝑃(𝑒 −𝑋 ≤ 𝑦) = 𝑃 (log 𝑒 ≤ 𝑋)
𝑦
1 1 2
𝐺(𝑦) = ∫log 1 2𝑥𝑑𝑥 = 1 − (log e ) .
𝑒𝑦 𝑦
2 1
𝑔(𝑦) = 𝐺’(𝑦)= log e .
𝑦 𝑦
1 1
0 < 𝑥 < 1 ⟹ 0 < log e < 1 ⟹ < 𝑦 < 1.
𝑦 𝑒
2 1 1
log e ; <𝑦<1
Therefore, 𝑔(𝑦) = { 𝑦 𝑦 𝑒 .
0; 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Result: Let 𝑋 be a continuous random variable with pdf 𝑓(𝑥). Let 𝑌 = 𝑋 2 .
1
Then pdf of 𝑌 is 𝑔(𝑦) = (𝑓(√𝑦) + 𝑓(−√𝑦))
2√𝑦
−𝑥 2
Example 1: Suppose 𝑓(𝑥) = { 2𝑥𝑒 ; 0 < 𝑥 < ∞. Find pdf of 𝑌 = 𝑋 2 .
0; 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Soln:
1 1
𝑔 (𝑦 ) = (𝑓(√𝑦) + 𝑓(−√𝑦)) = (2√𝑦𝑒 −𝑦 + 0) = 𝑒 −𝑦 ; 0 < 𝑥 < ∞.
2√𝑦 2√𝑦
2
(𝑥 + 1); −1 < 𝑥 < 1
Example 2: Suppose 𝑓 (𝑥) = { 9 . Find pdf of 𝑌 = 𝑋 2 .
0; 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
Soln:
1 1 2(√𝑦+1) 2(−√𝑦+1) 2
𝑔(𝑦) = 2 (𝑓(√𝑦) + 𝑓(−√𝑦)) = 2 ( + )=9 ; 0 < 𝑥 < 1.
√𝑦 √𝑦 9 9 √𝑦
Theorem: Let X be a continuous random variable with pdf 𝑓(𝑥). Suppose
𝑌 = 𝐻(𝑋) is a strictly monotone (increasing or decreasing) function of X,
then pdf of 𝑌 is given by
𝑑𝑥
𝑔(𝑦) = 𝑓(𝑥) | | where 𝑥 = 𝐻−1 (𝑦).
𝑑𝑦
Example:
1
1. Suppose X is uniformly distributed over (0,1), find pdf of 𝑌 = .
𝑋+1
Soln: We know that 𝑌 is strictly monotone.
1; 0<𝑥<1
𝑓(𝑥) = { .
0; 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
1 1
Note that 𝑋 = − 1. ⇒ 𝑓(𝑥) = 𝑓 ( − 1) = 1.
𝑌 𝑌
𝑑𝑥 1
| |= .
𝑑𝑦 𝑦2
1 1
Therefore, 𝑔(𝑦) = ; < 𝑦 < 1.
𝑦2 2
𝜋 𝜋
2. If 𝑋 is uniformly distributed over (− , ), find the pdf of 𝑌 =
2 2
𝑡𝑎𝑛𝑋. (Or show that 𝑌 = 𝑡𝑎𝑛𝑋 follows Cauchy’s distribution).
1 𝜋 𝜋
; − <𝑥<
Soln: Given 𝑓(𝑥) = {𝜋 2 2.
0; 𝑂𝑡ℎ𝑒𝑟𝑤𝑖𝑠𝑒
We know that 𝑌 is strictly monotone.
1 𝑑𝑥 1
Then 𝑋 = tan−1 𝑌 ⇒ 𝑓(tan−1 𝑌) = . And | | = .
𝜋 𝑑𝑦 1+𝑦 2
1 1
Therefore, 𝑔(𝑦) = ; −∞ < 𝑦 < ∞.
𝜋 1+𝑦 2
𝑋−𝜇
3. If 𝑋~𝑁(𝜇, 𝜎 2 ), then show that 𝑍 = ~𝑁(0,1) and 𝑌 = 𝑍 2 ~𝜒 2 (1).
𝜎
𝑋−𝜇
Soln: 𝐺(𝑧) = 𝑃(𝑍 ≤ 𝑧) = 𝑃 ( ≤ 𝑧) = 𝑃(𝜎𝑧 + 𝜇 ≥ 𝑥)
𝜎
𝐺(𝑧) = 𝐹(𝜎𝑧 + 𝜇).
𝑧2
′ (𝑧) ′ (𝜎𝑧 1 −
𝑔(𝑧) = 𝐺 =𝐹 + 𝜇)𝜎 = 𝑓(𝜎𝑧 + 𝜇)𝜎 = 𝑒 2 ~𝑁(0,1).
√2𝜋
𝑦 𝑦
1 1 1 1
Now, 𝑔(𝑦) = 2 (𝑓(√𝑦) + 𝑓(−√𝑦)) = 2 ( 𝑒 −2 + 𝑒 −2 )
√ 𝑦 √ 𝑦 √2𝜋 √2𝜋
𝑦
1 −
𝑔(𝑦) = 𝑒 2 .
√𝑦 √2𝜋
Hence, 𝑔(𝑦)~𝜒 2 (1).
Extra Problem:
1. A random variable X having Cauchy distribution. Show that 1/𝑋
also has Cauchy distribution.