Transformation of Random Variable, Chebyshev’s
Inequality and Simulation
Gauranga C. Samanta
Department of Mathematics
BITS Pilani K K Birla Goa Campus, Goa
21st September 2019
Transformation of One Dimensional Random Variable
Let X be a random variable defined on the event space S and let
g (.) be a function such that Y = g (X ) is also a r. v. defined on S.
The goal of this section is to find density (pdf) of Y .
Theorem
Let X be a continuous r. v. with density fX . Let Y = g (X ), where
g is strictly monotonic and differentiable. The density for Y is
denoted by fY and is given by
−1
dg −1 (y )
fY (y ) = fX (g (y )) dy
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Transformation of One Dimensional Random Variable
Continued
Following Steps may follow:
Start with determining the cumulative distribution function of
Y , where FY (y ) = P(Y < y ) = P(g (X ) < y ).
By finding the event A (in the range of X ) which is equivalent
to the event {Y ≤ y }.
Differentiate FY (y ) with respect to y and obtain fY (y ).
Determine those values of y in the range of Y for which
f (y ) > 0.
If g is a one-to-one function, then the inverse function, g −1
exists.
If Y is strictly increasing, then {g (X ) ≤ y } is equivalent to
{X ≤ g −1 (y )}, and we have
FY (y ) = P[X ≤ g −1 (y )] = FX (g −1 (y ))
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Transformation of One Dimensional Random Variable
Continued
If Y is strictly decreasing, then {g (X ) ≤ y } is equivalent to
{X ≥ g −1 (y )}, and we have
FY (y ) = P[X ≥ g −1 (y )] = 1 − FX (g −1 (y ))
Example
Let X be a r. v. with density fX (x) = 2x 0 < x < 1 and let
g (X ) = Y = 3X + 6. Find fY (y )?
2(y −6)
ANS: f (y ) = 9 ,6 < Y < 9.
Example
A box is to be constructed so that the height is 4 inches and its
base is X by X inches. If X has a standard normal distribution,
what is the distribution of the volume of the box?
ANS: GAM(1/2, 8)
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Transformation of One Dimensional Random Variable
Continued
If Y is strictly decreasing, then {g (X ) ≤ y } is equivalent to
{X ≥ g −1 (y )}, and we have
FY (y ) = P[X ≥ g −1 (y )] = 1 − FX (g −1 (y ))
Example
Let X be a r. v. with density fX (x) = 2x 0 < x < 1 and let
g (X ) = Y = 3X + 6. Find fY (y )?
2(y −6)
ANS: f (y ) = 9 ,6 < Y < 9.
Example
A box is to be constructed so that the height is 4 inches and its
base is X by X inches. If X has a standard normal distribution,
what is the distribution of the volume of the box?
ANS: GAM(1/2, 8)
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Transformation of One Dimensional Random Variable
Continued
If Y is strictly decreasing, then {g (X ) ≤ y } is equivalent to
{X ≥ g −1 (y )}, and we have
FY (y ) = P[X ≥ g −1 (y )] = 1 − FX (g −1 (y ))
Example
Let X be a r. v. with density fX (x) = 2x 0 < x < 1 and let
g (X ) = Y = 3X + 6. Find fY (y )?
2(y −6)
ANS: f (y ) = 9 ,6 < Y < 9.
Example
A box is to be constructed so that the height is 4 inches and its
base is X by X inches. If X has a standard normal distribution,
what is the distribution of the volume of the box?
ANS: GAM(1/2, 8)
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Examples
Example
Let X be uniformely distributed over (0, 4) and let
g (X ) = Y = (X − 3)2 . Find the density for Y ?
( 1
√ , 0 < y < 1,
ANS: f (y ) = 4 1 y
8 y,1 < y < 9
√
Example
(
1
−1 < x < 1
2,
Let f (x) = What is the pdf of Y = X 2 ?
0, elsewhere
Example
X −µ
Let Z = σ . If X ∼ N(µ, σ 2 ), what is the pdf of Z ?
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Examples
Example
Let X be uniformely distributed over (0, 4) and let
g (X ) = Y = (X − 3)2 . Find the density for Y ?
( 1
√ , 0 < y < 1,
ANS: f (y ) = 4 1 y
8 y,1 < y < 9
√
Example
(
1
−1 < x < 1
2,
Let f (x) = What is the pdf of Y = X 2 ?
0, elsewhere
Example
X −µ
Let Z = σ . If X ∼ N(µ, σ 2 ), what is the pdf of Z ?
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Example
Let Z = X σ−µ . If X ∼ N(µ, σ 2 ), then show that Z 2 is chi-square
with one degree of freedom, that Z 2 ∼ χ2 (1).
Example
Let Y = − ln X . If X ∼ UNIF (0, 1), then what is the density
function of Y where nonzero?
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Example Continued
Example
Let X and Y be two independent(r. v. with identical probability
e −x , forx > 0
density function given by f (x) = What is the
0, elsewhere.
probability density function of W = min{X , Y }?
ANS: f (w ) = 2e −2w , w > 0
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Example Continued
Example
Let X and Y be two independent(r. v. with identical probability
e −x , forx > 0
density function given by f (x) = What is the
0, elsewhere.
probability density function of W = min{X , Y }?
ANS: f (w ) = 2e −2w , w > 0
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Example Continued
Theorem
If X is a continuous r. v. with strictly increasing cdf F (x), then
the r. v. Y , defined by
Y = F (X )
has the uniform distribution on the interval [0, 1].
Example
If the probability density function of X is
e −x
f (x) = (1+e −x )2
, −∞ < x < ∞,
1
then what is the pdf of Y = 1+e −X
?
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Example Continued
Theorem
Let X ∼ U[0, 1] and define the random variable Y by
Y = a + (b − a)X . Then Y ∼ U[a, b].
Example
−π π
Suppose that X ∼ U 2 , 2 and let Y = sin(X ). Find the pdf of
Y .
Example
(
2x
π2
, 0<x <π
Let X be an R. V. with pdf fX (x) = Let
0, otherwise
Y = sin X , find the pdf of Y
ANS: √ 2 ,0 < y < 1
π 1−y 2
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Example Continued
Theorem
Let X ∼ U[0, 1] and define the random variable Y by
Y = a + (b − a)X . Then Y ∼ U[a, b].
Example
−π π
Suppose that X ∼ U 2 , 2 and let Y = sin(X ). Find the pdf of
Y .
Example
(
2x
π2
, 0<x <π
Let X be an R. V. with pdf fX (x) = Let
0, otherwise
Y = sin X , find the pdf of Y
ANS: √ 2 ,0 < y < 1
π 1−y 2
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
Example
(
x
0 < x < 2π
2π 2
,
Let X be a rv with pdf f (x) = , and let
0, otherwise
Y = sin(X ). Find the density for Y .
√3 2 , −1 < y < 0
ANS: f (y ) = 2π 11−y
√ ,0 < y < 1
2π 2
1−y
Example
Let X ∼ U(−π/2, π/2), and Y = cos(X ). Find the density for Y .
ANS: f (y ) = √ 2 ,0 < y < 1
π 1−y 2
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
Example
(
x
0 < x < 2π
2π 2
,
Let X be a rv with pdf f (x) = , and let
0, otherwise
Y = sin(X ). Find the density for Y .
√3 2 , −1 < y < 0
ANS: f (y ) = 2π 11−y
√ ,0 < y < 1
2π 2
1−y
Example
Let X ∼ U(−π/2, π/2), and Y = cos(X ). Find the density for Y .
ANS: f (y ) = √ 2 ,0 < y < 1
π 1−y 2
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
Example
(
x
0 < x < 2π
2π 2
,
Let X be a rv with pdf f (x) = , and let
0, otherwise
Y = sin(X ). Find the density for Y .
√3 2 , −1 < y < 0
ANS: f (y ) = 2π 11−y
√ ,0 < y < 1
2π 2
1−y
Example
Let X ∼ U(−π/2, π/2), and Y = cos(X ). Find the density for Y .
ANS: f (y ) = √ 2 ,0 < y < 1
π 1−y 2
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problem for Self Assessment
Example
Let X∼ U(−4, 3), and
X + 7, X ≤ −3
X 2 − 2|X | + 1, −3 < X < 0
Y =
1 − |X |, 0≤X <1
X − 1, X ≥1
Find the density for Y .
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Chebyshev’s Inequality
Theorem
Let X be a random variable with mean µ and standard deviation
σ. Then for any positive number k,
1. P[|X − µ| < kσ] ≥ 1 − k12
or
1
2. P[|X − µ| ≥ kσ] ≤ k2
Proof: Please see the lecture note for continuous random variable.
please try to proof (HW) for discrete random variable.
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
Example
The tensile strength of some synthetic fibres can be determined by
tying two strands together and pulling until either the right strand
or the left strand breaks. If 144 strands of such a fiber get broken,
what does Chebyshev’s theorem with k = 4 tell us about the
number of cases where the left strand breaks?
Example
If one material out of 6 materials for bulletproof vests fails to meet
puncture standards and 405 specimens are tested, what does
Chebyshev’s theorem tell us about the probability of getting either
at most 30 or more than 105 cases that do not meet puncture
standards?
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
Example
The tensile strength of some synthetic fibres can be determined by
tying two strands together and pulling until either the right strand
or the left strand breaks. If 144 strands of such a fiber get broken,
what does Chebyshev’s theorem with k = 4 tell us about the
number of cases where the left strand breaks?
Example
If one material out of 6 materials for bulletproof vests fails to meet
puncture standards and 405 specimens are tested, what does
Chebyshev’s theorem tell us about the probability of getting either
at most 30 or more than 105 cases that do not meet puncture
standards?
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
Example
Show that for 1000000 flips of a balanced coin the probability is at
least 0.99 that the propertion of heads will fall between 0.495 and
0.505
Example
How many times do we have to flip a coin to be able to assert with
a probability of at most 0.01 that the difference between the
proportion of tails and the value of 0.5 will be at least 0.04?
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
Example
Show that for 1000000 flips of a balanced coin the probability is at
least 0.99 that the propertion of heads will fall between 0.495 and
0.505
Example
How many times do we have to flip a coin to be able to assert with
a probability of at most 0.01 that the difference between the
proportion of tails and the value of 0.5 will be at least 0.04?
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
Example
The daily number of orders filled by the parts department of a
repair shop is a random variable with µ = 142 and σ = 12.
According to Chebyshev’s theorem, with what probability can we
assert that on any one day it will fill between 82 and 202 orders?
Example
A company produces X bulbs per day. If E (X ) = 1000 and
V (X ) = 100, find the probability that 900 < X < 1100.
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
Example
The daily number of orders filled by the parts department of a
repair shop is a random variable with µ = 142 and σ = 12.
According to Chebyshev’s theorem, with what probability can we
assert that on any one day it will fill between 82 and 202 orders?
Example
A company produces X bulbs per day. If E (X ) = 1000 and
V (X ) = 100, find the probability that 900 < X < 1100.
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Simulation
Example
A car manufacturing firm produce 1 to 8 units daily according to
uniform distribution. The number of vehicles available to ship the
manufactured cars from factory to market daily follows Poisson
distribution with mean 1. Capacity of shipping vehicle is 2 cars.
The probability of a shipped car being sold in a day is 0.75
independent of all sales. If each sold car gives a net profit of 2
Lakhs, whereas each unshipped car or shipped but unsold car has
storage cost of 2000 or 4000 per car per day respectively. Using
random numbers 0.80, 0.82 and 0.59 once in the given order,
simulate the net profit for the manufacturing firm in a day.
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Simulation
Example
Buses arrive at a sporting event according to a Poisson process
with a rate 5 per hour. Each bus is equally likely to contain either
20, 21, 22, 23 fans, with the numbers in the different buses being
independent. Using random numbers 0.92,0.20,0.80, simulate the
arrival of fans to the event by time t = 0.1 hours.
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Simulation
Example
A company ’A’ plans to supply raw material to company ’B’ on a
daily basis according to a Poisson process at the rate of 1 unit/day.
Each day company ’B’ is supposed to run a quality testing process
before accepting the supplied raw material from ’A’ . If the
acceptance of each unit of supplied material is independent with
probability 0.8, using random numbers 0.20, 0.75 and 0.66 exactly
once in the given order, simulate the number of units accepted in
the first and the second day.
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
Example
Suppose the claims are made to an insurance company according
to a Poisson process with rate 3 per day. The amount of the claim
is a continuous random variable with density U ($1000, $1500).
The insurance company receives payment of $2000 per day. At the
end of each day settlement is done and if the company runs short
with the money to repay the claims of that day, then the company
borrow the remaining amount, else, in case of the excess money,
the excess money will be used to settle the next day claim rather
than repaying its loan. Use following random numbers exactly once
in the given order to simulate the total amount at the end of the
fifth day; the random numbers are 0.22, 0.50, 0.75, 0.12, 0.20,
0.53, 0.10, 0.21, 0.32, 0.01, 0.31, 0.80, 0.71. Also find the total
amount borrowed by the insurance company during the above
mentioned period.
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problems
A T − 20 match is played between team B and team C . Length of
every over is fixed as 5 minutes. The time (in minutes) between
fall of wickets for both the team follows
x
450 , if 0 < x ≤ 15
1,
if 15 < x < 35
f (x) = 803x 2
692500 , if 35 ≤ x < 60
1 ,
if 60 ≤ x < 100
160
The partnership of runs in each wicket follows discrete uniform
over {0, 1, 2, · · · , n − 1}, where n = b2tc if number of wickets fall
in less than or equal to 5, else n = btc and t is the time for which
the partnership occur. Using the following random numbers 0.375,
0.81, 0.25, 0.85, 0.75, 0.84, 0.5, 0.88, 0.375, 0.91, 0.8, 0.76 once
in the given order simulate the T − 20 match to find out whether
team B won the match with how many runs or did team C win the
match with how many wickets. Assume team B bat first.
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
Problem
A company has two machines. Each machine has 3 electrical
components. Each electrical component works independently and
2
has a failure time distribution (in hours) f (t) = 2te −t , t > 0. The
components are placed in the machine such that until one fails, the
other does not start and machine does not fail until all the
components fail. Using the random numbers 0.1, 0.7, 0.2
(machine-I), 0.9, 0.3, 0.8 (machine II), simulate number of
machines working more than 3 hours (observations rounded off to
3 decimal places).
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa
THANK YOU
Gauranga C. Samanta BITS Pilani, K K Birla Goa Campus, Goa