Assgn 3
Assgn 3
2025)
Assignment 3a [DUE DATE: 07/02/2025]
(Derived distributions; Expectation)
1. The random variable X is uniform in the interval [0, 1]. Find the probability density function of the random
variable Y = − ln(X).
2. Given that the random variable X is of the continuous type, find Y = g(X) such that Y is uniform in the
interval [α, α + β], where α ∈ R, and β > 0.
3. If X ∼ Uniform(-1,1), find (i) the PDF of the random variable |X|; (ii) P (|X| > 21 ). (Solve part (ii) with
and without the PDF of |X|.)
4. The following relationships arise in the study of earthquake-resistant design. If Y represents the ground-
motion intensity at a building site, X represents the magnitude of an earthquake, then Y = c exp(X), where
c is a constant related to the distance between the site and center of the earthquake. If X is exponentially
distributed with parameter λ, find the PDF and CDF of Y , and sketch them.
5. If X has a PDF
−x2
!
1
fX (x) = √ exp x∈R
2π 2
show that the probability density function of Y = X 2 is
1 −y
fY (y) = √ exp y>0
2πy 2
Also, if X has a mean and variance equal to 0 and 1, respectively, find the mean of Y .
(We will see later that X is considered to have a Normal distribution and, Y, a Chi-squared distribution. Both these
distributions find extensive use in problems relating to confidence intervals and hypothesis testing.)
6. Suppose that P (X = 0) = 1 − P (X = 1). If the mean of X is N times its variance, find P (X = 0) in terms of N .
Based on the expression you have obtained, what can you say about the values that N can take?
7. A coin with P(Heads) = p and P(Tails) = q is tossed and the first outcome is noted. The tossing is continued until
the outcome is the complement of the first outcome, thus completing the run or experiment. Let X denote the length
of the run. For instance, HT and T H correspond to a length of run = X = 1 while T T T H or HHHT translate to a
length of run = X = 3. Find the probability mass function of X, and verify its validity. Show also that
p q
E(X) = +
q p
8. Consider Problem 3 in Assignment 2, where you found the PMF of X which represents the number of coin tosses to
get consecutive heads or tails. Find E(X).
2 represent the mean and variance of a random variable X, then,
9. Show that, if a and b are constants, and µX and σX
10. The moment generating function of a random variable X is denoted by ϕX (t), and defined as:
ϕX (t) = E [exp(tX)]
Show that the nth derivative of ϕX (t), evaluated at t = 0, equals the nth non-central moment of X; i.e., show that
n
d ϕX (t)
= E [X n ]
dtn t=0
AS 209: Mathematical Methods in Climate Science (Jan. - Apr. 2025)
Assignment 3b
(Programming)
Submission guidelines for programming scripts and solution of the following 3 problems
A hard-copy of the solutions to 9(a), 9(e), 10(a), 11(a) and 11(b) should be submitted in class on the due date.
The naming of the programming script should be broadly along the following convention. For instance, if it is a matlab
script, the filename should be:
If the T.A or I cannot figure out which problem or subpart it is or whose script it is, it will not be graded.
Your program should have the size of the data (N ) and the number of bins (m) as input parameters.
12. Generate an exponential random variate X of size N with average rate λ = 5/hr. Assume that the time unit of interest
= 1 hour.
Define the following:
Z = aX + b
Your program should have, as input parameters, the average rate (λ), the size of the data (N ) and the number of bins
(m) as input parameters.
13. Let Y ∼ U (0, 5). Consider the quadratic equation 4x2 + 4Y x + (Y + 2) = 0. We are interested in finding the
probability that the roots of this equation are real.
We solved this in class in the following way: For real roots, the discriminant = 16Y 2 − 16(Y + 2) ≥ 0 =⇒ Y 2 −
Y − 2 = (Y − 2)(Y + 1) ≥ 0. Since Y ∼ U (0, 5), Y + 1 > 0 always; thus for (Y − 2)(Y + 1) ≥ 0, Y has to
be ≥ 2. In other words, the probability of the quadratic equation having real roots is the same as P (Y ≥ 2). Since
fY (y) = 15 ; FY (y) = y5 , P (Y ≥ 2) = 1 − FY (2) = 1 − 52 = 35 .
Here, you are asked to solve the problem theoretically (in a somewhat round-about way) and numerically.
(a) Find the probability density function of D, fD (d), using what we discussed about “derived distributions”.
(b) Using fD (d), find the probability that D ≥ 0. This is naturally the same as the probability that the above
quadratic equation has real roots, which is 53 as derived earlier.
(c) Generate a large number of samples (say 10000 or 100000) of a random variable which is uniform between 0
and 5 (i.e., Y ). First, generate a Uniform(0,1) and use a linear transformation to obtain a Uniform(0,5) random
variate. Plot the PDF of Y for verification.
(d) Use each of these samples of Y and obtain as many values for the discriminant, D.
(e) Plot and compare the PDF of D obtained theoretically (in part (b)) and numerically.
(f) Find the proportion of values of the discriminant that are non-negative. This should be the same as the prob-
ability that the quadratic equation has real roots, and should match with the probability obtained in part (b) or
3
5.