JANUARY TERM 2012 FUN and GAMES WITH DISCRETE MATHEMATICS Module #9 (Geometric Series and Probability) Author: Daniel Cooney Reviewer: Rachel Zax Last modified: January 4, 2012 Reading from Meyer, Mathematics for Computer Science : Chapter 15.1 for a good overview of infinite geometric series. Chapter 18.2.2 for an example of the use of geometric series for probability. Warmups (try to do these before class). Consider the geometric series a + ar + ar 2 + ar 3 +. SLet the initial value a = 2 and the common ratio r = 1. Calculate the partial sum of this 2 series for the first 5 and 10 terms, and then calculate the sum of the infinite series. Suppose you are playing a coin-tossing game in which you continue to flip a coin until it first turns up heads. Consider the potential third flip in this game. Given that the game reaches a third flip, what is a probability that it turns up heads on the third flip? Overall, what is the probability that there is a third flip and that flip turns up heads? 1
Notes 1. Geometric Series Geometric Sequence: a sequence in which, after the first term, a given term is equal to the product of the previous term and some common ratio, r. For example, we could have a, ar, ar 2, ar 3,, ar n 1, or, more concretely we could have 3, 6, 12, 24, 48,, (3)2 n 1,. Geometric Series: the sum of the terms of a geometric sequence. For instance, we could have 3+6+12+24+ +(3)2 n+1 +, or expressed in summation notation, the same geometric series is n (3)2 i 1 i=1, where n can be either finite or infinite. The partial sum, S n, of a geometric series is the sum of the series for the first n terms. The general formula for a partial sum is S n = a(1 rn ) 1 r The infinite sum of the geometric series is S = lim n S n, which, noting that we must have r < 1 for this limit to converge, is 2. Geometric Distribution S = a 1 r Bernoulli Trial: A trial in which the result is one of two possible events, A or B, which occur with probabilities P (A) = p and P (B) = q = 1 p. Set of Bernoulli Trials: A sequence of n repeated, independent such trials. An example is the repeated tossing of a coin. Geometric Distribution: In a set of Bernoulli trials, the probability that, in the kth trial, the event A will occur for the first time is P (B) k 1 P (A) = (1 p) k 1 p, which is a consequence of the independence of the trials. Intuition: This distribution makes sense because the probability of, for instance, getting heads for the first time on the kth flip would require the probability that the 1st flip is tails, and the probability that the second flip is tails, and on and on through the (k 1)st flip. 2
We can use a geometric series to solve for the probability of this occuring on some kth trial, as this probability is p(1 p) k 1 k=1 where p is the geometric sequence s initial value, and 1 p is the common ratio. 3
Sample problems 1. This problem is adapted from a problem in William Feller s AnIntroductionto Probability Theory and its Applications. You toss a coin until you get either two heads or two tails in a row, the events HH or T T. (a) What is the probability that you finish in fewer than 10 tosses? (b) What is the probability that it takes an odd number of tosses? 2. The geometric distribution is a special case of the Negative Binomial distribution. Derive the formula for the geometric distribution directly from the binomial theorem. Hint: You need to use the identity ( ) ( ) a b = ( 1) b a+b 1 b. 4
Small group exercises Note: These problems are slightly adapted from problems that can be found on the Duke Mathematics Department website at http://www.math.duke.edu/ jayceeli/41l/lectures/2-3.pdf. 1. Suppose you are playing a game with a single opponent, in which the two of you take turns rolling a die until one of you rolls a 1 or a 2. You are the first player to roll. (a) What is the probability of winning on your first turn? (b) What is the probability of reaching and winning on the second turn? (c) What is the probability of reaching and winning on your nth turn? (d) What is the probability that you win the game? 5
2. Suppose now that you are playing this game by yourself, and you stop when you roll either a 1 or 2, which occurs on, say, the nth roll. Then you receive the payoff of $2 n when your first successful roll of 1 or 2 occurs on the nth roll. (a) Calculate the probability of winning on the 1st roll, as well as the probability of winning on each of the 2nd through 4th rolls. (b) Calculate the probability of winning any payoff in the game in an unlimited number of rolls. (c) Calculate the expected payoff when you are limited to at most 5 rolls. (d) Run 10 trials of the game in part c and calculate the average payoff achieved. 6
Homework problems. 1. This problem was adapted from a similar problem written by Frank Wattenberg of Montana State University and can be accessed at http://www.math.montana.edu/frankw/ccp/calculus/series/geometric/sports.htm Suppose that you are playing in a tennis match and that, on each stroke, you have probability p = 1 of losing, and your opponent has probability 4 q = 1 chance of losing. This implies that the chance of you hitting a ball 3 in play and receiving a return is r = 1. Assume that you serve, and thus 2 take each of the odd-numbered strokes. (a) What is the probability that you win the point before you have taken three strokes? (b) What is the probability that you win the point? (c) Assume you could play more aggresively, now having the chance p new = 1 of losing on each stroke, but giving your opponent the chance 3 q new = 2. This means that you have a new value of r.. Now what is the 5 probability of winning the point? Should you switch to this strategy? 2. The Borel-Cantelli Lemma states that, for a sequence of events A n, if P (A i ) < i=1 then the event almost surely occurs finitely often. Suppose that the sequence of events A n represents the likelihood of achieving heads on a coin toss in which the coin s fairness changes over time. This means, in this specific case, that P (A i ) = 1 2 i where i stands for the fact that this is the ith tossing of the coin. (a) Show, by means of a geometric series, that heads will almost surely be achieved only finitely often. (b) Show that tails will be almost surely be achieved infinitely often, using a geometric series. 7