10
and P(A brown-eyed, and a blue-eyed parent have a blue-eyed child) = 1 2 γ γ + α . Problem 25. (Communication through a noisy channel) A transmitter wishes to send one of two alternative messages, “a” or “b”. Because of the way these messages originate, it is known that “b” messages are twice as likely as “a” messages. These mes- sages are encoded into binary messages (codewords), in order to be transmitted over a digital channel. Assume that the two codewords are 0110 and 1000, respectively. However, the channel is noisy and each bit transmitted may be received incorrectly, according to the probabilities shown below. For example, if a zero is sent, there is prob- ability 0.2 that a 1 is received. Assume that errors during the transmission of different bits are statistically independent. Given that the receiver received the sequence 0001, find the probability that message “a” was transmitted. Problem 26. We are given three coins. The first coin is a fair coin painted blue on the head side and white on the tail side. The other two coins are biased so that the probability of a head is p. They are painted blue on the tail side and red on the head side. Two of the three coins are to be selected at random and tossed. Describe the outcomes in the sample space. It was experimentally determined that the probability that the sides that land face up are of the same color is 29/96. What are the possible values of p? Solution. There are two stages to the experiment: the selection of the two coins and the flipping of the coins. There are three different ways that two coins can be selected: the 1st and 2nd, the 1st and 3rd, and the 2nd and 3rd. Each of these pairs are equally likely to be selected. For each pair, the flips have four possible outcomes: (heads, heads), (heads, tails), (tails, heads), (tails, tails). The sample space can be described as follows: The probability that the sides that land face up are the same is then: P(same) = P ( (blue,blue) ) + P ( (red,red) ) = 1 3 1 2 (1 p)+ 1 2 (1 p)+ p 2 + (1 p) 2 = 1 3 (2p 2 3p + 2). Setting this equal to 29 96 and solving the quadratic equation for p yields p =5/8 or p =7/8. Problem 27. A certain test for a disease is only 60% accurate. In order to arrive at a somewhat trustworthy result, a blood sample is repeatedly tested until there are 4 test outcomes that indicate the same result. Given that a particular blood sample came from a patient carrying the disease, find the probability that in exactly i tests, for i =4, 5, 6, 7, the patient’s blood will be found to have the disease. 14

ams507_homework3

Embed Size (px)

Citation preview

Page 1: ams507_homework3

and

P(A brown-eyed, and a blue-eyed parent have a blue-eyed child) =1

2

γ + α

).

Problem 25. (Communication through a noisy channel) A transmitter wishesto send one of two alternative messages, “a” or “b”. Because of the way these messagesoriginate, it is known that “b” messages are twice as likely as “a” messages. These mes-sages are encoded into binary messages (codewords), in order to be transmitted overa digital channel. Assume that the two codewords are 0110 and 1000, respectively.However, the channel is noisy and each bit transmitted may be received incorrectly,according to the probabilities shown below. For example, if a zero is sent, there is prob-ability 0.2 that a 1 is received. Assume that errors during the transmission of differentbits are statistically independent. Given that the receiver received the sequence 0001,find the probability that message “a” was transmitted.

Problem 26. We are given three coins. The first coin is a fair coin painted blueon the head side and white on the tail side. The other two coins are biased so that theprobability of a head is p. They are painted blue on the tail side and red on the headside. Two of the three coins are to be selected at random and tossed. Describe theoutcomes in the sample space. It was experimentally determined that the probabilitythat the sides that land face up are of the same color is 29/96. What are the possiblevalues of p?

Solution. There are two stages to the experiment: the selection of the two coins andthe flipping of the coins. There are three different ways that two coins can be selected:the 1st and 2nd, the 1st and 3rd, and the 2nd and 3rd. Each of these pairs are equallylikely to be selected. For each pair, the flips have four possible outcomes: (heads,heads), (heads, tails), (tails, heads), (tails, tails). The sample space can be describedas follows:

The probability that the sides that land face up are the same is then:

P(same) = P((blue,blue)

)+ P

((red,red)

)=

1

3

{1

2(1 − p) +

1

2(1 − p) + p2 + (1 − p)2

}=

1

3(2p2 − 3p+ 2).

Setting this equal to 2996

and solving the quadratic equation for p yields p = 5/8 orp = 7/8.

Problem 27. A certain test for a disease is only 60% accurate. In order to arriveat a somewhat trustworthy result, a blood sample is repeatedly tested until there are4 test outcomes that indicate the same result. Given that a particular blood samplecame from a patient carrying the disease, find the probability that in exactly i tests,for i = 4, 5, 6, 7, the patient’s blood will be found to have the disease.

14

shuwang
Homework 3.2
Page 2: ams507_homework3

1/3

1/3

1 & 2

1/3

1 & 3

heads, tails

tails, heads(1/2)p

(1/2)(1-p)

white, red(1/2)(1-p)

(1/2)p

tails, tails

heads, heads

2 & 3

heads, tails

tails, heads

heads, heads

tails, tails

p(1-p)

(1-p)p

(1-p)(1-p)

pp

blue, red

blue, blue

red, blue

red, red

heads, tails

tails, heads(1/2)p

(1/2)(1-p)

white, red(1/2)(1-p)

(1/2)p heads, heads

tails, tails white, blue

blue, blue

blue, redwhite, blue

blue, blue

blue, red

*

*

*

*

Figure 0.7:

15

Page 3: ams507_homework3

Solution.We use the binomial probabilities:

P(correct diagnosis in 4 tests) =

(4

4

)· (0.6)4 = 0.1296,

P(correct diagnosis in 5 tests) =

(5

4

)· (0.6)4 · (0.4)1 = 0.2592,

P(correct diagnosis in 6 tests) =

(6

4

)· (0.6)4 · (0.4)2 = 0.31104,

P(correct diagnosis in 7 tests) =

(7

4

)· (0.6)4 · (0.4)3 = 0.29.

Problem 28. A new robot is equipped with the brains to solve any kind of problemset! Due to bugs in the design, however, and independent of the difficulty of problems,this robot gets problems right with probability 0.65, independently for each problem.This robot is very expensive, and you have to decide whether to keep it or not. Youdecide that if at any point the number of wrong problems exceeds the number ofcorrect problems by more than 15, you will return the robot. If, however, at any pointthe number of correct problems exceeds the number of incorrect problems by 15, thenyou will keep the robot. What are the chances that you will return the robot? Hint :Use the solution to the gambler’s ruin problem.

Solution. We can reduce this problem to the gambler’s ruin problem with N = 30, k =15, and p = 0.65. The event equivalent to returning the robot is that of G1 winning.The probability of this event is

P15 =1 − (0.35/0.65)15

1 − (0.35/0.65)30≈ 9.3 × 10−5.

Problem 29. A particular jury consists of 7 jurors. Each juror has a 0.2 chance ofmaking the wrong decision, independently of the others. If the jury reaches a decisionby majority rule, what is the probability that it will reach a wrong decision?

Solution.The number of jurors that make the “wrong” decision can be modeled as abinomial random variable with parameters n = 7 and p = .2. The jury as a wholewill make the wrong decision if 4, 5, 6, or 7 jurors make the wrong decision. Denotethese events by A, B, C, D, respectively. Since these events are mutually exclusive,the probability of their union is the sum of their probabilities, so

P(Jury Error) = P(A) + P(B) + P(C) + P(D)

=

(7

4

)(0.2)4 · (0.8)3 +

(7

5

)(0.2)5 · (0.8)2

+

(7

6

)(0.2)6 · (0.8)1 +

(7

7

)(0.2)7 · (0.8)0

= 0.033.

16

shuwang
Homework 3.3
Page 4: ams507_homework3

Problem 30. Galton’s quincunx: Consider a mechanical device in which balls aredropped through a triangular array of nails, starting at the top. The nails are placedin rows, with each nail having two nails symmetrically placed in the row underneathit. There is a total of n rows. Every time a ball hits a nail it has a probability 0.5 tofall to the left of the nail and a probability of 0.5 to fall to the right of the nail. Theball comes to rest at the nth row. What is the probability that the ball rests to theleft of the kth nail of the nth row?

Problem 31. Calculating the odds. Let A be an event such that 0 < P(A) < 1.The odds in favor of A are defined to be

O(A) =P(A)

P(Ac),

while the odds against A are defined to be the reciprocal of O(A). [To connect the term“odds” with its common usage, note for example that if the probability that a givenhorse wins a race at the track is 1/3, the odds against the horse winning are 2 to 1. A“fair” racetrack would then pay $2 for every $1 bet on the horse (plus the original $1bet), if the horse wins; “fair” here means that the racetrack would break even on theaverage – this will become more precise in Chapter 2, when we will discuss the notion ofexpected value.] This problem deals with a formula for calculating “conditional odds,”that is, odds based on some partial information. If A and B are events with P(A) > 0and P(B) > 0, the odds in favor of A given B are defined as

O(A |B) =P(A |B)

P(Ac |B).

Show thatO(A |B) = L(B |A)O(A),

where L(B |A) is the so called likelihood ratio of B given A, defined as

L(B |A) =P(B |A)

P(B |Ac).

Solution.By definition, O(A |B) is equal to

P(A |B)

P(Ac |B)=

P(A ∩B)/P(B)

P(Ac ∩B)/P(B)=

P(A ∩B)

P(Ac ∩B)=

P(B |A)P(A)

P(B |Ac)P(Ac)= L(B |A)O(A).

Problem 32. Hypothesis testing. May B. Lucky is a compulsive gambler whois convinced that on any given day she is either “lucky,” in which case she wins eachred/black bet she makes in the roulette with probability pL > 1/2, or she is “unlucky,”in which case she wins each red/black bet she makes in the roulette with probabilitypU < 1/2. May visits the casino every day, and believes that she knows the a prioriprobability that any one given visit is a “lucky” one (i.e., corresponds to pL ratherthan pU ). To improve her chances, May adopts a system whereby she estimates on-linewhether she is lucky or unlucky on a given day, by keeping a running count of thenumbers of bets that she wins and loses. In particular, she continues to play until the

17

Page 5: ams507_homework3

conditional odds in favor of the event {lucky on the current day}, given the numberof wins and losses so far, fall below a certain threshold (see the preceding problem).As soon as this happens, she stops playing. Provide a simple algorithm for updatingMay’s conditional odds with each play. Note: This example is typical of reasoning insequential hypothesis testing systems, where the probability of correctness of a certainhypothesis, given some evidence, is calculated and sequentially updated.

Solution.Let A be the event that May is lucky on the current day, and let Bm,n be theevent that m wins and n losses have occurred so far. We assume independence of theresults of different spins/plays. Then we have, using the odds formula of the precedingproblem and the binomial formula,

O(A |Bm,n)

O(A)= L(Bm,n |A) =

P(Bm,n |A)

P(Bm,n |Ac)=

(m+n

m

)pm

L (1 − pL)n(m+n

m

)pm

U (1 − pU )n=

(pL

pU

)m(1 − pL

1 − pU

)n

From this formula, a convenient recursive algorithm is obtained. After m+ n plays, inwhich m wins and n losses occurred, we have

O(A |Bm+1,n) = O(A |Bm,n)pL

pU, if she wins in the next play,

O(A |Bm,n+1) = O(A |Bm,n)1 − pL

1 − pU, if she loses in the next play.

The initial condition is O(A |B0,0) is equal to the initial (unconditional) odds O(A)(which May knows by assumption).

Problem 33. * Let A and B be events such that A ⊂ B. Can A and B beindependent?

Solution.The events A and B are independent if and only if P(A)P(B) = P(A ∩B) =P(A), where the last equality follows from the fact that A ⊂ B. This can be the caseif and only if P(A) = 0 or P(B) = 1.

Problem 34. * Alice starts by flipping a coin until she obtains tails for the first time.After that, Bob starts flipping until he obtains tails for the first time, and they keepalternating similarly. Assume that coin flips are independent and that the probabilityof heads at each flip is p. The game ends when either Alice has accumulated m heads,in which case she wins, or when Bob has accumulated n heads, in which case he wins,whichever comes first. Show that the probability qm,n that Alice wins satisfies

qm,n = pqm−1,n + (1 − p)(1 − qn,m).

Solution.

SECTION 1.6. Counting

Problem 35. A parking lot contains 100 cars that all look quite nice from theoutside. However, K of these cars happen to be lemons. The number K is known tolie in the range {0, 1, . . . , 9}, with all values equally likely.

18

shuwang
Homework 3.4
Page 6: ams507_homework3

(a) We testdrive 20 distinct cars chosen at random, and to our pleasant surprise, noneof them turns out to be a lemon. Given this knowledge, what is the probabilitythat K = 0?

(b) Repeat part (a) when the 20 cars are chosen with replacement; that is, at eachtestdrive, each car is equally likely to be selected, including those that wereselected earlier.

Solution.(a) Let A be the event that all 20 cars tested are good. We are asked to findP(K = 0 |A). Using Bayes’ rule, we have

P(K = 0 |A) =P(K = 0)P(A |K = 0)∑9

i=0P(K = i)P(A |K = i)

.

It is given that P(K = i) = 1/10 for all i. To compute P(A |K = i), we conditionon the event of exactly i lemons, and reason as follows. The first selected car hasprobability (100− i)/100 of being good. Having succeeded in the first selection, we areleft with 99 cars out of which i are lemons; thus, the second selected car has probability(99 − i)/99 of being good. Continuing similarly, and using the multiplication rule, weobtain

P(A |K = i) =(100 − i)(99 − i) · · · (81 − i)

100 · 99 · 81 ,

from which we can then obtain P(K = 0 |A).

(b) We use the exact same argument as in part (a), except that we need to recalculateP(A |K = i). Since the cars are chosen with replacement, we are dealing with 20independent Bernoulli trials. The probability of finding a good car in any one trial is(100 − i)/100. The probability of finding good cars in all 20 trials is

P(A | k = i) =(

100 − i100

)20

,

from which we can then obtain P(K = 0 |A).

Problem 36. A certain department offers 8 lower level courses: {L1, L2, . . . , L8}and 10 higher level courses: {H1, H2, . . . , H10}. A valid curriculum consists of 4 lowerlevel courses, and 3 higher level courses.

(a) How many different curricula are possible?

(b) Suppose that {H1, . . . , H5} have L1 as a prerequisite and {H6, . . . H10} have L2

and L3 as prerequisites, i.e., any curricula which involve, say, one of {H1, . . . , H5}must also include L1. How many different curricula are there?

Solution.(a) There are(84

)ways to pick 4 lower level classes, and

(103

)ways to choose

3 higher level classes, so there are (8

4

)(10

3

)

valid curricula.

(b) This part is more involved. We need to consider several different cases

19

Page 7: ams507_homework3

(i) Suppose we do not choose L1. Then both L2 and L3 must be chosen; otherwiseno higher level courses would be allowed. Thus, we need to choose 2 more lowerlevel classes out of the remaining 5, and 3 higher level classes from the available5. We then obtain

(52

)(53

)valid curricula.

(ii) If we choose L1 but choose neither L2 nor L3, we have(53

)(53

)choices.

(iii) If we choose L1 and choose one of L2 or L3, we have 2 ·(52

)(53

)choices. This is

because there are two ways of choosing between L2 and L3,(52

)ways of choosing

2 lower level classes from L3, . . . , L8, and(53

)ways of choosing 3 higher level

classes from H1, . . . , H5.

(iv) Finally, if we choose L1, L2, and L3, we have(51

)(103

)choices.

Note that we are not double counting, because there is no overlap in the cases we areconsidering, and furthermore we have considered every possible choice. The total isobtained by adding the counts for the above four cases.

Problem 37. How many 6-word sentences can be made using each of the 26 lettersof the alphabet exactly once? A word is defined as a nonempty (possibly jibberish)sequence of letters.

Solution.Think of a 6-word sequence using the 26 letters as a sequence of length 31:there are 26 letters, plus five blanks to separate one word from the next. Note thatthe blanks cannot be at the beginning or the end of the sequence, which only leaves 29available positions. Thus, there are

(295

)possible choices for the locations of the blanks.

Then, the 26 letters can be placed in arbitrary order (permutation) in the remaining26 locations (26! choices). Thus, the number of possible sentences is 26!

(295

).

Problem 38. A candy factory has an endless supply of red, orange, yellow, green,blue, and violet jelly beans. The factory packages the jelly beans into jars of 100 jellybeans each. One possible color distribution, for example, is a jar of 56 red, 22 yellow,and 20 green jelly beans. As a marketing gimmick, the factory guarantees that no twojars have the same color distribution. What is the maximum number of jars the factorycan produce?

Solution.Think of lining up the jelly beans, by first placing the red ones, then the orangeones, etc. We also place 5 dividers to indicate where one color ends and another starts.(Note that two dividers can be adjacent if there are no jelly beans of some color.) Byconsidering both jelly beans and dividers, we see that there is a total of 105 positions.Choosing the number of jelly beans of each color is the same as choosing the positionsof the dividers. Thus, there are

(1055

)possibilities, and this is the number of possible

jars.

Problem 39. We have m married couples (2m individuals). After a number ofyears, each person has died, independently, with probability p. Let N be the numberof surviving individuals. Let C be the number of couples in which both individuals arealive. Find the conditional probability P(C = c |N = n).

Solution.Use Bayes rule. Find P(N = n |C = c) first. The c couples give 2c aliveindividuals. Then find the number of ways that we can have n − 2c alive ones in theremaining couples without having any alive couples.NEEDS TO BE WORKED OUT- TRICKY

20

Page 8: ams507_homework3

Problem 40. Consider three independent rolls of a fair six-sided die.

(a) What is the probability that the sum of the three rolls is 11?

(b) What is the probability that the sum of the three rolls is 12?

(c) In the seventeenth century, Galileo explained the experimental observation thata sum of 10 is more frequent than a sum of 9, even though both 10 and 9 can beobtained in six distinct ways. Can you retrace Galileo’s thinking?

Solution. (a) The number of outcomes that leads to a sum of 11 is the number ofoutcomes of the first two rolls that lead to a sum greater than or equal to 11 − 6 = 5and less than or equal to 11 − 1 = 10. The number of outcomes of the first two rollsthat leads to sum less than 5 or greater than 10 is 9. So the desired probability is

62 − 9

63.

(b) The number of outcomes that leads to a sum of 12 is the number of outcomes ofthe first two rolls that lead to a sum greater or equal to 12 − 6 = 6 and less than orequal to 12 − 1 = 11. The number of outcomes of the first two rolls that leads to sumless than 6 or greater than 11 is 11. So the desired probability is

62 − 11

63.

(c) Each of the sums 9 and 10 can be obtained in six distinct ways:

9 = 1 + 2 + 6 = 1 + 3 + 5 = 1 + 4 + 4 = 2 + 2 + 5 = 2 + 3 + 4 = 3 + 3 + 3,

10 = 1 + 3 + 6 = 1 + 4 + 5 = 2 + 2 + 6 = 2 + 3 + 5 = 2 + 4 + 4 = 3 + 3 + 4.

However, the number of outcomes that sum to 9 is 25, while the number of outcomesthat sum to 10 is 27. Thus, a sum of 10 has probability 27/63 and is more frequentthan a sum of 9, which has probability 25/63.

Problem 41. The weather on any given day can be sunny, cloudy, rainy, or snowy.Assume that a snowy day can happen only during the winter, that a rainy day cannothappen in the summer, and that each season has 90 days. What is the number of allpossible distinct 360-day weather sequences?

Solution. The number of possible sequences is (4 − 1)90490(4 − 1)90(4 − 2)90.

Problem 42. Consider a backgammon match with 25 games, each of which can haveone of two outcomes: win (1 point), or loss (0 points). Find the number of all possibledistinct score sequences under the following alternative assumptions.

(a) All 25 games are played.

(b) The match is stopped when one player reaches 13 points.

Solution. (a) 225.

(b) First note that under this rule, each match will be stopped after a number of gamesranging from 13 to 25. If a match will be stopped at the k’th game with player 1 having

21

shuwang
Homework 3.5
Page 9: ams507_homework3

13 points, then the last game was a win and k − 13 of the previous games was a loss.So, there are

(k−1k−13

)matches that ends at the k’th game with player 1 having a score

of 13. Taking player 2 into consideration and summing over k, we obtain

2

25∑k=13

(k − 1

k − 13

)

possible distinct score sequences.

Problem 43. Alice and Bob each have a deck of playing cards. Each turns over arandomly selected card. Determine the following:

(a) The probability that the two cards are of the same suit.

(b) The probability that at least one card is a spade.

(c) The probability that neither card is a diamond.

(d) The probability that both cards are hearts or spades.

Solution. (a)

P(the two cards are of the same suit) = 4(1352

)2= 4(14

)2.

(b)

P(at least one card is a spade) = 1 − P(neither card is a spade)

= 1−(3 · 13

52

)2= 1−

(34

)2(c)

P(neither card is a diamond) =(3 · 13

52

)2=(34

)2.

(d)

P(both cards are hearts or spades) =(2 · 14

52

)2=(12

)2.

Problem 44. A parking lot contains 100 cars, k of which happen to be lemons. Nof these cars are randomly selected and taken for a testdrive. Find the probability thatn of these cars turn out to be lemons.

Solution.Clearly if n > N or if n > k the probability must be zero. If n ≤ N and n ≤ k,then we can find the probability that the testdrive found n of the 100 cars defective bycounting the total number of size N subsets, and then the number of size N subsetsthat contain n lemons. Clearly, there are

(100N

)different subsets of size N . To count the

number of size N subsets with n lemons, we first choose the lemons from the k totallemons, and then choose the N − n good cars from the remaining 100 − k cars. Thusthe number of ways to choose a subset of size N from 100 cars, and get n lemons, is(

k

n

)·(

100 − kN − n

)

22

shuwang
Homework 3.6
shuwang
Homework 3.7
Page 10: ams507_homework3

and thus the desired probability is (kn

)·(100−kN−n

)(100N

)Problem 45. Ninety students, including Joe and Jane, are to be split into threeclasses of equal size, and this is to be done at random. What is the probability thatJoe and Jane end up in the same class?

Solution. Suppose we label the classes A, B, and C. The probability that Joe andJane will both be in class A is the number of possible combinations for class A thatinvolve both Joe and Jane, divided by the total number of combinations for class A.Therefore the desired probability is (

8828

)(9030

) .Since there are three classrooms, the probability that Joe and Jane end up in the sameclassroom is simply three times the answer we found above:

3 ·(8828

)(9030

) .Problem 46. Find the probability of winning in the following lottery. You choose5 distinct integers in the range from 1 to 100. Then, the lottery operator choosesrandomly 10 distinct integers in the same range (all outcomes being equally likely).You win if all of your 5 numbers are among those chosen by the operator.

Problem 47. A bank has a vault with a combination lock. The lock has a combina-tion that consists of 10 integers in increasing order ranging from 1 to 90, but will openif any 8 of the numbers are entered. Find the probability that a burglar will open thevault on the first try.

Solution.To find the probability, we will find the number of favorable outcomes, anddivide by the total number of possible outcomes. There are

(108

)favorable outcomes,

i.e., successful combinations that will open the lock. There are(908

)total number of

ways to choose 8 numbers out of 90, and therefore the probability that the burglar willopen the vault on his first try is (

108

)(908

) .Problem 48. A standard 52-card deck is distributed between 4 players (as in bridge).Find the probability that:

(a) Player 1 gets all 13 spades.

(b) Some player gets all 13 spades.

Solution.(a) P(A) = 1

(5213)= 1.57 × 10−12.

(b) P(B) = 4P(A) = 4

(5213).

23

shuwang
Homework 3.8
shuwang
Homework 3.9