# Solutions to Practice Midterm Exam

#### 11 March 2008

```  Q1: 10 points
Q2: 10 points
Q3: 10 points
Q4: 10 points
Q5: 30 points
Q6: 30 points
Total: 100 points
```

Question text is in black, solutions in blue.

• Question 1 (10): True or false with justification: A professor is making up a test with four true/false questions, and chooses the answer "true" or "false" with equal probability, independently for each question. Then the probability that he makes exactly two true and two false is less than 1/3.

FALSE. There are 24 = 16 possible sequences of four true/false choices, each equally likely. There are (4 choose 2) = 6 of these that have two true and two false. So the correct probability is 6/16 = 3/8, which is greater than 1/3.

• Question 2 (10): True or false with justification: If I choose 2n elements independently, with repetition, from a set of n elements, then the probability that I choose each element at least once approaches 1 as n approaches infinity.

FALSE. From our analysis of the Coupon Collector's Problem (Monday's lecture) we know that the expected time to get all n elements is about n ln n. If we were very likely to succeed within 2n choices, the expected time would have to be below 2n. (Note that the last element itself takes expected time n after the first n-1 have been found.)

• Question 3 (10): True or false with justification: If I choose n elements independently, with repetition, from a set of n elements, then the probability that I choose each element once approaches 0 as n approaches infinity.

TRUE. This probability is n!/nn, which by Stirling's Approximation is about e-n. The probability that the n'th choice is new given that the first n-1 are all different is 1/n, which goes to zero, and the total probability is less than that.

• Question 4 (10): True or false with justification: The number of length-5 strings over the alphabet {a,b,c}, where the letters come in alphabetical order, is greater than 30.

FALSE. This is an instance of the Fourth Counting Problem, with n = 3 and k = 5, so the solution is (n-1+k choose k), in this case (7 choose 5) = 21 which is less than 30.

• Question 5 (30): In college basketball, there are two different ways a player can be awarded two free throws. In a one-and-one, the player attempts her first throw and is allowed a second throw only if the first throw succeeds. In a two-shot foul, the player is allowed the second throw whether the first is successful of not. Assume that Julia's free throws are independent events, each with a 3/5 (or 0.6) probability of success.

• (a,5) If Julia shoots a one-and-one, what is the probability that she gets two points? That she gets one point? That she gets no points? (Each successful free throw counts for one point.)

There are three possible events: miss the first (0.4), make the first and miss the second (0.6*0.4 = 0.24) and make both (0.6*0.6 = 0.36). So her chance of no points is 0.4, of one is 0.24, and of two is 0.36.

• (b,5) What is her expected number of points in a one-and-one?

We sum i times the probability of i, for 0*(0.4) + 1*(0.24) + 2*(0.36) or 0.96 points.

• (c,5) What is the variance of the number of points she gets in a one-and-one? (You may find the formula Var(X) = E(X2) - E(X)2 to be useful.)

Applying the formula, we get E(X2) = 0*(0.4) + 1*(0.24) + 4*(0.36) = 1.68 points, so the variance is 1.68 - (0.96)2 = 0.7584.

• (d,5) What are the probabilities of 0, 1, or two points respectively if Julia shoots a two-shot foul?

There are now four possibilities: miss-miss (0 points, 0.16 probability), miss-make and make-miss (1 point probability 0.24 each or 0.48 total) and make-make (2 points, probability 0.36).

• (e,5) What is her expected number of points for a two-shot foul?

These are Bernoulli trials with n = 2 and p = 0.6, so the expected value is np = 1.2 points.

• (f,5) What is the variance of the number of points she gets in a two-shot foul? (Hint: This question is substantially easier than part (c) if you see how to do it.)

By the rule for Bernoulli trials, the variance is np(1-p) = 0.48 -- we could compute E(X2) directly as 0*0.16 + 1*0.48 + 4*0.36 = 1.92 and then get the variance as 1.92 - (1.2)2 = 0.48 as well.

• Question 6 (30): Angelina, Brad, and Celine are playing a poker-like card game where each gets one card and the player whose card has the highest rank wins. (It's possible for two or three players to tie if they have cards of the same rank.)

• (a,5) How many possibilities are there for the distribution of one card to the each players? (Here we consider cards of different suits as being different possibilities.)

Second Counting Problem (no replacement, order of cards matters): 523 = 52*51*50 = 132600.

• (b,5) What is the probability that each player gets a card of a different rank?

To cound the three-different-rank hands, choose three different ranks in 13*12*11 ways, then multiply by 4*4*4 to choose the three suits, total 52*48*44 = 109824, probability = 109824/132600 = about 82.8%.

• (c,5) What is the probability that Angelina wins and the three cards have different ranks?

By symmetry, Angelina wins exactly one-third of the hands in (b), since each such hand must have a winner. So we get (109824/3)/132600 = 36608/132600 = about 27.6%.

• (d,10) What is the overall probability that Angelina wins the game? (This is the answer to (c) plus the probability that Brad and Celine have cards of the same rank and Angelina's card has a higher rank.)

There are (13 choose 2) = 78 ways to pick a set of two ranks. For each such pair of ranks, we can count the hands where Angelina has the higher rank and Brad and Celine each have the lower -- there are 4 times 42 = 4*12 = 48. So there are 78*48 = 3744 hands where Angelina wins and the ranks are not all different. Angelina's total winning hands are 36608 + 3744 = 40352, so her total winning probability is 40352/132600 = about 30.4%.

• (e,5) I forget to mention that when the players bet, each can see the other players' cards but not their own. How can Brad compute the probability that he wins the game, based on seeing Angelina's and Celine's cards but not his own?

Brad knows that he has one of the 50 cards that he doesn't see, and that he is equally likely to have any of these cards. He can see how many cards are higher than both of the two cards he sees: 0 if he sees a card of the highest rank, 4 if he sees one of the next highest rank, 8 for the third highest rank, and so on down to 48 if both the cards he sees are of the lowest rank. So his winning probability is either 0/50, 4/50, 8/50,..., or 48/50.