0% found this document useful (0 votes)
0 views3 pages

Assgn 3

The document outlines two assignments for a course on Mathematical Methods in Climate Science, focusing on probability distributions and programming tasks. Assignment 3a includes problems related to random variables, probability density functions, and expectations, while Assignment 3b involves programming tasks related to generating random variates and analyzing their distributions. Both assignments have specific due dates and submission guidelines for hard copies and email submissions.

Uploaded by

Prasant Sahay
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)
0 views3 pages

Assgn 3

The document outlines two assignments for a course on Mathematical Methods in Climate Science, focusing on probability distributions and programming tasks. Assignment 3a includes problems related to random variables, probability density functions, and expectations, while Assignment 3b involves programming tasks related to generating random variates and analyzing their distributions. Both assignments have specific due dates and submission guidelines for hard copies and email submissions.

Uploaded by

Prasant Sahay
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/ 3

AS 209: Mathematical Methods in Climate Science (Jan. - Apr.

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

(a) If Y = aX + b, then σY = |a|σX .


(b) E(aX 2 + b) = aσX
2 + aµ2 + b
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)

DUE DATE: 24/02/2025

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.

Please e-mail your scripts to [email protected], with a cc to [email protected]

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:

YourName Assignment N Problem No M Part a or b or c.m

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.

11. Generate a uniform random variate X, between 0 and 1, of size N .


Define the following:
Y = 2πX
Z = sin(Y )

(a) Find the theoretical distributions of Y and Z.


(b) Using the generated X, generate Y and Z
(c) Plot the PDF of X, Y and Z using the generated random variates (plot different figures) using “m” number of
bins.
(d) For the PDFs of Y and Z, plot the theoretical PDF against the numerically calculated histogram, and compare
how well it fits.
(e) Compute E(Z) and Var(Z) theoretically.
(f) Compute E(Z) and Var(Z) numerically using the generated sample of Z.
(g) Repeat (f) for various sample sizes, and plot the estimates of E(Z) and Var(Z) as a function of the sample size
(N = 100, 500, 1000, 2000, 5000, 10000, 20000, 50000, 100000). Comment on what happens to these estimates
as N increases.

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

(a) Find the theoretical distribution of Z.


(b) Choose values of a and b that are different from 0 (i.e., a ̸= 0, b ̸= 0) and generate Z.
(c) Plot the PDFs of X and Z using the generated random variates (plot different figures) using “m” number of
bins.
(d) Plot the theoretical PDF of Z against the numerically calculated histogram, and compare how well it fits (visu-
ally).

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.

Denoting the discriminant to be D, then D = g(Y) = 16Y2 − 16(Y + 2),

(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.

You might also like