MATH 3670 - N1, Fall 2017 First midterm September 18th NAME: Instructions Only non-graphing calculator is allowed. Simple fraction expressions need not be converted to decimal expression. Notes, books, laptops, cellphones are not allowed. Show full work in your solutions and circle your final answers. Use only scratch paper for scratch. Collaboration with other students is not allowed. Signing here, I have read and understood these instructions: Points Exercise 1 / 33 Exercise 2 / 33 Exercise 3 / 33 Exercise 4 / 34 Total / 133 1
Exercise 1. A register contains eight random digits which are mutually independent. Each digit is a zero or a one with equal probability. (a) [5 pts] Describe an appropriate probability model pω, F, P q corresponding to looking at the contents of the register. (In this case, this means define the sample space, the set of events, and the probabilities of the outcomes). (b) [17 pts] Express each of the following three events explicity as subsets of Ω, and find their probabilities: E 1 : No two neighboring digits are the same. E 2 : Some cyclic shift of the register contents is equal to 00010000. E 3 : The register contains exactly seven zeros. (c) [11 pts] Find P pe 1 E 3 q, P pe 2 E 3 q. NOTE. A cyclic, or circular, shift is the operation of rearranging the entries of a list, either by moving the final entry to the first position, while shifting all other entries to the next position, or by performing the inverse operation. Solution. (a) Ω tj 1 j 2 j 3 j 4 j 5 j 6 j 7 j 8 j k P t0, 1u, k 1,..., 8.u. In words, Ω is the set of sequences of 0 s and 1 s of length eight. The set of events F is the family of subsets of Ω. By independence, we give each simple event tωu, ω P Ω, the probability P ptωuq 1{2 8. (b) E 1 t10101010, 01010101u, P pe 1 q 2{2 8 1{7 8. E 2 t00100000, 00001000u, P pe 2 q 2{2 8 1{2 7. (c) E 1 and E 3 are clearly disjoint, so P pe 1 E 3 q 0, and E 2 X E 3 E 2, so P pe 2 E 3 q P pe 2 X E 3 q P pe 3 q If you interpreted cyclic shift as a cyclic permutation, then: (b) E 1 t10101010, 01010101u, P pe 1 q 2{2 8 1{2 7. P pe 2 q{p pe 3 q 1 4. E 2 t10000000, 01000000, 00100000, 00010000, 00001000, 00000100, 00000010, 00000001u, P pe 2 q 8{2 8 1{2 5. And E 3 E 2, P pe 2 q P pe 3 q. (c) E 1 and E 3 are clearly disjoint, so P pe 1 E 3 q 0, and E 2 and E 3 are the same event so P pe 2 E 3 q 1. 2
Exercise 2. A particular webserver may be working or not working. If the webserver is not working, any attempt to access it fails. Even if the webserver is working, an attempt to access it can fail due to network congestion beyond the control of the webserver. Suppose that the a priori probability that the server is working is 0.8. Suppose that if the server is working, then each access attempt is successful with probability 0.9, independently of other access attempts. Find the following quantities. (a) [11 pts] P pfirst access attempt failsq. (b) [11 pts] P pserver is working first access attempt failsq. (c) [11 pts] P psecond access attempt fails first access attemps failsq. Solution. (a) F : first access attempt fails, W : server is working. Then (b) P pf X W q ` P pf X W 1 q P pf W qp pw q ` P pf W 1 qp pw 1 q 0.1 0.8 ` 1 0.2 0.28. P pw F q P pw X F q{ (c) G: second access attempt fails. P pg F q P pg X F q P pf W qp pw q 0.1 0.8 0.28 P pg X F W qp pw q ` P pg X F W 1 qp pw 1 q P pg W qp pf W qp pw q ` 1 P pw 1 q 0.12 0.8 ` 0.2 0.28 «0.74. «0.29. P pf W q2 P pw q ` P pw 1 q 3
Exercise 3. A certain code has a probability p of cracking a password in any attempt, independently of other attempts. Let X number of attempts before a password is cracked. (a) [3 pts] Specify the set of possible values of X (that is, values of X that can occur with probability ą 0). (b) [30 pts] Find the pmf of X, cdf of X, and the expected value EpXq. Solution. (a) The possible values of X are X 0, 1, 2,... The value X 0 means password is cracked on first attempt. (b) The pmf is # p1 pq x p if x 0, 1, 2,... p X pxq P px xq 0 otherwise. Then, if x 0, 1, 2,..., so The expectation is x0 F X pxq p X px ď xq F X pxq x0 xÿ j0 p1 pq j 1 p1 pqx`1 p p p # 0 if x ă 0 1 p1 pq k`1 if k ď x ă k ` 1. EpXq p xp1 pq x pp1 pq xp1 pq x 1 pp1 pq pp1 pq d dp p1{pq 1 p p. x0 1 p1 pq x`1, d dp p1 pqx pp1 pq d dp p1 pq x NOTE: This is a very unrealistic model; any password cracking strategy must use the information obtained from failed attempts, so the odds of cracking the password should increase with every attempt, and this turns the attempts into dependent events. x0 4
Exercise 4. [34 pts] In a fictitious country, three prisoners have been incarcerated without trial. Their warder tells them that the country s ruler has decided arbitrarily to free one of them and to shoot the other two, but he (the warden) is not permitted to reveal to any prisoner the fate of that prisoner. Prisoner A knows therefore that his chance of survival is 1{3. In order to gain information, he asks the warden: If B is to be pardoned, tell me that C is going to be executed. If C is to be pardoned, tell me that B is going to be executed. And if I m to be pardoned, flip a coin to decide to tell me whether B or C is going to be executed. The warden complies, and tells the prisoner that B will be executed. What now is prisoner A s assessment that he will survive? Solution. Let the events A, B, C mean that prisoner A, B, C is spared, respectively. Let E the event of the warden telling him that B will be executed. We want to calculate P pa Eq. By Bayes formula, P pa Eq P pe AqP paq P pe AqP paq ` P pe BqP pbq ` P pe CqP pcq p1{2q p1{3q p1{2q p1{3q ` 0 ` 1 p1{3q 1{3. Thus, prisoner A s scheme to gain information is unsuccesful. 5