程序代写案例-STAT 134

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
STAT 134 - Instructor: Adam Lucas
Midterm
Friday, March 8, 2019
SOLUTIONS
Exam Information and Instructions:
• You will have 45 minutes to
take this exam. Closed book/notes/etc. No calculator
or computer.
• We will be using Gradescope to grade this exam. Write any work you want graded
on the front of each page, in the space below each question. Additionally, write your
SID number in the top right corner on every page.
• Please use a dark pencil (mechanical or #2), and bring an eraser. If you use a pen
and make mistakes, you might run out of space to write in your answer.
• Provide calculations or brief reasoning in every answer.
• Unless stated otherwise, you may leave answers as unsimplified numerical and al-
gebraic expressions, and in terms of the Normal c.d.f. . Finite sums are fine, but
simplify any infinite sums.
• Do your own unaided work. Answer the questions on your own. The students
around you have di↵erent exams.
1

Stat 134, Spring 2019 Midterm Solutions
1. (5 pts)
a Suppose that there is a machine that gives out a random number Y between 0
and 80. You are also told that E[Y ] = 20. Now someone proposes you a game
where you win if the number that shows up is strictly smaller than 40. Assume
that you always play games when you have a chance of at least 12 of winning.
Given the information you have, can you determine whether you should agree
to play the game?
b Suppose that there is a machine that gives out a random number X between 20
and 100. You are also told that E[X] = 40. Now someone proposes you a game
where you win if the number that shows up is strictly smaller than 60. Assume
that you always play games when you have a chance of at least 12 of winning.
Given the information you have, can you determine whether you should agree
to play the game?
a Using Markov’s inequality we get
P(Y 40)  E[Y ]
40
=
20
40
=
1
2
.
This implies that
P(Y < 40) = 1 P(Y 40) 1 1
2
=
1
2
hence you should agree to play the game.
b Substitute Y = X 20 into your conclusion from part a and you get
P(X < 60) = P(X 20 < 40) = P(Y < 40) 1
2
hence you should agree to play the game
2
Stat 134, Spring 2019 Midterm Solutions
2. (5 pts) An airport bus drops o↵ 35 passengers at 7 stops. Each passenger is equally
likely to get o↵ at any stop, and passengers act independently of one another. The
bus makes a stop only if someone wants to get o↵. Find the probability that the
bus drops o↵ passengers at every stop.
Let Ai be the event that nobody gets o↵ at the ith stop. By De Morgan’s law, the
desired probability is 1 P (A1 [ A2 [ · · · [ A7). The probability that nobody gets
o↵ at n of the 7 stops is (7n7 )
35. By the inclusion-exclusion formula,
P (A1 [ A2 [ · · · [ A7) =
7X
i=1
P (Ai)
X
iP (AiAj) + · · ·+ (1)7+1P (A1A2A3 . . . A7)
=
7X
n=1
(1)n+1

7
n

(
7 n
7
)35
The final answer is 1 P (A1 [ A2 [ · · · [ A7) = 1
P7
n=1(1)n+1

7
n

(7n7 )
35
3
Stat 134, Spring 2019 Midterm Solutions
3. (5 pts) Consider a grid of n2 cups, with n rows of n cups. Toss n ping pong balls at
random into these cups, where at most one ball can occupy a particular cup. Let
X be the number of unoccupied rows (i.e., where every cup in that row contains no
balls). Find:
(a) P (X 1);
(b) E(X);
(c) V ar(X).
Solutions
(a) We think of this as selecting n cups (without replacement) from the n2 total.
We want to find the chance that all n cups selected come from di↵erent rows.
(This is similar to the chance of all ranks appearing in 13 cards, from Quiz 2.)
P (X 1) = 1 P (X = 0)
= 1

n
1
n
n2
n

Or, an alternate method for finding P (X = 0): we think about the slots the
balls are allowed to go in; i.e., the first ball can go in any row, then the second
ball must go in a row di↵erent from the first one, and so on. Note that after k
balls have been placed, n(n k) possible slots will yield the k+1th ball being
in a new row, while n2 k slots remain. This yields
P (X = 0) =
n2
n2
· n(n 1)
n2 1 ·
n(n 2)
n2 2 · . . . ·
n(1)
n2 (n 1)
=
nn · n!
(n2)n
These approaches are equivalent; expanding out the binomial coecients above
will demonstrate this result. This second approach could then be used for (b)
and (c) as well.
4
Stat 134, Spring 2019 Midterm Solutions
(b) We proceed here using indicators. Let Ii be the indicator that row i is unoccu-
pied. This is the same as the chance that all n balls fall in the n2n remaining
cups.
E(X) = E(
nX
i=1
Ii)
=
nX
i=1
E(Ii)
= nP (Ii = 1)
= n

n
0

n2n
n

n2
n

(c) Again, we use indicators. Following the method discussed in Lecture 14,
V ar(X) = E(X2) E(X)2, where E(X) is given in part (b), and
E(X2) = E
24 nX
i=1
Ii
!235
= E

nX
i=1
I2i +
X
j 6=k
IjIk
!
= nE(I21 ) + n(n 1)E(I1I2)
Here, E(I21 ) = E(I1), and
E(I1I2) = P (rows 1, 2 unoccupied)
=

n22n
n

n2
n

So our final answer is
V ar(X) = n

n
0

n2n
n

n2
n
+ n(n 1) · n22nn
n2
n
nn0n2nn
n2
n
!2
5
Stat 134, Spring 2019 Midterm Solutions
4. (5 pts) Consider a box containing 1000 balls, of which m are gold and the remaining
1000m are blue (Go Bears!). You draw 1000 balls from the box, randomly with
replacement. Let X be the number of gold balls you get.
(a) For any 1  m  1000, what is P (X = m)? Your answer should be in terms
of m.
(b) For m = 500, what is P (X = 500), approximately?
(c) For m = 2, what is P (X = 2), approximately?
(a) This is a Bin(n, p) probability, with n = 1000 and p = m/1000. Accordingly,
P (X = m) =

1000
m

pm(1 p)1000m.
(b) This is a Bin(1000, 1/2) probability, which is best approximated by the Normal
distribution with mean np = 500 and variance np(1 p) = 250. Let X ⇠
Bin(1000, 1/2) be the number of gold balls produced from the draws. Then we
approximate P (X = m) as
P (X = 500) = P (500  X  500) ⇡

500 + 0.5 500p
250



500 0.5 500p
250

.
(c) This is a Bin(1000, 2/1000) probability, which is best approximated by the
Poisson distribution, with mean µ = np = 2. Let X ⇠ Bin(1000, 2/1000)
be the number of gold balls produced by the draws. Then we approximate
P (X = 2) as
P (X = 2) ⇡ e22
2
2!
= 2e2.
6
Stat 134, Spring 2019 Midterm Solutions
5. (5 pts) Suppose that Player A and Player B take turns rolling a pair of balanced
dice and that the winner is the first player who obtains the sum of 7 on a given roll
of the two dice. Assume that the rolls are independent. What is the probability
that Player A wins the game if he rolls first?
The probability that one of the players gets a 7 on any given roll is 636 =
1
6 since
there are 6 outcomes that lead to a sum of 7 ( (1, 6), (2, 5), (3, 4), (4, 3), (5, 2) and
(6, 1) ) and 36 is the total number of possible outcomes.
Let W be the event that Player A wins. Then W = [1n=1Wn, where Wn is the event
that Player A wins at the nth roll of the dice (we count the total number of rolls
of both Player A and B). First note that Player A can only win at odd times, since
they only rolls the dice at odd times. So P(W2n) = 0 for all n. Player A wins at
time 2n + 1 if the sum of the two dice is always di↵erent from 7 until time 2n and
it is 7 at roll 2n+ 1. So P(W2n+1) =

5
6
2n 1
6 . Using the infinite sum rule this gives
P(W ) = P([1n=1Wn) =
1X
n=1
P(Wn) =
1X
n=0
P(W2n+1)
=
1X
n=0

5
6
◆2n 1
6
=
1
6
1
1 562 =
1
6 256
.
7

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468