Midterm 2
SDS321
Spring 2017
You may use a two (2 sided) pages of notes, and you may use a calculator.
This exam consists of five questions, containing multiple sub-questions. The assigned
points are noted next to each question; the total number of points is 25. You have 75
minutes to answer the questions.
Please answer all problems in the space provided on the exam. Use extra pages if
needed. Of course, please put your name on extra pages.
Read each question carefully, show your work and clearly present your answers. Note,
the exam is printed two-sided - please don’t forget the problems on the even pages!
Good Luck!
Name:
UTeid:
1
1 Short questions (10 points)
1. (2 pts) The time to repair a car is an exponentially distributed random variable
with parameter λ = 1/2. That is, letting X denote the repair time, X Exp(1/2).
If the repair time exceeds 4 hours what is the probability that it exceeds 8 hours?
Solution: Use the memoryless property. P (X > 8|X > 4) = P (X >
4) = e
4λ
= e
2
.
Grading: 1 pt for using the memoryless property. 1 pt for correct answer.
2. (4 pts) Let X N(70, 10
2
) be a normal random variable with µ = 70 and σ = 10.
Find q such that P (|X 70| q) = .32.
Solution: P (|X70| q) = P (X < 70q)+P (X > 70+q) = 2P (X >
70 + q) = 2P ((X 70)/10 > q/10) = .32. So P ((X 70)/10 > q/10) =
P (Z > q/10) = .16. So P (Z < q/10) = 1 .16 = .84. Lookup normal
table. q/10 = 1. So q = 10.
Grading: 1 pt for understanding P (|X 70| q) = P (X < 70 q) + P (X >
70 + q). 1 pt for symmetry. 1 pt understanding P (Z < q/10) = 1 .16 = .84.
1 pt for correct answer.
2
3. (4 pts) Let X and Y be two random variables with X N(0, 4) and Y N(0, 1).
Calculate cov(X + Y, X Y ). Use the rules of covariance!
Solution: cov(X + Y, X Y ) = cov(X, X) + cov(X, Y ) + cov(Y, X) +
cov(Y, Y ) = var(X) cov(X, Y ) + cov(X, Y ) var(Y ) = var(X)
var(Y ) = 3.
Grading: 1 pt for using cov(X + Y, X Y ) = cov(X, X) + cov(X, Y ) +
cov(Y, X) + cov(Y, Y ). 1/2 pt for remembering cov(X, X) = var(X), 1/2
pt for cov(X, Y ) = cov(Y, X), 1/2 pt for cov(X, aY ) = a cov(X, Y ). 1/2 pt
for var(X) = 4 and 1/2 pt for var(Y ) = 1. And 1/2 pt for correct answer.
If anyone did it from definition of covariance, and wrote E(X
2
Y
2
) =
E(X
2
)+E(Y
2
) and got 4+1 = 5, just take one point off. If anyone assumed
independence, take one point off and point it out.
3
2 Long questions (15 points)
1. (5 pts) The pdf of a random variable X is given by:
f
X
(x) =
2 c x < 0
2e
4x
0 x <
(a) (2 pts) Calculate c.
Solution: Use
R
−∞
f
X
(x)dx =
R
0
c
f
X
(x)dx +
R
0
f
X
(x)dx = 1. So
2c + 2
R
0
e
4x
dx = 2c + 2 × 1/4 = 2c + 1/2 = 1. So c = 1/4.
Grading: 1/2 pt for using normalization. 1/2 pt for getting the first
part. 1/2 pt for getting the second part. 1/2 pt for correct answer.
(b) (2 pts) Calculate f
X|X0
(x). Please specify the region where the conditional
PDF is zero.
Solution: f
X|X0
(x) = f
X
(x)/P (X 0) = 2e
4x
/(1/2) = 4e
4x
when x 0 and zero otherwise.
Grading: 1 pt for correct formula. 1 pt for correct answer. Take 1/2
pt off if the region is not specified.
(c) (1 pts) Calculate E[X|X 0].
Solution: The conditional PDF is that of Exponential(4). So con-
ditional expectation is 1/4.
Grading: 1/2 pt for identifying this is exponential(4). 1/2 pt for
correct expectation.
4
2. (5 pts) The joint pdf of two random variables X and Y is given by:
f
X,Y
(x, y) =
ce
(
x
2
8
+4y)
−∞ < x < , y 0
0 Otherwise
(a) (1 pt) Are X and Y independent? Explain your answer.
Solution: Yes. The joint factorizes.
Grading: 1 pt for correct explanation.
(b) (3 pts) What is c?
Solution: f
X
(x) is similar to e
x
2
/8
which looks like a N(0, 4) ran-
dom variable. So f
X
(x) = 1/
2π × 4e
x
2
/8
and f
Y
(y) = 4e
4y
for
y 0. So c = 4/
2π × 4.
Grading: 1/2 pt for identifying X is a normal. 1/2 pt for correct
mean and 1/2 pt for correct variance. 1/2 pt for identifying X is
a exponential, 1/2 pt for the correct lambda. 1 pt for multiplying
the two normalization constants. If variance of normal is off but
everything else is correct, take 1/2 pt off altogether.
(c) (1 pts) What is E[XY ]?
Solution: E[XY ] = E[X]E[Y ] = 0.
Grading: 1/2 pt for using independence. 1/2 pt for correct answer.
5
3. (5 pts) Ben and Holly are each picking a real number independently and uni-
formly at random between 0 and 2. Let X denote the number picked by Ben
and Y denote the number picked by Holly. Thus, X Uniform([0, 2]) and
Y Uniform([0, 2]). X and Y are both continuous random variables.
(a) (3 pts) Write the joint PDF f
X,Y
(x, y). Please specify where the joint PDF
is zero as well.
Solution: f
X
(x) = 1/2 when x [0, 2] and zero otherwise. f
Y
(y) =
1/2 when y [0, 2] and zero otherwise. Since they are independent,
f
X,Y
(x, y) = 1/4 when x, y [0, 2] and zero otherwise.
Grading: 1 pt for correct f
X
, 1 pt for correct f
Y
, 1 pt for correct
joint. Every time one does not specify the limits, take 1/2 pt off.
Many of them have assumed that the joint is uniform as well, which
is ok. Do not take points off.
(b) (2 pts) What is the probability that Ben picks a number bigger than Holly,
i.e. calculate P (X > Y ). Drawing a picture may come in handy.
P (X > Y ) = area × pdf = 1/2 × 2 × 2 × 1/4 = 1/2. Or integrating
R
2
x=0
R
x
y=0
1/4dxdy = 1/4
R
2
x=0
xdx = 1/4 × 4/2 = 1/2.
Grading: If they draw a picture, 1/2 pt for identifying the area. 1/2
pt for area and 1/2 pt for the pdf. 1/2 pt for correct answer. If they
integrate. 1/2 pt for limit of x, 1/2 pt for limits of y, and 1 pt for
correct integration.
6
Useful distributions
All PDFs/PMFs are zero outside the range specified.
PDF/PMF E[X] var(X)
Bernoulli(p) p
x
(1 p)
1x
, x = 0, 1 p p(1 p)
Binomial(n, p)
n
k
p
k
(1 p)
nk
, k=0,1,. . . ,n np np(1 p)
Geometric(p) p(1 p)
k1
, k = 1, 2, 3, . . .
1
p
1p
p
2
Poisson(λ)
λ
k
e
λ
k!
, k = 0, 1, 2, 3, . . . λ λ
Normal(µ, σ
2
)
1
2πσ
2
e
(xµ)
2
2σ
2
µ σ
2
Exponential(λ) λe
λx
, x 0
1
λ
1
λ
2
Uniform([a, b])
1
ba
a x b, b > a
b+a
2
(ba)
2
12
7
Standard normal table
0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09
0 0.5000 0.5040 0.5080 0.5120 0.5160 0.5199 0.5239 0.5279 0.5319 0.5359
0.1 0.5398 0.5438 0.5478 0.5517 0.5557 0.5596 0.5636 0.5675 0.5714 0.5753
0.2 0.5793 0.5832 0.5871 0.5910 0.5948 0.5987 0.6026 0.6064 0.6103 0.6141
0.3 0.6179 0.6217 0.6255 0.6293 0.6331 0.6368 0.6406 0.6443 0.6480 0.6517
0.4 0.6554 0.6591 0.6628 0.6664 0.6700 0.6736 0.6772 0.6808 0.6844 0.6879
0.5 0.6915 0.6950 0.6985 0.7019 0.7054 0.7088 0.7123 0.7157 0.7190 0.7224
0.6 0.7257 0.7291 0.7324 0.7357 0.7389 0.7422 0.7454 0.7486 0.7517 0.7549
0.7 0.7580 0.7611 0.7642 0.7673 0.7704 0.7734 0.7764 0.7794 0.7823 0.7852
0.8 0.7881 0.7910 0.7939 0.7967 0.7995 0.8023 0.8051 0.8078 0.8106 0.8133
0.9 0.8159 0.8186 0.8212 0.8238 0.8264 0.8289 0.8315 0.8340 0.8365 0.8389
1 0.8413 0.8438 0.8461 0.8485 0.8508 0.8531 0.8554 0.8577 0.8599 0.8621
1.1 0.8643 0.8665 0.8686 0.8708 0.8729 0.8749 0.8770 0.8790 0.8810 0.8830
1.2 0.8849 0.8869 0.8888 0.8907 0.8925 0.8944 0.8962 0.8980 0.8997 0.9015
1.3 0.9032 0.9049 0.9066 0.9082 0.9099 0.9115 0.9131 0.9147 0.9162 0.9177
1.4 0.9192 0.9207 0.9222 0.9236 0.9251 0.9265 0.9279 0.9292 0.9306 0.9319
1.5 0.9332 0.9345 0.9357 0.9370 0.9382 0.9394 0.9406 0.9418 0.9429 0.9441
1.6 0.9452 0.9463 0.9474 0.9484 0.9495 0.9505 0.9515 0.9525 0.9535 0.9545
1.7 0.9554 0.9564 0.9573 0.9582 0.9591 0.9599 0.9608 0.9616 0.9625 0.9633
1.8 0.9641 0.9649 0.9656 0.9664 0.9671 0.9678 0.9686 0.9693 0.9699 0.9706
1.9 0.9713 0.9719 0.9726 0.9732 0.9738 0.9744 0.9750 0.9756 0.9761 0.9767
2 0.9772 0.9778 0.9783 0.9788 0.9793 0.9798 0.9803 0.9808 0.9812 0.9817
2.1 0.9821 0.9826 0.9830 0.9834 0.9838 0.9842 0.9846 0.9850 0.9854 0.9857
2.2 0.9861 0.9864 0.9868 0.9871 0.9875 0.9878 0.9881 0.9884 0.9887 0.9890
2.3 0.9893 0.9896 0.9898 0.9901 0.9904 0.9906 0.9909 0.9911 0.9913 0.9916
2.4 0.9918 0.9920 0.9922 0.9925 0.9927 0.9929 0.9931 0.9932 0.9934 0.9936
2.5 0.9938 0.9940 0.9941 0.9943 0.9945 0.9946 0.9948 0.9949 0.9951 0.9952
2.6 0.9953 0.9955 0.9956 0.9957 0.9959 0.9960 0.9961 0.9962 0.9963 0.9964
2.7 0.9965 0.9966 0.9967 0.9968 0.9969 0.9970 0.9971 0.9972 0.9973 0.9974
2.8 0.9974 0.9975 0.9976 0.9977 0.9977 0.9978 0.9979 0.9979 0.9980 0.9981
2.9 0.9981 0.9982 0.9982 0.9983 0.9984 0.9984 0.9985 0.9985 0.9986 0.9986
3 0.9987 0.9987 0.9987 0.9988 0.9988 0.9989 0.9989 0.9989 0.9990 0.9990
8