Download Larget — Statistics/Mathematics 309 Exam 1B Solution October 3

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

History of statistics wikipedia , lookup

Probability wikipedia , lookup

Probability interpretations wikipedia , lookup

Transcript
Larget — Statistics/Mathematics 309
Exam 1B Solution
October 3, 2008
A bag contains two coins that are indistinguishable by touch. When a coin is drawn from the bag, each is
selected with equal probability. One coin is a fair coin that is equally likely to be heads or tails. The second coin
is biased and has a ten percent chance of heads and a ninety percent chance of tails. For either coin, coin tosses
are mutually independent. A person draws one of the two coins from the bag at random and tosses it seven times,
recording the sequence of heads and tails.
You may use the fact that when the biased coin is tossed seven times, the probability that no two consecutive
coin tosses are heads is 9440550/107 = 0.944055.
Solution: The sample space here contains a two-stage outcome: the first stage is a draw of either the fair or biased
coin, and the second stage is a sequence of seven coin tosses.
S = {(fair, HHHHHHH), . . . , (fair, T T T T T T T ), (biased, HHHHHHH), . . . , (biased, T T T T T T T )}
There are |S| = 28 outcomes in the sample space, but the outcomes are not equally likely. The probability of a single
outcome with the fair coin and k heads and 7 − k tails in a specific order is 1/2 × (1/2)7 , whereas the probability of a
single outcome with the biased coin and k heads and 7 − k tails in a specific order is 1/2 × (0.1)k (0.9)7−k .
1. If the fair coin is selected, what is the conditional probability of tossing exactly two heads?
Solution: There are 72 = 21 sequences with exactly two heads, so
7
1
21 .
P (exactly two heads | fair coin) = 21 ×
=
= 0.1641.
2
128
In this two-stage sample space, this conditional probability of an outcome in the second stage is defined directly.
Note that there is nothing incorrect about applying the definition of conditional probability to say
P (exactly two heads | fair coin) =
P (exactly two heads ∩ fair coin)
P (fair coin)
but that to complete the calculation correctly here requires applying the multiplication rule
P (exactly two heads ∩ fair coin) = P (fair coin) × P (exactly two heads | fair coin)
so that
(1/2) × 21 × ( 12 )7
P (exactly two heads ∩ fair coin)
=
P (fair coin)
1/2
and there is no particular good reason to have applied the definition of conditional probability to solve the problem.
2. If the biased coin is selected, what is the conditional probability of tossing two or more heads?
Solution: This probability is best solved by finding the probability of the complement.
P (2 or more heads | biased) = 1 − P (0 or 1 heads | biased)
= 1 − P (0 heads | biased) − P (1 head | biased)
7
7
= 1 − (0.9) −
(0.1)(0.9)6
1
.
= 0.1497
Again, this conditional probability is directly defined.
Larget — Statistics/Mathematics 309
Exam 1B Solution
October 3, 2008
3. If the fair coin is selected, what is the conditional probability that no two consecutive coin tosses are heads?
(In other words, the longest run of consecutive heads is one or fewer.)
Solution: The most efficient way to solve this problem is to use the method described in class by defining An (1)
to be the number of sequences of n coin tosses where the longest consecutive run of heads is 1 or fewer (in other
words, the number of sequences without two consecutive heads) and recognizing that
n
2
if n = 0, 1
An (1) =
An−1 (1) + An−2 (1) if n = 2, 3, . . .
This recursion is then used to find A7 (1).
A0 (1)
1
A1 (1)
2
A2 (1)
3
A3 (1)
5
A4 (1)
8
A5 (1)
13
A6 (1)
21
A7 (1)
34
The problem solution is then
P (no two consecutive heads | fair) =
34
34 .
=
= 0.2656 .
27
128
Since the problem is to find the number of sequences with one or fewer heads in a row at most, there is no need
to subtract from 34 the number of sequences with 0 heads in a row at most.
Note that the problem can also be solved by some tedious direct counting by finding all sequences without two
consecutive heads by partitioning this count by the number of heads in the sequence. There is 1 such sequence
with zero heads, 7 such sequences with one head, 15 such sequences with two heads (at positions 13, 14, 15, 16,
17, 24, 25, 26, 27, 35, 36, 37, 46, 47, 57), 10 such sequences with three heads (at positions 135, 136, 137, 146,
147, 157, 246, 247, 257, 357), and one such sequence with four heads (at positions 1357).
Another clever solution used by one student is to realize that the first k − 1 heads must be followed by a tail, so
it also suffices to choose the relative locations of the k heads and the 7 − k − (k − 1) = 8 − 2k “free” tails when
k ≥ 1 and to compute
1+
4 X
8−k
k=1
k
7
6
5
4
= 1+
+
+
+
1
2
3
4
= 1 + 7 + 15 + 10 + 1
= 34
4. If we observe that no two consecutive coin tosses are heads, what is the conditional probability that the coin
is the biased coin?
Solution: Here we use Bayes’ Theorem as the conditional probability is reverse of that given directly in the problem.
I find it easiest to derive the calculation in steps.
P (biased | no two consecutive heads) =
=
P (biased ∩ no two consecutive heads)
P (no two consecutive heads)
P (biased) P (no two consecutive heads | biased)
P (no two consecutive heads)
To find the numerator, we use the information given in the problem.
P (biased) P (no two consecutive heads | biased) =
1
× 0.944055
2
Larget — Statistics/Mathematics 309
Exam 1B Solution
October 3, 2008
The denominator requires the law of total probability as there are two paths through the probability tree you
could draw that lead to the outcome of no two consecutive heads.
P (no two consecutive heads) =
1
1
34
× 0.944055 + ×
2
2 128
The final probability is then
P (biased | no two consecutive heads) =
(1/2)(0.944055)
.
= 0.7804
(1/2)(0.944055) + (1/2)(34/128)
The interested student may wonder how to compute P (no two consecutive heads | biased). A method very similar
to that for fair coins works, but we define a recursion on probabilities rather than on counts of the number of
sequences (which could have worked for fair coins too). Specifically, if we define bn (1, θ) to be the probability
that the longest run of heads has length 1 or less in n independent coin tosses of a coin with head probability
θ, then b0 (1, θ) = b1 (1, θ) = 1 and bn (1, θ) = (1 − θ)bn−1 (1, θ) + θ(1 − θ)bn−2 (1, θ) for n = 2, 3, . . .. The idea
for n ≥ 2 is to condition on the first few coin tosses. If the first coin toss is a tail (with probability 1 − θ), then
the result is achieved with probability bn−1 (1, θ). On the other hand, if the first coin toss is a head, the next
must be a tail (with probability θ(1 − θ)) and then the following n − 2 coin tosses must achieve the result with
probability bn−2 (1, θ). This approach can be generalized for bn (x, θ) by having longer recursions by conditioning
on the tosses leading to the first tail. Here we find the probabilities for θ = 0.1.
b0 (1, 0.1) = 1
b1 (1, 0.1) = 1
b2 (1, 0.1) = (0.9)(1) + (0.1)(0.9)(1) = 0.99
b3 (1, 0.1) = (0.9)(0.99) + (0.1)(0.9)(1) = 0.981
b4 (1, 0.1) = (0.9)(0.981) + (0.1)(0.9)(0.99) = 0.972
b5 (1, 0.1) = (0.9)(0.972) + (0.1)(0.9)(0.981) = 0.96309
b6 (1, 0.1) = (0.9)(0.96309) + (0.1)(0.9)(0.972) = 0.954261
b7 (1, 0.1) = (0.9)(0.954261) + (0.1)(0.9)(0.96309) = 0.945513
This implies that the information I gave you in the exam was incorrect due to a computation error by me! The
actual answer to the problem ought to have been
P (biased | no two consecutive heads) =
(1/2)(0.9445513)
.
= 0.7807
(1/2)(0.9445513) + (1/2)(34/128)