Math 151 - Midterm Solutions - Winter 2012
Math 151 - Midterm Solutions - Winter 2012
Math 151 - Midterm Solutions - Winter 2012
1. The following is a strategy for deciding who goes first in a game which is to be
played by N players. Each of the players flips a fair coin. If either (a) all coins
come out the same or (b) the number of heads and tails are identical, the flips are
repeated. If not, then the players in the majority (i.e. those who flipped heads if
there were more heads than tails and vice versa) drop out and the remaining players
repeat the process, until only one player is left, and he/she goes first.
(a) Suppose there are 3 players. What is the probability that the number of flips
is greater than 2?
P (X > 2) = 1 − P (X = 1) − P (X = 2)
6 2 6
=1− − ·
8 8 8
1
= .
16
(b) Again with 3 players, what is the expected value of the number of flips?
(c) Suppose there are 4 players. What is the expected value of the number of
flips?
= 2.
(d) Again with 4 players, what is the probability that the process ends?
= 1.
(b) What is the probability that two of the integers are equal, conditioned on the
requirement that the three integers add up to 100?
Note that 100 is not divisible by three, it is not possible that all three integers
are equal and add up to 100. The probability that two of the integers are
equal and the three integers add up to 100 is
= 3P (X1 = X2 , X1 + X2 + X3 = 100)
X50
=3 P (X1 + X2 + X3 = 100|X1 = X2 = k)P (X1 = X2 = k)
k=0
X50
=3 P (X3 = 100 − 2k)P (X1 = X2 = k)
k=0
50 2
X 1 1
=3 ·
k=0
101 101
3 · 51
= .
1013
Hence
P (two are equal and three add to 100)
P (two are equal|three add to 100) =
P (three add to 100)
3 · 51/1013
=
51/1012
3
=
101
≈0.0297
(c) Given again that the sum of the integers is 100, what is the probability that
all three are equal?
Since 100 is not divisible by three, it is not possible that all three integers
are equal and add up to 100. So the conditional probability that all three are
equal given the sum of the integers is 100 is zero.
(d) Given that the sum of all the integers is 100, what is the probability that the
first number drawn is a 7?
We have
3. Let S = {1, . . . , n}. Suppose that subsets A and B are chosen independently from
S so that A and B are equally likely to be any of the 2n subsets of S (including
both the empty set and S itself).
(a) What is the probability that A ⊆ B?
There are a number of ways to approach this problem.
Solution 1. The easiest method is to do the following. For 1 ≤ i ≤ n, let Ci
be the event that A ∩ {i} ⊆ B ∩ {i}. Note that P (Ci ) = 43 . This is because Ci
occurs if i is in neither A nor B, if i is in both A and B, and if i is in B but
not in A, and because Ci does not occur if i is in A but not B. Note also that
for i 6= j, the events Ci and Cj are independent.
Thus
P {A ⊆ B}
n n
X 2i i
=
i=0
2n 2n
n
1 X n i
= n 2
4 i=0 i
n
1 n
X n i
= n · 3 since we can evaluate x = (1 + x)n at x = 2
4 i=0
i
3 n
= .
4
Thus
P (A ∩ B = ∅) = P (A ⊆ S \ B)
(c) What is the expected value of #(A ∩ B), where #(A ∩ B) is the number of
elements in the set A ∩ B?
1
E[Fi ] = p(Fi = 1) = ,
4
and that
#(A ∩ B) = F1 + F2 + · · · + Fn .
Because the expected value of a sum is the sum of the expected values, we
have that
4. Suppose that we have two tests, T1 and T2 , for a disease. A positive test result is
indicative of the presence of the disease. The following table gives the probabilities
that a healthy patient or a patient with the disease will receive a positive test result
under test T1 or T2 .
Healthy Disease
T1 10% 95%
T2 8% 90%
We assume the tests are independent, so that the events of T1 and T2 being positive
are independent. Assume also that 5% of the population has the disease.
Let H = Healthy be the event that the patient is healthy, and let D = Disease
be the event that the patient has the disease.
P (H and T1 positive)
P (H|T1 positive) =
P (T1 positive)
P (T1 positive|H)P (H)
=
P (T1 positive|H)P (H) + P (T1 positive|D)P (D)
0.10 · 0.95
=
0.10 · 0.95 + 0.95 · 0.05
2
=
3
Similarly,
P (H|T1 , T2 negative)
P (H and T1 , T2 negative)
=
P (T1 , T2 negative)
P (T1 , T2 neg.|H)P (H)
=
P (T1 , T2 neg.|H)P (H) + P (T1 , T2 neg.|D)P (D)
P (T1 neg.|H)P (T2 neg.|H)P (H)
=
P (T1 neg.|H)P (T2 neg.|H)P (H) + P (T1 neg.|D)P (T2 neg.|D)P (D)
by independence
0.90 · 0.92 · 0.95
=
0.90 · 0.92 · 0.95 + 0.05 · 0.10 · 0.05
≈ 0.99968
(c) Find the conditional probabilty P (Disease|T1 and T2 are both positive).
P (D|T1 , T2 positive)
P (D and T1 , T2 positive)
=
P (T1 , T2 positive)
P (T1 , T2 pos.|D)P (D)
=
P (T1 , T2 pos.|D)P (D) + P (T1 , T2 pos.|H)P (H)
P (T1 pos.|D)P (T2 pos.|D)P (D)
=
P (T1 pos.|D)P (T2 pos.|D)P (D) + P (T1 pos.|H)P (T2 pos.|H)P (H)
by independence
0.95 · 0.90 · 0.05
=
0.95 · 0.90 · 0.05 + 0.10 · 0.08 · 0.95
≈ 0.8491
5. Let X be a binomial random variable with number of trials equal to n and proba-
bility of success p. What value of p maximizes P {X = k}, for k = 0, 1, . . . , n?
Note that
n k
P {X = k} = p (1 − p)n−k .
k
Our goal is to maximize this as a function of p ∈ [0, 1]. First let’s consider the
boundary points p = 0 or 1. It’s clear that p = 0 is the optimum choice for k = 0,
that p = 1 is the optimum choice for k = n, and that p = 0 or 1 is not the optimum
choice for any other value of k.
Next, we take the derivative of this function and set it equal to zero, to get
d
0= P {X = k}
dp
d n k
= p (1 − p)n−k
dp k
n
= kpk−1 (1 − p)n−k − (n − k)pk (1 − p)n−k−1
k
n k−1
= p (1 − p)n−k−1 k(1 − p) − (n − k)p .
k
0 = k(1 − p) − (n − k)p
=⇒ 0 = k − kp − np + kp
=⇒ 0 = k − np
k
=⇒ p =
n
k
Hence the value p = n
maximizes P {X = k}, for k = 0, 1, . . . , n.
6. We suppose that a point (x, y) is chosen from the circular region D = {(x, y) |
x2 + y 2 ≤ 1}, in such a way that the probability that the point is chosen from any
region in D is proportional to its area.
1 P (y ≤ 0 and x ≥ 21 )
P (y ≤ 0|x ≥ ) =
2 P (x ≥ 12 )
area of blue region
=
area of blue region and red regions
1
= by symmetry.
2
(c) What is the probability that (x, y) lies inside the square S given by − √12 ≤
x, y ≤ √1 ?
2
area of blue region
P ((x, y) in S) =
√ area
√ of circle
2· 2
=
π
2
=
π
≈ 0.6366.
2
7. Let p(n) = 3n
for any integer n ≥ 1. Let X denote the random variable X(n) = n.
(a) Show that p defines a probability distribution on the set {1, 2, . . . , n, . . .}.
2
Note that p(n) = 3n
≥ 0 for all n ≥ 1, as required. Note also that
∞
X 2 2/3
n
= = 1.
n=1
3 1 − 1/3
8. Suppose that 10, 000 monkeys are typing at typewriters, and that 4, 000 of them are
typing at 100 characters per minute and 6, 000 of them are typing at 200 characters
per minute. After how many years does it become likely that one of the monkeys
will have typed “Macbeth”?
Comments:
• Your answer should only be an estimate, and will require assumptions about
the document, so different estimates will be possible. State clearly all assump-
tions you make.
First let’s state our assumptions. We assume that there are 26 characters in Mac-
beth (we are ignoring punctuation and spaces) and that there are 26 characters on each
keyboard. We assume that a monkey types a key by choosing one of the 26 characters
uniformly at random. We assume that the monkeys are able to continue typing at their
paces indefinitely. We assume that the monkeys are typing independently of each other.
Moreover, we assume that whenever we compare a copy of “Macbeth” with a copy
shifted by a fixed amount, the two copies never coincide on the region of overlap. This
allows us to assume that the event that “a monkey types Macbeth starting at his i-
th character” is weakly independent of the event that “the same monkey types Macbeth
starting at his j-th character”, even when i and j are such that the two copies of Macbeth
would overlap. Hence we can treat each of the events
1 1
= P (at least one success) ≈ exp −n · 300,000 .
2 26
−n 1
≈ ln
26300,000 2
or
n 1
≈ − ln = ln(2)
26300,000 2
or
n ≥ ln(2) · 26300,000
Recall that n is the number of trials we need so that the probability that one of the
monkeys will type Macbeth is at least 12 . Since there are approximately 8.5 × 1011 trials
per year, our estimate is that the number of years until it becomes likely that one of the
monkeys will type Macbeth is
n ln(2) · 26300,000
=
8.5 × 1011 8.5 × 1011
years.