Assignment 2: CS 215
Due: 28th August before 11:55 pm
Remember the honor code while submitting this (and every other) assignment. All members of
the group should work on all parts of the assignment. We will adopt a zerotolerance policy against
any violation.
Submission instructions:
1. You should type out all the answers to the written problems in Word (with the equation editor) or using
Latex, or write it neatly on paper and scan it. In either case, prepare a pdf file.
2. Put the pdf file and the code for the programming parts all in one zip file.
The pdf should contain
the names and ID numbers of all students in the group within the header.
The pdf file should also
contain instructions for running your code.
Name the zip file as follows:
A2IdNumberOfFirstStudent
IdNumberOfSecondStudent.zip.
(If you are doing the assignment alone, the name of the zip file is A2
IdNumber.zip).
3. Upload the file on moodle BEFORE 11:55 pm on the due date (i.e. 28th August). We will nevertheless allow
and not penalize any submission until 6:00 am on the following day (i.e. 29th August). No assignments will
be accepted thereafter.
4. Note that only one student per group should upload their work on moodle.
5. Please preserve a copy of all your work until the end of the semester.
Questions:
1. Let
X
1
, X
2
, ..., X
n
be
n >
0 independent identically distributed random variables with cdf
F
X
(
x
) and
pdf
f
X
(
x
) =
F
0
X
(
x
).
Derive an expression for the cdf and pdf of
Y
1
= max(
X
1
, X
2
, ..., X
n
) and
Y
2
=
min(
X
1
, X
2
, ..., X
n
) in terms of
F
X
(
x
).
[10 points]
Solution:
F
Y
1
(
x
) =
P
(
Y
1
≤
x
) =
P
(
X
1
≤
x, X
2
≤
x, ..., X
n
≤
x
) =
Q
n
i
=1
P
(
X
i
≤
x
) =
Q
n
i
=1
F
X
i
(
x
) =
(
F
X
(
x
))
n
. Hence
f
Y
1
(
x
) =
n
(
F
X
(
x
))
n

1
f
X
(
x
).
P
(
Y
2
≥
x
) =
P
(
X
1
≥
x, X
2
≥
x, ..., X
n
≥
x
) =
Q
n
i
=1
P
(
X
i
≥
x
) = (1

F
X
(
x
))
n
. Hence
F
Y
2
(
x
) = 1

P
(
Y
2
≥
x
) = 1

(1

F
X
(
x
))
n
. Hence
f
Y
2
(
x
) =
n
(1

F
X
(
x
))
n

1
f
X
(
x
).
2. We say that a random variable
X
belongs to a Gaussian mixture model (GMM) if
X
∼
∑
K
i
=1
p
i
N
(
μ
i
, σ
2
i
)
where
p
i
is the ‘mixing probability’ for each of the
K
constituent Gaussians, with
∑
K
i
=1
p
i
= 1;
∀
i,
0
≤
p
i
≤
1.
To draw a sample from a GMM, we do the following: (1) One of the
K
Gaussians is randomly chosen as per
the PMF
{
p
1
, p
2
, ..., p
K
}
(thus, a Gaussian with a higher mixing probability has a higher chance of being
picked). (2) Let the index of the chosen Gaussian be (say)
m
. Then, you draw the value from
N
(
μ
m
, σ
2
m
).
If
X
belongs to a GMM as defined here, obtain expressions for
E
(
X
)
,
Var(
X
) and the MGF of
X
.
Now consider a random variable of the form
X
i
∼ N
(
μ
i
, σ
2
i
) for each
i
∈ {
1
,
2
, ..., K
}
. Define another random
variable
Z
=
∑
K
i
=1
p
i
X
i
. Derive an expression for
E
(
Z
)
,
Var(
Z
) and the PDF, MGF of
Z
.
[2+2+2+2+2+2+3=15
points]
Solution:
We have
E
(
X
) =
∑
K
i
=1
p
i
E
(
X
i
) =
∑
K
i
=1
p
i
μ
i
.
We also have
E
(