MIT18 05S14 Class27-Sol PDF
MIT18 05S14 Class27-Sol PDF
MIT18 05S14 Class27-Sol PDF
Problem 1. (Counting)
(a) There are several ways to think about this. Here is one.
The 11 letters are p, r, o, b,b, a, i,i, l, t, y. We use the following steps to create a sequence
of these letters.
Step 1: Choose a position for the letter p: 11 ways to do this.
Step 2: Choose a position for the letter r: 10 ways to do this.
Step 3: Choose a position for the letter o: 9 ways to do this.
Step 4: Choose two positions for the two b’s: 8 choose 2 ways to do this.
Step 5: Choose a position for the letter a: 6 ways to do this.
Step 6: Choose two positions for the two i’s: 5 choose 2 ways to do this.
Step 7: Choose a position for the letter l: 3 ways to do this.
Step 8: Choose a position for the letter t: 2 ways to do this.
Step 9: Choose a position for the letter y: 1 ways to do this.
Multiply these all together we get:
8 5 11!
11 · 10 · 9 · ·6· ·3·2·1 =
2 2 2! · 2!
Problem 2. (Probability)
We are given P (E ∪ F ) = 3/4.
1
Class 26: review for final exam solutions, Spring 2014 2
E c ∩ F c = (E ∪ F )c ⇒ P (E c ∩ F c ) = 1 − P (E ∪ F ) = 1/4.
Problem 3. (Counting)
Let Hi be the event that the ith hand has one king. We have the conditional probabilities
4 48 3 36 2 24
1 12 1 12 1 12
P (H1 ) = ; P (H2 |H1 ) = ; P (H3 |H1 ∩ H2 ) =
52 39 26
13 13 13
P (H4 |H1 ∩ H2 ∩ H3 ) = 1
(a) Sample space = Ω = {(1, 1), (1, 2), (1, 3), . . . , (6, 6) } = {(i, j) | i, j = 1, 2, 3, 4, 5, 6 }.
(Each outcome is equally likely, with probability 1/36.)
A = {(1, 3), (2, 2), (3, 1)},
B = {(3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (1, 3), (2, 3), (4, 3), (5, 3), (6, 3) }
P (A ∩ B ) 2/36 2
P (A|B) = = = ..
P (B) 11/36 11
(b) P (A) = 3/36 6= P (A|B), so they are not independent.
Here is the game tree, R1 means red on the first draw etc.
Class 26: review for final exam solutions, Spring 2014 3
7/10 3/10
R1 B1
6/9 3/9 7/10 3/10
R2 B2 R2 B2
5/8 3/8 6/9 3/9 6/9 3/9 7/10 3/10
R3 B3 R3 B3 R3 B3 R3 B3
X -2 -1 0 1 2
We compute
p(X) 1/15 2/15 3/15 4/15 5/15
[
1 2 3]15 + 1 · 4 5 2
E[X] = −2 · + −1 · +0· +2· = .
15 15 15 15 3
Thus
2 14
Var(X) = E((X − )2 ) = .
3 9
Make a table X: 0 1
prob: (1-p) p
X2 0 1.
From the table, E(X) = 0 · (1 − p) + 1 · p = p.
Since X and X 2 have the same table E(X 2 ) = E(X) = p.
Therefore, Var(X) = p − p2 = p(1 − p).
(c) E(X + Y ) = E(X) + E(Y ) = 150/6 = 25., E(2X) = 2E(X) = 150/6 = 25.
Var(X + Y ) = Var(X) + Var(Y ) = 250/4. Var(2X) = 4Var(X) = 500/4.
The means of X + Y and 2X are the same, but Var(2X) > Var(X + Y ).
This makes sense because in X + Y sometimes X and Y will be on opposite sides from the
mean so distances to the mean will tend to cancel, However in 2X the distance to the mean
is always doubled.
.52 + .53
13
P (.5 < X < 1) = FX (1) − FX (.5) = 1 − = .
2 16
(a) We compute
Z 5
P (X ≥ 5) = 1 − P (X < 5) = 1 − λe−λx dx = 1 − (1 − e−5λ ) = e−5λ .
0
(b) We want P (X ≥ 15|X ≥ 10). First observe that P (X ≥ 15, X ≥ 10) = P (X ≥ 15).
From similar computations in (a), we know
d d 1 1 2
fy (a) = FY (a) = Φ(ln(a)) = φ(ln(a)) = √ e−(ln(a)) /2 .
da da a 2π a
(b) (i) We want to find q.33 such that P (Z ≤ q.33 ) = .33. That is, we want
Problem 16. (a) We did this in class. Let φ(z) and Φ(z) be the PDF and CDF of Z.
FY (y) = P (Y ≤ y) = P (aZ + b ≤ y) = P (Z ≤ (y − b)/a) = Φ((y − b)/a).
Differentiating:
d d 1 1 2 2
fY (y) = FY (y) = Φ((y − b)/a) = φ((y − b)/a) = √ e−(y−b) /2a .
dy dy a 2π a
Since this is the density for N(b, a2 ) we have shown Y ∼ N(b, a2 ).
(b) By part (a), Y ∼ N(µ, σ 2 ) ⇒ Y = σZ + µ.
But, this implies (Y − µ)/σ = Z ∼ N(0, 1). QED
Cov(X, Y ) = Cov(X1 + X2 + X3 , X3 + X4 + X5 )
= Cov(X1 , X3 ) + Cov(X1 , X4 ) + Cov(X1 , X5 )
+ Cov(X2 , X3 ) + Cov(X2 , X4 ) + Cov(X2 , X5 )
+ Cov(X3 , X3 ) + Cov(X3 , X4 ) + Cov(X3 , X5 )
1
Because the Xi are independent the only non-zero term in the above sum is Cov(X3 X3 ) = Var(X3 ) =
4
Therefore, Cov(X, Y ) = 14 .
We get the correlation by dividing by the
p standard deviations. Since X is the sum of 3
independent Bernoulli(.5) we have σX = 3/4
Cov(X, Y ) 1/4 1
Cor(X, Y ) = = = .
σX σY (3)/4 3
(a) Here we have two continuous random variables X and Y with going potability density
function
12
f (x, y) = xy(1 + y) for 0 ≤ x ≤ 1 and 0 ≤ y ≤ 1,
5
and f (x, y) = 0 otherwise. So
Z 1 Z 2
1 1 1 2 2 3 41
P( ≤ X ≤ , ≤ Y ≤ ) = f (x, y)dy dx = .
4 2 3 3 1 1 720
4 3
Class 26: review for final exam solutions, Spring 2014 7
RaRb
(b) F (a, b) = 0 0 f (x, y)dy dx = 35 a2 b2 + 25 a2 b3 for 0 ≤ a ≤ 1 and 0 ≤ b ≤ 1.
(c) We find the marginal cdf FX (a) by setting b in F (a, b) to the top of its range, i.e. b = 1.
So FX (a) = F (a, 1) = a2 .
(d) For 0 ≤ x ≤ 1, we have
Z ∞ Z 1
fX (x) = f (x, y)dy = f (x, y)dy = 2x.
−∞ 0
d 2
This is consistent with (c) because dx (x ) = 2x.
(e) We first compute fY (y) for 0 ≤ y ≤ 1 as
Z 1
6
fY (y) = f (x, y)dx = y(y + 1).
0 5
Since f (x, y) = fX (x)fY (y), we conclude that X and Y are independent.
Problem 21.
Standardize:
! !
1 P
X
n Xi − µ 30/n − µ
P Xi < 30 =P √ < √
σ/ n σ/ n
i
30/100 − 1/5
≈P Z< (by the central limit theorem)
1/30
= P (Z < 3)
= 0.9987 (from the table of normal probabilities)
Then, for example, the expected number of re-offenders in the control group is 200 · θ̂ = 50.
The other expected counts are computed in the same way.
The chi-square test statistic is
X (observed - expected)2 202 202 202 202
X2 = = + + + ≈ 8 + 2.67 + 8 + 2.67 ≈ 21.33.
expected 50 150 50 150
Finally, we need the degrees of freedom: df = 1 because this is a two-by-two table and
(2 − 1) · (2 − 1) = 1. (Or because we can freely fill in the count in one cell and still be
consistent with the marginal counts 200, 200, 100, 300, 400 used to compute the expected
counts.)
From the χ2 table: p = P (X 2 > 21.33|df = 1) < 0.01.
Conclusion: we reject H0 in favor of HA . The experimental intervention appears to be
effective.
(n − 1)s2
∼ χ2n−1
σ2
We used R to find the critical values. (Or use the χ2 table.)
c025 = qchisq(0.975,19) = 32.852
c975 = qchisq(0.025,19) = 8.907
The 95% confidence interval for σ 2 is
(n − 1) · s2 (n − 1) · s2 19 · 4.062 19 · 4.662
, = , = [9.53, 35.16]
c0.025 c0.975 32.852 8.907
We can take square roots to find the 95% confidence interval for σ
[3.09, 5.93]
(b) It’s tricky to keep the sides straight here. We work slowly and carefully:
The 5th and 95th percentiles for x̄∗ are the 10th and 190th entries
2.89, 3.72
(Here again there is some ambiguity on which entries to use. We will accept using the 11th
or the 191st entries or some interpolation between these entries.)
So the 5th and 95th percentiles for p∗ are
1/3.72 = 0.26882, 1/2.89 = 0.34602
So the 5th and 95th percentiles for δ∗ = p∗ − p̂ are
−0.034213, 0.042990
These are also the 0.95 and 0.05 critical values.
So the 90% CI for p is
[0.30303 − 0.042990, 0.30303 + 0.034213] = [0.26004, 0.33724]
Problem 30. (a) The steps are the same as in the previous problem except the bootstrap
samples are generated in different ways.
Step 1. We have the point estimate q0.5 ≈ q̂0.5 = 3.3.
Step 2. Use the computer to generate many (say 10000) size 100 resamples of the original
data.
Step 3. For each sample compute the median q0∗.5 and δ ∗ = q0∗.5 − q̂0.5 .
Step 4. Sort the δ ∗ and find the critical values δ0.95 and δ0.05 . (Remember δ0.95 is the 5th
percentile etc.)
Step 5. The 90% bootstrap confidence interval for q0.5 is
[q̂0.5 − δ0.05 , q̂0.5 − δ0.95 ]
(b) This is very similar to the previous problem. We proceed slowly and carefully to get
terms on the correct side of the inequalities.
The 5th and 95th percentiles for q0∗.5 are
2.89, 3.72
So the 5th and 95th percentiles for δ ∗ = q0∗.5 − q̂0.5 are
[2.89 − 3.3, 3.72 − 3.3] = [−0.41, 0.42]
These are also the 0.95 and 0.05 critical values.
So the 90% CI for p is
[3.3 − 0.42, 3.3 + 0.41] = [2.91, 3.71]
Problem 31. The model is yi = a + bxi + εi , where εi is random error. We assume the
errors are independent with mean 0 and the same variance for each i (homoscedastic).
The total error squared is
X
E2 = (yi − a − bxi )2 = (1 − a − b)2 + (1 − a − 2b)2 + (3 − a − 3b)2
The least squares fit is given by the values of a and b which minimize E 2 . We solve for
them by setting the partial derivatives of E 2 with respect to a and b to 0. In R we found
that a = 1.0, b = 0.5
MIT OpenCourseWare
https://ocw.mit.edu
For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.