Вы находитесь на странице: 1из 4

MPOTD 408

Find the expected number of rolls of a fair six-sided die before the sequence of rolls contains 1, 2, 3, 4, 5, 6 (in that order) as a subsequence. 408.1 An explanation of Expectation Expectation is just a fancy way of saying the weighted average of a set of events. In the quatitative sense, this is usually found via E[X] = Pr[x] x

event xX For example, suppose that we want to nd the expected value of any roll of a fair dice. In this case, the capital X, the parameter to the expectation, is the set of events representing dice rolls. There are only 6 possible outcomes/events: X = {rolling a 1, rolling a 2, rolling a 3, rolling a 4, rolling a 5, rolling a 6}
1 Since the probability of rolling any number on a fair dice is always 6 , the expected value of a dice roll (or the weighted average) is

E[X] =

Pr[x] x

event xX = Pr[roll = 1] 1 + Pr[roll = 2] 2 + . . . + Pr[roll = 6] 6 1 2 3 4 5 6 = + + + + + 6 6 6 6 6 6 = 3.5 408.2 Solution Sketch There are a few ways of going about this problem. We could do the algebra as above. We can nd the probability that the rst subsequence occurs after k rolls, which requires quite a bit of counting. However, thats quite a lot of mind numbing math that I would rather not do. (How would you nd all the ways of not rolling 1-2-3-4-5-6 within k rolls?) Instead, we can model the events as a decision, with each branch corresponding to a roll of the dice. Take for example the similar problem of trying to gure out the expected number of rolls it takes to get double sixes. start not 6 6

6-6 everything else Here, we rst use up one roll, check whether its a six or not. If its not a six, were back to where we started. However, if it is a six, then we roll again to see if theres another 1 six. If that second roll is a six, then were done, otherwise, start over again. Theres a 6 1

probability of taking the next branch and a 5 probability at each roll of having to start 6 over again. We can rewrite this expectation as 5 1 E[X] = (E[X|rst roll = 6] + 1) + (E[X] + 1) 6 6 1 5 E[X|rst roll = 6] = (1) + (E[X] + 1) 6 6 The rst line literally reads after we toss our rst roll, we either roll a six and add on the expected number or rolls to reach double sixes given that weve just rolled a 6, or we rolled anything else and need to start over again. The second line reads that if weve already tossed a 6, we either toss another 6 and nish, or we we toss anything else and start over again. We want to solve for E[X], so simply substitute the second line into the rst for E[X|6] and we get the following let x = E[X] 1 5 1+ x x=1+ 6 6 1 5 x=1+ + x+ 6 36 5 5 7 =x 1 6 6 36 1 = x 36 x = 42

5 + x 6 5 x 6

Similarly for the expected rolls to get 1-2-3-4-5-6, we observe that for our rst toss, we either get a one or we need to start over again. From now own, E[X|k] reads the expected number of rolls to get to the sequence 1-2-3-4-5-6 given that the previous tosses were k-...-1, 5 1 E[X] = 1 + E[X|1] + E[X] 6 6 However, the second case isnt as simple as it was previously. Originally, we only took into account of whether we rolled the number we want. However, if we roll a one, we dont have to start all over again, we just have to go back to the second step. 1 4 1 E[X|1] = 1 + E[X|2] + E[X|1] + E[X] 6 6 6 The above reads, we either roll a 2 and look at the expected rolls given that weve just rolled a 1 and a 2, or we roll another one, in which case we stay in the current state, or we roll anything else and have to start over again. We can apply this same argument for the next few cases.

1 1 4 E[X|2] = 1 + E[X|3] + E[X|1] + E[X] 6 6 6 1 1 4 E[X|3] = 1 + E[X|4] + E[X|1] + E[X] 6 6 6 1 1 4 E[X|4] = 1 + E[X|5] + E[X|1] + E[X] 6 6 6 Finally, once weve rolled 1-2-3-4-5, we either roll a 6 and nish, roll a one and go back to E[X|1], or start over again. 1 4 E[X|5] = 1 + E[X|1] + E[X] 6 6 Below is a graphic representation of the decision tree associated with our problem start

not 1

1 again 1

1-2 1-2-3 ...

anything else

1 etc ... Dont let the recursion scare you, you can always eliminate variables to get it down to a single expression. For example, the following scary looking recursive system 1 E[X] = 1 + E[X|1] 6 5 E[X|1] = 1 + E[X] 6 is equivalent to this problem weve all seen in Algebra 1 x=1+ y 6 5 y =1+ x 6 How do you solve this? You just eliminate the y variable by substituting the second into the rst x=1+ 1 6 5 1+ x 6

Ive been spoiled by using matrices to solve my systems ever since they crammed them down our throat back in precalc. Convince yourself that the above system is equivalent to solving 3

1 1 0 0 0 0 4 5 1 0 0 0 4 1 6 1 0 0 4 1 0 6 1 0 4 1 0 0 6 1 4 1 0 0 0 6

E[X] E[X|1] E[X|2] E[X|3] E[X|4] E[X|5]

6 6 6 6 6 6

408.3 Solutions Solving the above system, we get our solution E[X] = 46656 Incidentally, this is also 66

Вам также может понравиться