1 00:00:00,499 --> 00:00:02,830 The following content is provided under a Creative 2 00:00:02,830 --> 00:00:04,340 Commons license. 3 00:00:04,340 --> 00:00:06,680 Your support will help MIT OpenCourseWare 4 00:00:06,680 --> 00:00:11,050 continue to offer high-quality educational resources for free. 5 00:00:11,050 --> 00:00:13,660 To make a donation, or view additional materials 6 00:00:13,660 --> 00:00:17,547 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:17,547 --> 00:00:18,172 at ocw.mit.edu. 8 00:00:22,895 --> 00:00:24,270 PROFESSOR: Now today, we're going 9 00:00:24,270 --> 00:00:26,740 to talk about random walks. 10 00:00:26,740 --> 00:00:29,940 And in particular, we're going to look at a classic phenomenon 11 00:00:29,940 --> 00:00:32,750 known as Gamblers Ruin. 12 00:00:32,750 --> 00:00:34,760 It's a great way to end the term, 13 00:00:34,760 --> 00:00:38,050 because the solution requires several of the techniques 14 00:00:38,050 --> 00:00:40,740 that we've developed since the midterm. 15 00:00:40,740 --> 00:00:42,500 So it's actually a good review. 16 00:00:42,500 --> 00:00:43,730 We'll review recurrences. 17 00:00:43,730 --> 00:00:46,120 We'll review a lot of probability laws. 18 00:00:46,120 --> 00:00:49,050 And it's actually a nice problem to look at. 19 00:00:49,050 --> 00:00:52,090 It's another example where you get a non-intuitive solution 20 00:00:52,090 --> 00:00:53,740 using probability. 21 00:00:53,740 --> 00:00:56,560 And if you like to gamble, it's really good 22 00:00:56,560 --> 00:00:59,330 that you look at this problem before you go to Vegas or down 23 00:00:59,330 --> 00:01:01,050 to Foxwoods. 24 00:01:01,050 --> 00:01:07,165 Now the Gambler's Ruin problem, you start with n dollars. 25 00:01:19,330 --> 00:01:22,390 And we're going to do a simplified version, where 26 00:01:22,390 --> 00:01:27,080 in each bet, you win $1 or you lose $1. 27 00:01:27,080 --> 00:01:29,680 Now, these days, there are not many bets in a casino for $1. 28 00:01:29,680 --> 00:01:31,150 It's more like $10. 29 00:01:31,150 --> 00:01:34,250 But just to make it simple for counting, 30 00:01:34,250 --> 00:01:37,980 we're going to assume that each bet 31 00:01:37,980 --> 00:01:46,720 you win $1 with probability p, and you lose 32 00:01:46,720 --> 00:01:53,900 $1 with probability 1 minus p. 33 00:01:53,900 --> 00:01:57,120 And in this version, we're going to assume 34 00:01:57,120 --> 00:02:00,610 you keep playing until one of two things 35 00:02:00,610 --> 00:02:04,380 happens-- you get ahead by m dollars, 36 00:02:04,380 --> 00:02:10,530 or you lose all the money you came with-- all n dollars. 37 00:02:10,530 --> 00:02:19,850 So you play until you win m more-- net m plus-- 38 00:02:19,850 --> 00:02:23,780 or you lose n. 39 00:02:23,780 --> 00:02:25,030 And that's where you go broke. 40 00:02:25,030 --> 00:02:25,904 You run out of money. 41 00:02:28,335 --> 00:02:30,460 And we're going to assume you don't borrow anything 42 00:02:30,460 --> 00:02:31,085 from the house. 43 00:02:33,750 --> 00:02:36,610 All right, and we're going to look at the probability 44 00:02:36,610 --> 00:02:39,870 that you come out a winner versus going home broke-- 45 00:02:39,870 --> 00:02:42,690 that you made m dollars. 46 00:02:42,690 --> 00:02:46,510 Now, the game we're going to analyze is roulette, 47 00:02:46,510 --> 00:02:48,330 but the technique works for any of them. 48 00:02:54,160 --> 00:02:55,710 How many people have played roulette 49 00:02:55,710 --> 00:02:57,850 before in some form or another? 50 00:02:57,850 --> 00:03:00,200 OK, so this is a game where there's 51 00:03:00,200 --> 00:03:03,310 the ball that goes around the dish, and you spin the wheel. 52 00:03:03,310 --> 00:03:07,170 And there's 36 numbers from 1 to 36. 53 00:03:07,170 --> 00:03:09,260 Half of them are red, half are black. 54 00:03:09,260 --> 00:03:12,727 And then there's the zero and the double zero that are green. 55 00:03:12,727 --> 00:03:14,310 And we're going to look at the version 56 00:03:14,310 --> 00:03:17,000 where you just bet on red or black. 57 00:03:17,000 --> 00:03:19,710 And you win if the ball lands on a slot that's red. 58 00:03:19,710 --> 00:03:21,330 And there's 18 of those. 59 00:03:21,330 --> 00:03:23,690 And you lose otherwise. 60 00:03:23,690 --> 00:03:28,530 So in this case, the probability of winning, p, 61 00:03:28,530 --> 00:03:31,520 is there's 18 chances to win. 62 00:03:31,520 --> 00:03:33,760 And it's not 36 total. 63 00:03:33,760 --> 00:03:38,200 It's 38 total because of the zero and the double zero. 64 00:03:38,200 --> 00:03:42,680 All right so this is 9/19 chance of winning 65 00:03:42,680 --> 00:03:45,960 and a 10/19 chance of losing. 66 00:03:45,960 --> 00:03:51,400 And so this is a game that has a chance of winning of about 47%, 67 00:03:51,400 --> 00:03:53,370 so it's almost a fair game. 68 00:03:53,370 --> 00:03:54,869 It's not 50-50. 69 00:03:54,869 --> 00:03:57,160 And that's because the casino's got to make some money. 70 00:03:57,160 --> 00:03:59,400 I mean, they have the big facility. 71 00:03:59,400 --> 00:04:02,010 They're giving you free drinks, and all the rest. 72 00:04:02,010 --> 00:04:03,880 So they got to make money somehow. 73 00:04:03,880 --> 00:04:07,440 And they make money on this bet because they're 74 00:04:07,440 --> 00:04:12,430 going to make $0.03 on the dollar here. 75 00:04:12,430 --> 00:04:13,780 You're going to wager. 76 00:04:13,780 --> 00:04:18,230 And then you're going to come back with 47%. 77 00:04:18,230 --> 00:04:20,339 And people generally are fine with that. 78 00:04:20,339 --> 00:04:22,900 They don't expect to have the odds in their favor 79 00:04:22,900 --> 00:04:26,010 when you're gambling in a casino. 80 00:04:26,010 --> 00:04:30,180 Now, in an effort to sort of come home a winner, 81 00:04:30,180 --> 00:04:32,780 the way people do that-- knowing that the odds are 82 00:04:32,780 --> 00:04:35,980 a little against them-- is they might 83 00:04:35,980 --> 00:04:38,580 put more money in their pocket coming in 84 00:04:38,580 --> 00:04:40,050 than they expect to win. 85 00:04:40,050 --> 00:04:43,760 So often, you'll see people come into the casino 86 00:04:43,760 --> 00:04:48,829 with the goal of winning 100, but they start with 1,000 87 00:04:48,829 --> 00:04:49,495 in their pocket. 88 00:04:52,730 --> 00:04:55,440 So they're willing to risk $1,000, 89 00:04:55,440 --> 00:04:59,790 but they're going to quit happy if they get up 100. 90 00:04:59,790 --> 00:05:03,450 OK so you either go home with $1,100, 91 00:05:03,450 --> 00:05:05,550 or you're going home with $0, in this case. 92 00:05:05,550 --> 00:05:07,760 And you came with $1,000. 93 00:05:07,760 --> 00:05:10,300 And this means that you're-- at least the thinking goes-- 94 00:05:10,300 --> 00:05:13,890 this means you're more likely to go home happy. 95 00:05:13,890 --> 00:05:16,110 If you quit when you get up by 100, 96 00:05:16,110 --> 00:05:17,580 you're more likely to land there, 97 00:05:17,580 --> 00:05:21,650 because it's almost a fair game, than you are to lose all 1,000. 98 00:05:21,650 --> 00:05:23,570 That's the thinking anyway. 99 00:05:23,570 --> 00:05:27,090 In fact, my mother-in-law plays roulette, red and black, 100 00:05:27,090 --> 00:05:30,040 and she follows the strategy. 101 00:05:30,040 --> 00:05:32,570 And she claims that she does this for that reason-- 102 00:05:32,570 --> 00:05:35,510 that she almost always wins. 103 00:05:35,510 --> 00:05:37,820 She goes home happy almost always. 104 00:05:37,820 --> 00:05:40,290 And that's the important thing here. 105 00:05:40,290 --> 00:05:42,500 And it does reasonable, because after all, roulette 106 00:05:42,500 --> 00:05:45,980 is almost a fair game. 107 00:05:45,980 --> 00:05:47,470 So what do you think? 108 00:05:47,470 --> 00:05:49,100 How many people think she's right 109 00:05:49,100 --> 00:05:52,650 that she almost always wins? 110 00:05:52,650 --> 00:05:53,700 Anybody? 111 00:05:53,700 --> 00:05:54,900 I have sort of set it up. 112 00:05:54,900 --> 00:05:56,775 It's my mother-in-law, after all, 113 00:05:56,775 --> 00:05:58,380 so probably she's going to be wrong. 114 00:06:01,740 --> 00:06:06,480 Well, how many people think it's better than a 50% chance 115 00:06:06,480 --> 00:06:11,610 you win $100 before you lose $1,000? 116 00:06:11,610 --> 00:06:15,030 That's probably more-- how many people 117 00:06:15,030 --> 00:06:19,350 think you're more likely to lose $1,000 before you win $100? 118 00:06:19,350 --> 00:06:21,960 Wow, OK, so you've been to 6.04 too long now. 119 00:06:21,960 --> 00:06:24,420 OK, what about this-- how many people think you're 120 00:06:24,420 --> 00:06:30,505 more likely to lose $10,000 than to win $100? 121 00:06:30,505 --> 00:06:32,130 All right, how many people think you're 122 00:06:32,130 --> 00:06:33,500 more likely to lose $1 million? 123 00:06:36,697 --> 00:06:38,030 A bunch of you still think that. 124 00:06:38,030 --> 00:06:40,370 OK, well, you're right. 125 00:06:40,370 --> 00:06:45,830 In fact, it is almost certain you will go broke, 126 00:06:45,830 --> 00:06:51,730 no matter how much money you bring, before you win $100. 127 00:06:51,730 --> 00:06:55,290 In fact, we're going to prove today 128 00:06:55,290 --> 00:07:02,080 that the probability that you win $100 before losing 129 00:07:02,080 --> 00:07:04,870 $100 million if you stayed long enough-- that 130 00:07:04,870 --> 00:07:09,930 takes a while-- the chance you go home a winner is less than 1 131 00:07:09,930 --> 00:07:14,470 in 37,648. 132 00:07:14,470 --> 00:07:18,326 You have no chance to go home happy. 133 00:07:18,326 --> 00:07:20,950 So my mother-in-law's telling me the story about how she always 134 00:07:20,950 --> 00:07:21,740 goes home happy. 135 00:07:21,740 --> 00:07:24,960 And I'm saying, no, no, wait a minute, you can't. 136 00:07:24,960 --> 00:07:26,230 You never went home happy. 137 00:07:26,230 --> 00:07:28,040 Let's be honest. 138 00:07:28,040 --> 00:07:29,057 It can't be. 139 00:07:29,057 --> 00:07:30,390 She goes, no, no, no, it's true. 140 00:07:30,390 --> 00:07:32,905 I go, no, look, there's a mathematical proof. 141 00:07:32,905 --> 00:07:33,530 I have a proof. 142 00:07:33,530 --> 00:07:38,140 I can show you my proof-- very unlikely you go home a winner. 143 00:07:38,140 --> 00:07:40,150 So somehow, she's not very impressed 144 00:07:40,150 --> 00:07:42,300 with the mathematical proof. 145 00:07:42,300 --> 00:07:43,320 And she keeps insisting. 146 00:07:43,320 --> 00:07:45,400 And I keep trying to show her the proof. 147 00:07:45,400 --> 00:07:48,170 And anyway, I hope I'll have more luck with you guys today 148 00:07:48,170 --> 00:07:51,520 in showing you the proof that the chance you go home happy 149 00:07:51,520 --> 00:07:54,600 here is very, very small. 150 00:07:54,600 --> 00:07:56,240 Now, in the end, I didn't convince her, 151 00:07:56,240 --> 00:07:59,680 but we'll see how we do here today. 152 00:07:59,680 --> 00:08:02,940 Now, in order to see why this probability is so stunningly 153 00:08:02,940 --> 00:08:06,690 small-- you would just never guess it's that low-- 154 00:08:06,690 --> 00:08:09,510 we've got to learn about random walks. 155 00:08:09,510 --> 00:08:12,010 And they come up in all sorts of applications. 156 00:08:12,010 --> 00:08:16,330 In fact, page rank-- that got Google started-- 157 00:08:16,330 --> 00:08:19,390 it's all based on a random walk through the Web 158 00:08:19,390 --> 00:08:24,600 or through the links on web pages on that graph. 159 00:08:24,600 --> 00:08:26,380 Now, for the gambling problem, we're 160 00:08:26,380 --> 00:08:28,180 going to look at a very special case-- 161 00:08:28,180 --> 00:08:30,210 probably the simplest case of a random walk-- 162 00:08:30,210 --> 00:08:33,390 and that's a one-dimensional random walk. 163 00:08:33,390 --> 00:08:35,049 In a one-dimensional random walk, 164 00:08:35,049 --> 00:08:37,809 there's some value-- say the number of dollars 165 00:08:37,809 --> 00:08:40,240 you've got in your pocket. 166 00:08:40,240 --> 00:08:43,309 And this value can go up, or go down, 167 00:08:43,309 --> 00:08:47,310 or stay the same each time you do something like make a bet. 168 00:08:47,310 --> 00:08:51,760 And each of this happens with a certain probability. 169 00:08:51,760 --> 00:08:55,360 Now in this case, you either go up by one, 170 00:08:55,360 --> 00:08:58,010 or you go down by one, and you can't stay the same. 171 00:08:58,010 --> 00:09:00,100 Every bet you win $1 or you lose $1. 172 00:09:00,100 --> 00:09:02,490 So it's really a special case. 173 00:09:02,490 --> 00:09:05,700 And we can diagram it as follows. 174 00:09:05,700 --> 00:09:09,700 We can put time, or the number of bets, on this axis. 175 00:09:12,900 --> 00:09:16,365 And we can put the number of dollars on this axis. 176 00:09:20,120 --> 00:09:25,010 Now in this case, we start with n dollars. 177 00:09:25,010 --> 00:09:28,990 And we might win the first bet, so we go to n plus 1. 178 00:09:28,990 --> 00:09:35,240 We might lose a bet, might lose again, could win the next one, 179 00:09:35,240 --> 00:09:39,770 lose, win, lose, lose. 180 00:09:39,770 --> 00:09:45,210 So this corresponds to a string-- win, lose, lose, lose, 181 00:09:45,210 --> 00:09:53,290 lose, win, lose, win, lose, lose, lose. 182 00:09:53,290 --> 00:09:57,180 And when we win, we go up $1. 183 00:09:57,180 --> 00:10:01,260 When we lose, we go down $1. 184 00:10:01,260 --> 00:10:03,260 And it's called one-dimensional, because there's 185 00:10:03,260 --> 00:10:05,050 just one thing that's changing. 186 00:10:05,050 --> 00:10:07,510 You're going up and down there. 187 00:10:07,510 --> 00:10:11,420 Now, the probability of going up is p. 188 00:10:11,420 --> 00:10:13,990 And that's no matter what happened before. 189 00:10:13,990 --> 00:10:17,380 It's a memoryless independent system. 190 00:10:17,380 --> 00:10:20,950 The probability you win your i-th bet has nothing to do-- 191 00:10:20,950 --> 00:10:23,380 is totally independent, mutually independent-- of all 192 00:10:23,380 --> 00:10:26,900 the other bets that took place before. 193 00:10:26,900 --> 00:10:28,770 So let's write that down. 194 00:10:32,410 --> 00:10:40,040 So the probability of an up move is p. 195 00:10:40,040 --> 00:10:46,210 The probability of a down move is 1 minus p. 196 00:10:46,210 --> 00:10:52,720 And these are mutually independent of past moves. 197 00:10:56,840 --> 00:10:59,080 Now, when you have a random walk where 198 00:10:59,080 --> 00:11:01,060 the moves are mutually independent, 199 00:11:01,060 --> 00:11:02,739 it has a special name. 200 00:11:02,739 --> 00:11:03,780 It's called a martingale. 201 00:11:10,120 --> 00:11:12,070 All random walks don't have to have 202 00:11:12,070 --> 00:11:13,539 mutually independent steps. 203 00:11:13,539 --> 00:11:15,330 Say you're looking about winning and losing 204 00:11:15,330 --> 00:11:17,422 a baseball game in a series. 205 00:11:17,422 --> 00:11:19,630 We looked at a scenario where, if you lost yesterday, 206 00:11:19,630 --> 00:11:22,310 you're feeling lousy, more likely to lose today. 207 00:11:22,310 --> 00:11:24,140 Not true in the gambling case here. 208 00:11:24,140 --> 00:11:25,261 It's mutually independent. 209 00:11:25,261 --> 00:11:26,760 And that's the only case we're going 210 00:11:26,760 --> 00:11:29,290 to study for random walks. 211 00:11:29,290 --> 00:11:36,585 Now, if p is not 1/2, the random walk is said to be biased. 212 00:11:43,720 --> 00:11:45,430 And that's what happens in the casino. 213 00:11:45,430 --> 00:11:49,040 It's biased in favor of the house. 214 00:11:49,040 --> 00:11:53,460 If p equals 1/2, then the random walk is unbiased. 215 00:12:00,440 --> 00:12:03,360 Now, in this particular case that we're looking at, 216 00:12:03,360 --> 00:12:07,070 we have boundaries on the random walk. 217 00:12:07,070 --> 00:12:10,000 There's a boundary at 0, because you 218 00:12:10,000 --> 00:12:12,220 go home broke if you lost everything. 219 00:12:12,220 --> 00:12:15,770 If the random walk ever hit $0, you're done. 220 00:12:15,770 --> 00:12:23,100 And we're also going to put a boundary at n plus m. 221 00:12:26,220 --> 00:12:30,690 So I'm going to have a boundary here. 222 00:12:30,690 --> 00:12:37,180 So that if I win m dollars here, I stop and I go home happy. 223 00:12:37,180 --> 00:12:41,790 If the random walk ever goes here, then I stop. 224 00:12:41,790 --> 00:12:45,970 Those are called boundary conditions for the walk. 225 00:12:45,970 --> 00:12:49,800 And what we want to do is analyze the probability 226 00:12:49,800 --> 00:12:52,940 that we hit that top boundary before we 227 00:12:52,940 --> 00:12:55,630 hit the bottom boundary. 228 00:12:55,630 --> 00:12:58,000 So we're going to define that event to be W star. 229 00:13:00,580 --> 00:13:10,410 W star is the event that the random walk hits T, which 230 00:13:10,410 --> 00:13:17,680 is n plus m, before it hits 0. 231 00:13:21,240 --> 00:13:26,080 In other words, you go home happy without going broke. 232 00:13:26,080 --> 00:13:32,020 Let's also define D to be the number of dollars at the start. 233 00:13:32,020 --> 00:13:34,930 And this is just going to be n in our case. 234 00:13:40,960 --> 00:13:48,300 We're interested in, call it X sub n is the probability 235 00:13:48,300 --> 00:13:53,750 that we go home happy given we started with n dollars. 236 00:13:56,330 --> 00:13:57,740 And that's a function of n. 237 00:13:57,740 --> 00:14:00,650 So we'll make a variable called X n. 238 00:14:00,650 --> 00:14:02,710 And we want to know what that probability is. 239 00:14:02,710 --> 00:14:04,293 And of course, the more you come with, 240 00:14:04,293 --> 00:14:07,775 you'd think it's a higher chance of winning 241 00:14:07,775 --> 00:14:09,150 the more you have in your pocket, 242 00:14:09,150 --> 00:14:11,250 because you can play for more. 243 00:14:11,250 --> 00:14:14,570 So the goal is to figure this out. 244 00:14:14,570 --> 00:14:18,050 Now to do this, we could use the tree method. 245 00:14:18,050 --> 00:14:22,110 But it gets pretty complicated, because the sample space 246 00:14:22,110 --> 00:14:26,390 is the sample space of all one-loss sequences. 247 00:14:26,390 --> 00:14:28,130 And how big is that sample space? 248 00:14:32,106 --> 00:14:33,100 AUDIENCE: Infinite. 249 00:14:33,100 --> 00:14:35,050 PROFESSOR: Infinite. 250 00:14:35,050 --> 00:14:36,977 I could play forever. 251 00:14:36,977 --> 00:14:39,560 All right, now it turns out the probability of playing forever 252 00:14:39,560 --> 00:14:40,080 is 0. 253 00:14:40,080 --> 00:14:43,350 And we won't prove that, but there are an infinite number 254 00:14:43,350 --> 00:14:44,150 of sample points. 255 00:14:44,150 --> 00:14:46,150 So doing the tree method is a little complicated 256 00:14:46,150 --> 00:14:49,060 when it's infinite. 257 00:14:49,060 --> 00:14:52,280 So what we're going to do is use some 258 00:14:52,280 --> 00:14:54,950 of the theorems we've proved over the last few weeks 259 00:14:54,950 --> 00:14:57,835 and set up a recurrence to find this probability. 260 00:15:01,100 --> 00:15:04,640 Now, I'm going to tell you what the recurrence is, 261 00:15:04,640 --> 00:15:09,730 and then prove that that's right. 262 00:15:09,730 --> 00:15:17,580 So I claim that X n is 0 probability 263 00:15:17,580 --> 00:15:21,320 if we start with $0. 264 00:15:21,320 --> 00:15:25,730 It's 1 if we start with T dollars. 265 00:15:25,730 --> 00:15:36,580 And it's p times X n minus 1 plus 1 minus p X n plus 1 266 00:15:36,580 --> 00:15:43,100 if we start with between $0 and T dollars. 267 00:15:47,110 --> 00:15:49,450 All right, so that's what I claim X n is. 268 00:15:49,450 --> 00:15:51,960 And it's, of course, a recursion that I've set up here. 269 00:15:51,960 --> 00:15:53,650 So let's see why that's the case. 270 00:15:58,230 --> 00:16:00,930 OK, so let's check the 0 case. 271 00:16:00,930 --> 00:16:07,530 X 0 is the probability we go home a winner given 272 00:16:07,530 --> 00:16:09,210 we started with $0. 273 00:16:12,510 --> 00:16:13,475 Why is that 0? 274 00:16:16,974 --> 00:16:17,890 AUDIENCE: [INAUDIBLE]. 275 00:16:17,890 --> 00:16:19,386 PROFESSOR: What's that? 276 00:16:19,386 --> 00:16:21,180 AUDIENCE: [INAUDIBLE]. 277 00:16:21,180 --> 00:16:23,280 PROFESSOR: Yeah, you started broke. 278 00:16:23,280 --> 00:16:25,520 You never get off the ground, because you 279 00:16:25,520 --> 00:16:27,730 quit as soon as you have $0. 280 00:16:27,730 --> 00:16:35,020 So you have no chance to win, because you're broke to start. 281 00:16:35,020 --> 00:16:41,670 Let's check the next case, X T-- case n equals T-- 282 00:16:41,670 --> 00:16:45,570 is the probability you go home a winner given 283 00:16:45,570 --> 00:16:49,310 you started with T dollars. 284 00:16:49,310 --> 00:16:51,750 Why is that 1? 285 00:16:51,750 --> 00:16:55,147 Why is that certain, sort of from the definition? 286 00:16:55,147 --> 00:16:56,580 AUDIENCE: [INAUDIBLE]. 287 00:16:56,580 --> 00:16:58,230 PROFESSOR: You already have your money. 288 00:16:58,230 --> 00:16:59,560 You already hit the top boundary, 289 00:16:59,560 --> 00:17:00,643 because you started there. 290 00:17:00,643 --> 00:17:02,440 Remember, you quit and you're happy. 291 00:17:02,440 --> 00:17:05,900 Go home happy if you hit T dollars. 292 00:17:05,900 --> 00:17:08,697 All right, so you're guaranteed to go home happy, 293 00:17:08,697 --> 00:17:10,030 because you never make any bets. 294 00:17:10,030 --> 00:17:13,530 You started with all the money you needed to go home happy. 295 00:17:13,530 --> 00:17:18,490 Then we have the interesting case, 296 00:17:18,490 --> 00:17:20,849 where you start with between 0 and T dollars. 297 00:17:20,849 --> 00:17:23,990 And now you're going to make some bets. 298 00:17:23,990 --> 00:17:26,310 And then X n is the probability-- just 299 00:17:26,310 --> 00:17:30,590 the definition-- of going home happy-- i.e. winning 300 00:17:30,590 --> 00:17:34,680 and having T dollars, if you start with n. 301 00:17:34,680 --> 00:17:38,710 Now, there's two cases to analyze this, based on what 302 00:17:38,710 --> 00:17:40,380 happens in the first bet. 303 00:17:40,380 --> 00:17:43,600 You could win it, or you could lose it. 304 00:17:43,600 --> 00:17:46,240 And then we're going to recurse. 305 00:17:46,240 --> 00:17:54,840 So we're going to define E to be the event that you 306 00:17:54,840 --> 00:17:57,340 win the first bet. 307 00:18:00,570 --> 00:18:07,520 And E bar is the event that you lose the first bet. 308 00:18:12,080 --> 00:18:14,340 Now, by the theory of total probability, which 309 00:18:14,340 --> 00:18:18,120 we did in recitation maybe a couple weeks ago, 310 00:18:18,120 --> 00:18:21,970 we can rewrite this depending on whether E happened 311 00:18:21,970 --> 00:18:25,080 or the complement of E happened. 312 00:18:25,080 --> 00:18:28,370 And you get that the probability is simply 313 00:18:28,370 --> 00:18:31,990 the probability of going home happy 314 00:18:31,990 --> 00:18:34,844 and winning the first bet times-- 315 00:18:34,844 --> 00:18:36,510 and I've got to put the conditioning in. 316 00:18:36,510 --> 00:18:37,580 That doesn't go away. 317 00:18:44,080 --> 00:18:45,510 So I'm breaking into two cases. 318 00:18:45,510 --> 00:18:51,350 The first one is you win the first bet given D equals n, 319 00:18:51,350 --> 00:18:59,470 And the case where you lose the first bet, given D equals n. 320 00:19:02,070 --> 00:19:04,601 Any questions here? 321 00:19:04,601 --> 00:19:06,530 The probability of going home happy 322 00:19:06,530 --> 00:19:09,660 given you start with n dollars is the probability 323 00:19:09,660 --> 00:19:17,050 of going home happy and winning the first bet given D equals 324 00:19:17,050 --> 00:19:19,465 n plus the probability of going home happy 325 00:19:19,465 --> 00:19:22,800 and losing the first bet given D equals n-- 326 00:19:22,800 --> 00:19:25,630 just those are the two cases. 327 00:19:25,630 --> 00:19:29,290 Now I can use the definition of conditional probability 328 00:19:29,290 --> 00:19:31,256 to rewrite these. 329 00:19:31,256 --> 00:19:34,350 This is the probability-- you've got two events-- 330 00:19:34,350 --> 00:19:39,520 that the first one happens given D equals n 331 00:19:39,520 --> 00:19:43,440 times the probability the second one happens 332 00:19:43,440 --> 00:19:49,180 given that the first one happened and D equals n. 333 00:19:49,180 --> 00:19:51,560 This is just the definition of conditional probability, 334 00:19:51,560 --> 00:19:54,180 when I've got an intersection of events here. 335 00:19:54,180 --> 00:19:55,870 The probability of both happening 336 00:19:55,870 --> 00:19:57,760 is the probability of the first happening 337 00:19:57,760 --> 00:19:59,884 times the probability of the second happening given 338 00:19:59,884 --> 00:20:00,960 that the first happened. 339 00:20:00,960 --> 00:20:05,570 And of course, everything is in this universe of D equals n. 340 00:20:05,570 --> 00:20:07,670 So I've used it in a little different twist 341 00:20:07,670 --> 00:20:09,490 than we had it before. 342 00:20:09,490 --> 00:20:11,240 The same thing over here-- this now 343 00:20:11,240 --> 00:20:17,140 is the probability of E prime given D equals n 344 00:20:17,140 --> 00:20:20,390 times the probability of W star-- winning, going 345 00:20:20,390 --> 00:20:29,420 home happy-- given that you lost the first bet and D equals n. 346 00:20:29,420 --> 00:20:32,370 That's D equals n there. 347 00:20:32,370 --> 00:20:34,540 So it looks like it's got more complicated, 348 00:20:34,540 --> 00:20:36,005 but now we can start simplifying. 349 00:20:38,650 --> 00:20:40,610 What's the probability of winning 350 00:20:40,610 --> 00:20:44,022 the first bet given that you started with n dollars? 351 00:20:44,022 --> 00:20:45,390 AUDIENCE: p. 352 00:20:45,390 --> 00:20:47,565 PROFESSOR: p-- in fact, does this 353 00:20:47,565 --> 00:20:49,690 have anything to do with the probability of winning 354 00:20:49,690 --> 00:20:51,730 the first bet? 355 00:20:51,730 --> 00:20:53,870 No, this is just p. 356 00:20:59,610 --> 00:21:03,290 Now, what about this thing? 357 00:21:03,290 --> 00:21:13,620 I am conditioning on winning the first bet given 358 00:21:13,620 --> 00:21:15,355 and I start with n dollars. 359 00:21:19,750 --> 00:21:22,930 What's another way of expressing I won the first bet 360 00:21:22,930 --> 00:21:25,310 and I started with n dollars? 361 00:21:25,310 --> 00:21:26,087 Yeah? 362 00:21:26,087 --> 00:21:27,520 AUDIENCE: You have n plus $1. 363 00:21:27,520 --> 00:21:31,860 PROFESSOR: I now have n plus $1 going forward. 364 00:21:31,860 --> 00:21:34,900 And because I have a martingale, and everything 365 00:21:34,900 --> 00:21:37,340 is mutually independent, it's like the world 366 00:21:37,340 --> 00:21:38,700 starts all over again. 367 00:21:38,700 --> 00:21:41,440 I'm now in a state with n plus $1, 368 00:21:41,440 --> 00:21:44,110 and I want to know the probability 369 00:21:44,110 --> 00:21:45,375 that I go home happy. 370 00:21:45,375 --> 00:21:49,000 It doesn't matter how I got the n plus $1. 371 00:21:49,000 --> 00:21:52,000 It's just going forward-- I got n plus $1 in my pocket, 372 00:21:52,000 --> 00:21:54,270 I want to know the probability of going home happy. 373 00:21:54,270 --> 00:21:57,040 So I reset to D equals n plus 1. 374 00:21:59,740 --> 00:22:03,892 So I replace this with that, because however long it 375 00:22:03,892 --> 00:22:05,850 took me to get there and all that stuff doesn't 376 00:22:05,850 --> 00:22:07,660 matter for this analysis. 377 00:22:07,660 --> 00:22:08,990 It's all mutually dependent. 378 00:22:13,110 --> 00:22:16,360 Probability of losing the first bet given that I started 379 00:22:16,360 --> 00:22:20,490 with n dollars-- 1 minus p. 380 00:22:20,490 --> 00:22:23,290 Doesn't matter how much I started with. 381 00:22:23,290 --> 00:22:29,120 And here, I want to know the probability of going home happy 382 00:22:29,120 --> 00:22:31,950 given-- well, if I lost the first bet 383 00:22:31,950 --> 00:22:36,080 and I started with n, what have I got? 384 00:22:36,080 --> 00:22:37,087 n minus 1. 385 00:22:40,530 --> 00:22:44,746 It doesn't matter how I got to n minus 1. 386 00:22:44,746 --> 00:22:46,370 Now this is going to get really simple. 387 00:22:49,250 --> 00:22:52,720 What's another name for that expression? 388 00:22:52,720 --> 00:22:53,830 X n plus 1. 389 00:22:57,560 --> 00:23:00,800 And another name for this expression? 390 00:23:00,800 --> 00:23:02,003 X n minus 1. 391 00:23:05,680 --> 00:23:11,720 So we proved that X n equals p X n plus 1 plus 1 minus 392 00:23:11,720 --> 00:23:12,770 p X n minus 1. 393 00:23:12,770 --> 00:23:15,100 And that's what I claimed is true. 394 00:23:15,100 --> 00:23:18,380 So we finished the proof. 395 00:23:18,380 --> 00:23:20,214 Any questions? 396 00:23:20,214 --> 00:23:21,130 AUDIENCE: [INAUDIBLE]. 397 00:23:21,130 --> 00:23:22,356 PROFESSOR: Did i screw it up? 398 00:23:22,356 --> 00:23:23,272 AUDIENCE: [INAUDIBLE]. 399 00:23:23,272 --> 00:23:29,940 PROFESSOR: I claim probability of winning-- so let's 400 00:23:29,940 --> 00:23:31,590 see if I have a wrong in here. 401 00:23:31,590 --> 00:23:32,950 I might have screwed it up. 402 00:23:32,950 --> 00:23:38,440 I think I proved it's n plus 1, right? 403 00:23:38,440 --> 00:23:41,230 Yep, sure enough, I think this is a plus 1. 404 00:23:41,230 --> 00:23:43,210 That's a minus 1. 405 00:23:43,210 --> 00:23:45,692 Now, it's always good to check to you proved what you 406 00:23:45,692 --> 00:23:46,900 said you were going to prove. 407 00:23:46,900 --> 00:23:50,006 So I needed to change this. 408 00:23:50,006 --> 00:23:50,880 That's what I proved. 409 00:23:57,290 --> 00:23:58,239 Any other questions? 410 00:23:58,239 --> 00:23:59,780 That was a pretty important question. 411 00:24:02,370 --> 00:24:07,620 All right, so we have a recurrence for X n. 412 00:24:07,620 --> 00:24:10,430 Now, it's a little funny looking at first, 413 00:24:10,430 --> 00:24:12,430 because normally with a recurrence, 414 00:24:12,430 --> 00:24:15,770 X n would depend on X sub i that are smaller-- 415 00:24:15,770 --> 00:24:18,040 the i's are smaller than n. 416 00:24:18,040 --> 00:24:20,210 So it looks a little wacky. 417 00:24:20,210 --> 00:24:21,470 But is that a problem? 418 00:24:24,320 --> 00:24:26,550 I can just solve for X n plus 1-- 419 00:24:26,550 --> 00:24:29,550 just subtract this and put it over there. 420 00:24:29,550 --> 00:24:30,540 So let's do that. 421 00:24:47,740 --> 00:24:53,820 OK, so if I solve for X n plus 1 up there, I'll put p X n plus 1 422 00:24:53,820 --> 00:25:03,210 on its own side, I get p X n plus 1 minus X n plus 1 423 00:25:03,210 --> 00:25:08,690 minus p X n minus 1 equals 0. 424 00:25:08,690 --> 00:25:11,260 And I know that X 0 is 0. 425 00:25:11,260 --> 00:25:13,445 And I know that X T equals 1. 426 00:25:17,314 --> 00:25:18,855 Now, what type of recurrence is this? 427 00:25:21,860 --> 00:25:22,770 AUDIENCE: Linear. 428 00:25:22,770 --> 00:25:26,130 PROFESSOR: Linear, good, so it's a linear recurrence. 429 00:25:26,130 --> 00:25:28,853 And what type of linear recurrence is it? 430 00:25:28,853 --> 00:25:29,800 AUDIENCE: Homogeneous. 431 00:25:29,800 --> 00:25:33,200 PROFESSOR: Homogeneous-- that's the best case, simple case, 432 00:25:33,200 --> 00:25:34,039 that's good. 433 00:25:34,039 --> 00:25:35,830 The boundary conditions are a little weird, 434 00:25:35,830 --> 00:25:38,820 because the recurrences we all saw before, 435 00:25:38,820 --> 00:25:40,320 if we had two boundary conditions it 436 00:25:40,320 --> 00:25:41,870 would be X0 and X1. 437 00:25:41,870 --> 00:25:43,260 Here it's X0 and X T. 438 00:25:43,260 --> 00:25:45,151 But all's you need are two. 439 00:25:45,151 --> 00:25:46,400 Doesn't matter where they are. 440 00:25:48,960 --> 00:25:50,220 So how do I solve that thing? 441 00:25:50,220 --> 00:25:54,070 What's the next thing I do? 442 00:25:54,070 --> 00:25:55,041 What is it? 443 00:25:55,041 --> 00:25:56,540 AUDIENCE: Characterize the equation. 444 00:25:56,540 --> 00:25:57,560 PROFESSOR: Characterize the equation. 445 00:25:57,560 --> 00:25:59,294 And what do you do it that equation? 446 00:25:59,294 --> 00:26:00,210 AUDIENCE: [INAUDIBLE]. 447 00:26:00,210 --> 00:26:01,668 PROFESSOR: Solve it, get the roots. 448 00:26:01,668 --> 00:26:03,820 This'll be good practice for the final, 449 00:26:03,820 --> 00:26:06,797 because you'll probably have to do something like this. 450 00:26:06,797 --> 00:26:08,380 So that's the characteristic equation. 451 00:26:12,800 --> 00:26:15,940 And what's the order of this equation-- the degree? 452 00:26:20,340 --> 00:26:26,730 That's going to be 2, right? 453 00:26:26,730 --> 00:26:33,600 I'm going to have pr squared minus r plus 1 minus p is 0. 454 00:26:33,600 --> 00:26:37,177 That's my characteristic equation. 455 00:26:37,177 --> 00:26:37,760 Remember that? 456 00:26:37,760 --> 00:26:40,640 So I make this be the constant term. 457 00:26:40,640 --> 00:26:42,420 Then I have the first-order term, then 458 00:26:42,420 --> 00:26:45,210 the second-order term. 459 00:26:45,210 --> 00:26:48,570 All right, now I solve it. 460 00:26:48,570 --> 00:26:52,080 And that's easy for a second-order equation. 461 00:26:52,080 --> 00:26:59,540 1 plus or minus the square root of 1 minus 4p 1 462 00:26:59,540 --> 00:27:03,900 minus p over 2 p. 463 00:27:07,140 --> 00:27:08,030 Let's do that. 464 00:27:10,810 --> 00:27:15,380 OK, so this is 1 plus or minus the square root 465 00:27:15,380 --> 00:27:20,460 of 1 minus 4p plus 4p squared over 2p. 466 00:27:28,689 --> 00:27:30,730 Just using the quadratic formula and simplifying. 467 00:27:35,780 --> 00:27:38,930 And it works out really nicely, because that 468 00:27:38,930 --> 00:27:42,410 is the square root of-- this is just 1 minus 2p squared. 469 00:27:48,990 --> 00:27:55,740 So that's 1 plus or minus 1 minus 2p over 2p. 470 00:27:55,740 --> 00:28:06,410 And that is 2 minus 2p over 2p or 1 minus 1 cancels, 471 00:28:06,410 --> 00:28:13,020 then minus 2p is 2p over 2p. 472 00:28:13,020 --> 00:28:17,590 So the answers, the roots are divide by 2 on this one. 473 00:28:17,590 --> 00:28:22,947 I get 1 minus p over p and 1. 474 00:28:22,947 --> 00:28:23,780 Those are the roots. 475 00:28:27,582 --> 00:28:28,665 Are these roots different? 476 00:28:30,960 --> 00:28:32,460 Do I have the case of a double root? 477 00:28:32,460 --> 00:28:36,407 Are the roots always different? 478 00:28:36,407 --> 00:28:37,490 They're usually different. 479 00:28:37,490 --> 00:28:39,880 What's the case where these roots are the same? 480 00:28:39,880 --> 00:28:40,870 AUDIENCE: 0.5. 481 00:28:40,870 --> 00:28:43,760 PROFESSOR: 0.5, which is sort of an interesting case 482 00:28:43,760 --> 00:28:45,990 in this game. 483 00:28:45,990 --> 00:28:49,110 Because if p equals 1/2, we have an unbiased random walk. 484 00:28:49,110 --> 00:28:51,250 You got a fair game. 485 00:28:51,250 --> 00:28:53,730 And so it says right away, well, maybe the result 486 00:28:53,730 --> 00:28:56,807 is going to be different for a fair game than the game 487 00:28:56,807 --> 00:28:58,765 we're playing in the casino, where it's biased. 488 00:29:01,300 --> 00:29:04,432 So let's look at the casino game where p is not 1/2. 489 00:29:04,432 --> 00:29:05,640 Then the roots are different. 490 00:29:08,280 --> 00:29:10,000 Later, we'll go back and analyze the case 491 00:29:10,000 --> 00:29:13,053 when the roots of the same for the fair game. 492 00:29:20,310 --> 00:29:30,250 So if p is not 1/2, then we can solve for X n. 493 00:29:30,250 --> 00:29:37,960 X n is some constant times the first root to the nth power 494 00:29:37,960 --> 00:29:42,180 plus a constant times the second root to the nth power. 495 00:29:42,180 --> 00:29:45,515 Remember, that's how it works for any linear homogeneous 496 00:29:45,515 --> 00:29:46,015 recurrence. 497 00:29:49,300 --> 00:29:53,900 And that's easy, because the second root was 1. 498 00:29:53,900 --> 00:29:57,200 This is just plus B. 1 to the n is 1. 499 00:29:59,960 --> 00:30:03,050 How do I figure out what A and B are? 500 00:30:03,050 --> 00:30:04,300 AUDIENCE: Boundary conditions. 501 00:30:04,300 --> 00:30:07,090 PROFESSOR: Boundary conditions, very good. 502 00:30:07,090 --> 00:30:08,855 So let's look at the boundary conditions. 503 00:30:30,250 --> 00:30:36,100 OK, so the first boundary condition is at 0. 504 00:30:36,100 --> 00:30:40,410 So we have 0 equals X 0. 505 00:30:40,410 --> 00:30:44,570 Plugging in there-- oops I forgot the n up here. 506 00:30:44,570 --> 00:30:48,140 Plugging in n equals 0-- well, this to the 0 is just 1. 507 00:30:48,140 --> 00:30:57,054 That is A plus B. That means that B equals minus A. 508 00:30:57,054 --> 00:30:58,470 Then the second boundary condition 509 00:30:58,470 --> 00:31:05,880 is 1 equals X sub T. And that is A 1 minus 510 00:31:05,880 --> 00:31:13,442 p over p to the T plus B, but B was minus A. 511 00:31:13,442 --> 00:31:16,860 And now I can solve for A. 512 00:31:16,860 --> 00:31:28,850 So that means that A equals 1 over 1 minus p over p 513 00:31:28,850 --> 00:31:32,200 to the T minus 1. 514 00:31:32,200 --> 00:31:38,610 And B is negative A-- minus 1 over 1 minus p, 515 00:31:38,610 --> 00:31:40,810 over p to the T minus 1. 516 00:31:43,540 --> 00:31:51,140 And then I plug those back in to the formula for X n. 517 00:31:51,140 --> 00:31:54,320 So here's my constant A. I multiply that times 1 518 00:31:54,320 --> 00:31:59,020 minus p over p to the n, plus I add this in. 519 00:31:59,020 --> 00:32:02,620 So this means that the probability of going home 520 00:32:02,620 --> 00:32:10,500 a winner is 1 minus p over p to the n over that thing-- 1 minus 521 00:32:10,500 --> 00:32:14,830 p over p to the T minus 1, plus the B 522 00:32:14,830 --> 00:32:22,910 term, which really is a minus term here, is just minus 1. 523 00:32:22,910 --> 00:32:23,880 Put that on top here. 524 00:32:26,620 --> 00:32:30,350 That sort of looks messy, but there's 525 00:32:30,350 --> 00:32:34,780 a simplification to get an upper bound that's very close. 526 00:32:34,780 --> 00:32:38,870 In particular, if you have a biased game against you-- 527 00:32:38,870 --> 00:32:43,960 so if p is less than 1/2, as it is in roulette, 528 00:32:43,960 --> 00:32:47,720 then this is a number bigger than 1. 529 00:32:47,720 --> 00:32:53,105 That means that 1 minus p over p is bigger than 1. 530 00:32:56,340 --> 00:32:57,990 So this is bigger than 1. 531 00:32:57,990 --> 00:32:58,990 This is bigger than 1. 532 00:32:58,990 --> 00:33:01,620 T is the upper limit. 533 00:33:01,620 --> 00:33:03,410 It's n plus m. 534 00:33:03,410 --> 00:33:05,970 So I've got a bigger number down here than I do here. 535 00:33:05,970 --> 00:33:08,750 So overall, it's a fraction less than 1. 536 00:33:08,750 --> 00:33:10,860 And when you have a fraction less than 1, 537 00:33:10,860 --> 00:33:14,330 if you add 1 to the numerator and denominator, 538 00:33:14,330 --> 00:33:15,480 it gets closer to 1. 539 00:33:15,480 --> 00:33:17,670 It gets bigger. 540 00:33:17,670 --> 00:33:23,460 So this is upper-bounded by just adding 1 to each of these. 541 00:33:23,460 --> 00:33:28,440 Its upper-bounded by this over that, which is 1 minus p 542 00:33:28,440 --> 00:33:36,860 over p to the n minus T. And T is just n plus m. 543 00:33:36,860 --> 00:33:40,930 So this equals-- why don't I turn it upside down? 544 00:33:40,930 --> 00:33:44,720 Make it p over 1 minus p to get a fraction that's less than 1. 545 00:33:44,720 --> 00:33:50,950 T minus n, and that equals p over 1 minus p to the m. 546 00:33:54,240 --> 00:33:56,987 And this is how much you're trying to get ahead-- $100 547 00:33:56,987 --> 00:33:58,320 in the case of my mother-in-law. 548 00:34:01,230 --> 00:34:03,894 So what we've proved-- let me state 549 00:34:03,894 --> 00:34:05,060 what we proved as a theorem. 550 00:34:24,929 --> 00:34:31,830 So we proved that if p is less than 1/2-- 551 00:34:31,830 --> 00:34:33,889 if you're more likely to lose a bet 552 00:34:33,889 --> 00:34:40,420 than win it-- then the probability 553 00:34:40,420 --> 00:34:51,150 that you win m dollars before you lose n dollars is at most p 554 00:34:51,150 --> 00:34:55,510 over 1 minus p to the m. 555 00:34:55,510 --> 00:34:58,590 That's what we just proved. 556 00:34:58,590 --> 00:35:00,659 And so now you can plug in values-- for example, 557 00:35:00,659 --> 00:35:01,200 for roulette. 558 00:35:05,260 --> 00:35:11,960 p equals 9/19, which means that p over 1 559 00:35:11,960 --> 00:35:19,750 minus p-- that's going to be 9/19 over 10/19, 560 00:35:19,750 --> 00:35:21,010 which is just 9/10. 561 00:35:24,740 --> 00:35:30,010 And if m-- the amount you want to win-- is $100, 562 00:35:30,010 --> 00:35:33,165 and n is $1,000-- that's what you start with 563 00:35:33,165 --> 00:35:36,420 and you're willing to lose-- well, 564 00:35:36,420 --> 00:35:42,640 the probability you win-- you go home happy-- W 565 00:35:42,640 --> 00:35:50,310 star you win $100-- is less than or equal to 9/10 566 00:35:50,310 --> 00:35:53,800 raised to the m, which is 100. 567 00:35:53,800 --> 00:35:57,610 So it's 9/10 of 100, and that turns out to be less than 1 568 00:35:57,610 --> 00:36:06,280 in 37,648, which is where that answer came from. 569 00:36:06,280 --> 00:36:07,800 Now you can see why my mother-in-law 570 00:36:07,800 --> 00:36:11,640 may have got lost somewhere here now in the calculations. 571 00:36:11,640 --> 00:36:13,560 But this is a proof that the chance 572 00:36:13,560 --> 00:36:18,850 you win $100 before you lose $1,000 is very, very small. 573 00:36:18,850 --> 00:36:22,810 Now, do you see why the answer is no better than if you came 574 00:36:22,810 --> 00:36:26,310 with $1 million in your pocket? 575 00:36:26,310 --> 00:36:30,390 Say you came with n equals $1 million. 576 00:36:30,390 --> 00:36:32,390 Why is the answer not changing? 577 00:36:35,690 --> 00:36:37,020 Yeah. 578 00:36:37,020 --> 00:36:39,930 AUDIENCE: Once you lose, say, $1,000, 579 00:36:39,930 --> 00:36:42,650 you're already in a really deep hole. 580 00:36:42,650 --> 00:36:44,130 PROFESSOR: That's the intuition. 581 00:36:44,130 --> 00:36:44,671 That's right. 582 00:36:44,671 --> 00:36:46,560 We're going to get to that in a minute. 583 00:36:46,560 --> 00:36:49,590 I want to know from the formula, why 584 00:36:49,590 --> 00:36:54,280 is it no difference if I come with $1,000 versus $1 million? 585 00:36:54,280 --> 00:36:55,051 Yeah. 586 00:36:55,051 --> 00:36:56,592 AUDIENCE: The formula doesn't have n. 587 00:36:56,592 --> 00:37:00,180 PROFESSOR: Yeah, the formula has nothing to do with n. 588 00:37:00,180 --> 00:37:04,130 You could come with $100 trillion in your wallet, 589 00:37:04,130 --> 00:37:06,710 and it doesn't improve this bound. 590 00:37:06,710 --> 00:37:10,260 This bound only depends on what you're trying to win, 591 00:37:10,260 --> 00:37:11,530 not on how much you came with. 592 00:37:11,530 --> 00:37:13,890 So no matter how much you come with, 593 00:37:13,890 --> 00:37:17,250 the chance you win $100 before you lose everything 594 00:37:17,250 --> 00:37:20,860 is at most 1 in 37,000. 595 00:37:20,860 --> 00:37:22,650 Now, we can plug in some other values 596 00:37:22,650 --> 00:37:27,081 just for fun-- different values of m. 597 00:37:32,380 --> 00:37:36,350 If you thought 1 in 37,000 was unlikely, 598 00:37:36,350 --> 00:37:44,380 the chance of winning $1,000, or 1,000 bets worth 599 00:37:44,380 --> 00:37:50,870 before you're broke-- that's less than 9/10 to the 1,000. 600 00:37:50,870 --> 00:37:57,090 That's less than 2 times 10 to the minus 46-- 601 00:37:57,090 --> 00:37:59,760 really, really, really unlikely. 602 00:37:59,760 --> 00:38:06,400 Even winning $10 is not likely. 603 00:38:06,400 --> 00:38:07,650 Just plug in the numbers. 604 00:38:07,650 --> 00:38:13,790 The probability you win $10 betting $1 at a time 605 00:38:13,790 --> 00:38:18,470 is less than 9/10 to the 10th power. 606 00:38:18,470 --> 00:38:24,150 That's less than 0.35. 607 00:38:24,150 --> 00:38:30,710 You can come to the casino with $10 million, bet $1 at a time, 608 00:38:30,710 --> 00:38:34,390 and you quit if you just get up 10 bets-- get up $10. 609 00:38:34,390 --> 00:38:38,740 The chance you get up $10 before you lose $10 million is about 1 610 00:38:38,740 --> 00:38:42,100 in 3 you're twice as likely to lose $10 million 611 00:38:42,100 --> 00:38:44,400 as you are to win 10. 612 00:38:44,400 --> 00:38:46,780 That just seems weird, right? 613 00:38:46,780 --> 00:38:49,250 Because it's almost a fair game. 614 00:38:49,250 --> 00:38:51,390 It's almost 50-50. 615 00:38:51,390 --> 00:38:52,820 Any questions about the analysis? 616 00:38:55,860 --> 00:38:59,710 Yes, I find that shocking. 617 00:38:59,710 --> 00:39:02,580 Just the intuition would seem say otherwise. 618 00:39:02,580 --> 00:39:03,990 So I guess there's a moral here. 619 00:39:03,990 --> 00:39:05,880 If you're going to gamble, learn how 620 00:39:05,880 --> 00:39:09,050 to count cards in blackjack, or some game where 621 00:39:09,050 --> 00:39:10,722 you can make it even. 622 00:39:10,722 --> 00:39:12,680 Because even in a game where it's pretty close, 623 00:39:12,680 --> 00:39:14,580 you're doomed. 624 00:39:14,580 --> 00:39:18,710 You're just never going to go home happy. 625 00:39:18,710 --> 00:39:21,900 Now, if you could have a fair game, 626 00:39:21,900 --> 00:39:24,780 the world changes-- much better circumstance. 627 00:39:24,780 --> 00:39:28,800 So actually, let's do the same analysis for a fair game, 628 00:39:28,800 --> 00:39:31,680 because that's where our intuition really comes from. 629 00:39:31,680 --> 00:39:34,550 Because we're thinking of this game as almost fair. 630 00:39:34,550 --> 00:39:38,700 And in a fair game, the answer's going to be very different. 631 00:39:38,700 --> 00:39:41,320 And it all goes back to the recurrence and the roots 632 00:39:41,320 --> 00:39:43,490 of the characteristic equation. 633 00:39:43,490 --> 00:39:49,380 Because in a fair game, p is 1/2. 634 00:39:53,490 --> 00:39:56,290 And then you have a double root. 635 00:39:56,290 --> 00:40:04,970 1 minus 1/2 over 1/2 equals 1, and that means a double root 636 00:40:04,970 --> 00:40:07,570 at 1. 637 00:40:07,570 --> 00:40:10,390 And that changes everything. 638 00:40:10,390 --> 00:40:16,120 So let's go through now and do all this analysis 639 00:40:16,120 --> 00:40:17,440 in the case of a fair game. 640 00:40:20,140 --> 00:40:22,180 And this will give us practice with double roots 641 00:40:22,180 --> 00:40:23,630 and recurrences. 642 00:40:23,630 --> 00:40:25,939 Because as you see now, it does happen. 643 00:40:30,930 --> 00:40:33,866 Let's figure out the chance that we go home a winner. 644 00:40:38,490 --> 00:40:40,360 OK, so let's see. 645 00:40:40,360 --> 00:40:44,766 In this case, we know the roots. 646 00:40:44,766 --> 00:40:46,580 Can anybody tell me what formula we're 647 00:40:46,580 --> 00:40:49,870 going to use for the solution? 648 00:40:49,870 --> 00:40:52,230 Got a double root at 1. 649 00:40:52,230 --> 00:40:54,170 So there's going to be a 1 to the n here. 650 00:40:56,750 --> 00:40:58,590 I don't just put a constant A in front. 651 00:40:58,590 --> 00:41:00,744 What do I do with a double root? 652 00:41:00,744 --> 00:41:01,660 AUDIENCE: [INAUDIBLE]. 653 00:41:01,660 --> 00:41:02,260 AUDIENCE: A n. 654 00:41:02,260 --> 00:41:03,430 PROFESSOR: What is it? 655 00:41:03,430 --> 00:41:04,230 AUDIENCE: A n. 656 00:41:04,230 --> 00:41:06,560 PROFESSOR: A n-- not quite A n. 657 00:41:06,560 --> 00:41:08,200 You got an A n here. 658 00:41:08,200 --> 00:41:09,080 AUDIENCE: Plus B. 659 00:41:09,080 --> 00:41:13,280 PROFESSOR: Plus B-- that's what you do for a double root, 660 00:41:13,280 --> 00:41:17,340 because you make a first degree polynomial in n here. 661 00:41:17,340 --> 00:41:18,782 So we plug that in. 662 00:41:18,782 --> 00:41:20,240 The root's at 1, so it's real easy. 663 00:41:20,240 --> 00:41:21,910 The solution's really easy now. 664 00:41:21,910 --> 00:41:23,340 No messy powers or anything. 665 00:41:23,340 --> 00:41:28,487 It's just A n plus B. And I can figure out A and B 666 00:41:28,487 --> 00:41:29,695 from the boundary conditions. 667 00:41:36,550 --> 00:41:40,590 All right, X0 is 0. 668 00:41:40,590 --> 00:41:46,280 X 0 is just B, because it's A times 0 goes away. 669 00:41:46,280 --> 00:41:48,120 And that means that B equals 0. 670 00:41:48,120 --> 00:41:50,960 This is getting really simple. 671 00:41:50,960 --> 00:41:56,850 1 is X T. And that's A plus B, but B was 0. 672 00:41:56,850 --> 00:42:03,620 So that's A times 1 plus B. That's just A. 673 00:42:03,620 --> 00:42:11,600 It means A equals A n. 674 00:42:11,600 --> 00:42:13,270 Good, n's not 1. 675 00:42:13,270 --> 00:42:15,410 N's T. So it's A T plus B. 676 00:42:15,410 --> 00:42:17,550 This is A T here. 677 00:42:17,550 --> 00:42:19,280 So A T equals 1. 678 00:42:19,280 --> 00:42:23,780 That means A is 1 over T. 679 00:42:23,780 --> 00:42:32,854 All right, that means that X n is n over T. And T 680 00:42:32,854 --> 00:42:33,820 is the total. 681 00:42:33,820 --> 00:42:36,140 The top limit is n plus m, because you quit 682 00:42:36,140 --> 00:42:38,090 if you get ahead m dollars. 683 00:42:38,090 --> 00:42:44,030 This is just now n over n plus m. 684 00:42:44,030 --> 00:42:47,880 All right, so let's write that down. 685 00:42:47,880 --> 00:42:48,515 It's a theorem. 686 00:42:53,450 --> 00:42:58,920 If p is 1/2, i.e., you have a fair game, then 687 00:42:58,920 --> 00:43:04,580 the probability you win m dollars 688 00:43:04,580 --> 00:43:15,270 before you lose n dollars is just n over n plus m. 689 00:43:15,270 --> 00:43:17,590 And this might fit the intuition better. 690 00:43:20,700 --> 00:43:28,810 So for the mother-in-law strategy, if m is 100, 691 00:43:28,810 --> 00:43:34,580 and n is 1,000, what's the probability you 692 00:43:34,580 --> 00:43:36,460 win-- you go home a winner? 693 00:43:42,230 --> 00:43:48,904 Yeah, 1,000 over 1,000 plus 100. 694 00:43:48,904 --> 00:43:54,490 1,000 over 1,000 is 10 over 11. 695 00:43:54,490 --> 00:43:57,850 So she does go home happy most of the time-- 10 out of 11 696 00:43:57,850 --> 00:44:00,410 nights-- if she's playing a fair game. 697 00:44:02,970 --> 00:44:06,920 Any questions about that? 698 00:44:06,920 --> 00:44:13,630 So the trouble we get into here is that the fair game 699 00:44:13,630 --> 00:44:16,890 results match our intuition. 700 00:44:16,890 --> 00:44:20,520 You know if you have 10 times as much money in a fair game, 701 00:44:20,520 --> 00:44:23,660 you'd expect to go home happy 10 out of 11 nights. 702 00:44:23,660 --> 00:44:24,790 That makes a lot of sense. 703 00:44:24,790 --> 00:44:28,660 You go home happy 10, and then you lose the 11th. 704 00:44:28,660 --> 00:44:30,790 That's a 10 to 1 ratio, which is the money 705 00:44:30,790 --> 00:44:33,001 you brought into the game. 706 00:44:33,001 --> 00:44:36,160 The trouble we get into is, the fair game 707 00:44:36,160 --> 00:44:38,790 is very close to the real game. 708 00:44:38,790 --> 00:44:42,120 Instead of 50-50, it's 47-53. 709 00:44:42,120 --> 00:44:44,310 And so our intuition says the results-- 710 00:44:44,310 --> 00:44:46,780 the probability of going home happy in a fair game-- 711 00:44:46,780 --> 00:44:49,200 should be close to the probability of going 712 00:44:49,200 --> 00:44:51,180 home happy in the real game. 713 00:44:51,180 --> 00:44:52,340 And that's not true. 714 00:44:52,340 --> 00:44:55,990 There's a discontinuity here because of the double root. 715 00:44:55,990 --> 00:44:58,350 And the character completely changes. 716 00:44:58,350 --> 00:45:01,380 So instead of being close to 10 out of 11, 717 00:45:01,380 --> 00:45:04,140 you're down there at 1 in 37,000-- 718 00:45:04,140 --> 00:45:07,640 completely different behavior. 719 00:45:07,640 --> 00:45:12,580 OK, any questions? 720 00:45:12,580 --> 00:45:14,398 All right, so let me give you an-- yeah. 721 00:45:14,398 --> 00:45:17,540 AUDIENCE: So what happens if you make n 1, 722 00:45:17,540 --> 00:45:20,520 and then you do that repeatedly? 723 00:45:20,520 --> 00:45:23,280 PROFESSOR: Now, if I did n equals 1, 724 00:45:23,280 --> 00:45:24,750 I could use that as an upper bound, 725 00:45:24,750 --> 00:45:28,080 and it's not so interesting as, say, 90%. 726 00:45:28,080 --> 00:45:30,890 But I would actually go plug it back in here. 727 00:45:30,890 --> 00:45:33,300 So this would be n plus 1, and it would depend 728 00:45:33,300 --> 00:45:34,890 how much money I brought. 729 00:45:34,890 --> 00:45:39,640 But there is a pretty good chance I go home a winner for m 730 00:45:39,640 --> 00:45:41,230 equals 1. 731 00:45:41,230 --> 00:45:43,940 Because I've got a pretty good chance that I either-- 732 00:45:43,940 --> 00:45:46,090 47% chance I win the first time. 733 00:45:46,090 --> 00:45:47,752 Then I go home happy. 734 00:45:47,752 --> 00:45:50,790 If I lost the first time, now I've just got to win twice. 735 00:45:50,790 --> 00:45:52,720 And I might win twice in a row. 736 00:45:52,720 --> 00:45:55,330 That'll happen about 20% of the time. 737 00:45:55,330 --> 00:45:58,940 If I lose that, now I've got to win three in a row. 738 00:45:58,940 --> 00:46:02,150 That'll happen around 10% of the time. 739 00:46:02,150 --> 00:46:05,540 So I've got 10 plus 20 plus almost 50. 740 00:46:05,540 --> 00:46:08,010 Most of the time, I'm going to go home happy if I just 741 00:46:08,010 --> 00:46:10,460 have to get ahead by $1. 742 00:46:10,460 --> 00:46:12,460 But it doesn't take much more than one 743 00:46:12,460 --> 00:46:14,660 before you're not likely to go home happy. 744 00:46:14,660 --> 00:46:19,050 Getting ahead 10 is not going to happen, very likely. 745 00:46:19,050 --> 00:46:21,930 Now, you want to recurse on that? 746 00:46:21,930 --> 00:46:25,490 I'm pretty likely to get ahead by one. 747 00:46:25,490 --> 00:46:26,990 Well, OK, get ahead by one. 748 00:46:26,990 --> 00:46:29,639 I'm pretty likely to do it again. 749 00:46:29,639 --> 00:46:30,430 And I did it again. 750 00:46:30,430 --> 00:46:32,320 Now I'm pretty likely to do it again. 751 00:46:32,320 --> 00:46:33,945 And there's this thing called induction 752 00:46:33,945 --> 00:46:35,270 that we worried a lot about. 753 00:46:35,270 --> 00:46:38,130 So by induction, are we likely to go home happy with 10? 754 00:46:38,130 --> 00:46:43,460 No, because every time you don't get there, you're dead. 755 00:46:43,460 --> 00:46:45,720 You had a little chance of dying and not reaching one, 756 00:46:45,720 --> 00:46:48,251 and a little chance of dying and not going from one to two. 757 00:46:48,251 --> 00:46:50,000 And you add up all those chances of dying, 758 00:46:50,000 --> 00:46:52,440 and you're toast, because that'll be adding up 759 00:46:52,440 --> 00:46:56,317 to everything, pretty much. 760 00:46:56,317 --> 00:46:57,400 So that's a good question. 761 00:46:57,400 --> 00:46:59,410 If you're likely to get up by one, 762 00:46:59,410 --> 00:47:01,839 why aren't you likely to get up by 10? 763 00:47:01,839 --> 00:47:02,880 It doesn't work that way. 764 00:47:02,880 --> 00:47:05,300 That's a great question. 765 00:47:05,300 --> 00:47:12,130 Let me show you the phenomenon that's going on here, as 766 00:47:12,130 --> 00:47:15,300 to why it works out this way. 767 00:47:15,300 --> 00:47:16,644 We had the math. 768 00:47:16,644 --> 00:47:17,810 So we looked at it that way. 769 00:47:17,810 --> 00:47:20,810 We notice that one case is a double root and the other case 770 00:47:20,810 --> 00:47:22,200 isn't. 771 00:47:22,200 --> 00:47:23,640 And that exponential, in the case 772 00:47:23,640 --> 00:47:25,670 where you didn't have that second root at 1 773 00:47:25,670 --> 00:47:28,590 makes an enormous difference. 774 00:47:28,590 --> 00:47:32,800 Qualitatively, we can draw the two cases. 775 00:47:32,800 --> 00:47:43,010 So in the case of an unbiased or fair game, 776 00:47:43,010 --> 00:47:47,640 if we track what's going on over time, 777 00:47:47,640 --> 00:47:54,265 and we start with n dollars, sort of this is our baseline. 778 00:47:57,350 --> 00:48:02,190 And here's our target-- T is n plus m. 779 00:48:02,190 --> 00:48:04,230 And so we quit if we ever get here. 780 00:48:04,230 --> 00:48:06,530 And we quit if we ever hit the bottom. 781 00:48:06,530 --> 00:48:08,920 And we've got a random walk. 782 00:48:08,920 --> 00:48:15,200 It's going around, just doing this kind of stuff. 783 00:48:15,200 --> 00:48:19,150 And eventually, it's going to hit one of these boundaries. 784 00:48:19,150 --> 00:48:23,580 And if m is small compared to n, we're 785 00:48:23,580 --> 00:48:26,170 more likely to hit this boundary. 786 00:48:26,170 --> 00:48:29,150 And in fact, the chance we hit this boundary first 787 00:48:29,150 --> 00:48:31,120 is the ratio of these sizes. 788 00:48:31,120 --> 00:48:34,230 It's n over the total. 789 00:48:34,230 --> 00:48:38,300 It's the chance that we hit that one first. 790 00:48:38,300 --> 00:48:42,300 Now in the biased case, the picture looks different. 791 00:48:55,060 --> 00:49:02,342 So in the biased case-- so this is now biased. 792 00:49:02,342 --> 00:49:04,300 And we're going to assume it's downward biased. 793 00:49:04,300 --> 00:49:05,425 You're more likely to lose. 794 00:49:09,960 --> 00:49:13,770 So you start at n, you've got your boundary up here 795 00:49:13,770 --> 00:49:17,740 at T equals n plus m. 796 00:49:17,740 --> 00:49:21,190 Time is going this way. 797 00:49:21,190 --> 00:49:28,810 The problem is, you've got a downward sort of baseline, 798 00:49:28,810 --> 00:49:33,080 because you expect to lose a little bit each time. 799 00:49:33,080 --> 00:49:35,785 And so you're taking this random walk. 800 00:49:38,360 --> 00:49:41,970 And you collide here. 801 00:49:41,970 --> 00:49:47,050 And these things are known as the swings. 802 00:49:47,050 --> 00:49:48,795 This is known as the drift. 803 00:49:52,390 --> 00:49:55,930 And the drift downward is 1 minus 2p. 804 00:49:55,930 --> 00:49:58,510 That's what you expect to lose if you get the expected 805 00:49:58,510 --> 00:50:01,690 loss on each bet-- 1 minus 2p. 806 00:50:01,690 --> 00:50:04,800 Because you're going to not be a fair game. 807 00:50:04,800 --> 00:50:06,810 This one has zero drift up there. 808 00:50:06,810 --> 00:50:08,590 It stays steady. 809 00:50:08,590 --> 00:50:17,195 And in random walks, drift outweighs the swings. 810 00:50:19,900 --> 00:50:21,420 These are the swings here. 811 00:50:21,420 --> 00:50:23,310 And they're random. 812 00:50:23,310 --> 00:50:24,980 The drift is deterministic. 813 00:50:24,980 --> 00:50:26,950 It's steadily going down. 814 00:50:26,950 --> 00:50:28,890 And so almost always in a random walk, 815 00:50:28,890 --> 00:50:32,520 the drift totally takes over the swings. 816 00:50:32,520 --> 00:50:34,400 The swings are small compared to what you're 817 00:50:34,400 --> 00:50:37,730 losing on a steady basis. 818 00:50:37,730 --> 00:50:41,260 And that's why you're so much more likely to lose when 819 00:50:41,260 --> 00:50:44,110 you have the drift downward. 820 00:50:46,670 --> 00:50:49,450 Just as an example, maybe putting some numbers 821 00:50:49,450 --> 00:50:49,950 around that. 822 00:50:53,680 --> 00:50:55,700 The swings are the same in both cases, 823 00:50:55,700 --> 00:50:59,180 So that gives you some qualification for how big 824 00:50:59,180 --> 00:51:00,308 the swings tend to be. 825 00:51:03,660 --> 00:51:06,365 We can sort of do that with standard deviation notation. 826 00:51:09,380 --> 00:51:17,510 After X bets or X steps, the amount you've drifted, 827 00:51:17,510 --> 00:51:21,530 or the expected losses, 1 minus 2p 828 00:51:21,530 --> 00:51:25,940 X. Maybe we should just understand 829 00:51:25,940 --> 00:51:27,300 why this is the case. 830 00:51:27,300 --> 00:51:37,960 The expected return on a bet is 1 with probability p, 831 00:51:37,960 --> 00:51:41,650 and minus 1 with probability 1 minus p. 832 00:51:41,650 --> 00:51:46,046 And so that is-- did I get that right? 833 00:51:46,046 --> 00:51:49,730 I think that's right. 834 00:51:49,730 --> 00:51:52,200 Oh, expected loss-- [INAUDIBLE] drifts down. 835 00:51:52,200 --> 00:51:54,569 Instead of expected return, let's do the loss, 836 00:51:54,569 --> 00:51:55,610 because that's the drift. 837 00:51:55,610 --> 00:51:57,270 It's a downward thing. 838 00:51:57,270 --> 00:52:01,910 So the expected loss-- now you lose $1 with 1 minus p. 839 00:52:04,610 --> 00:52:07,670 And you gain $1, which is negative loss, 840 00:52:07,670 --> 00:52:10,050 with probability p. 841 00:52:10,050 --> 00:52:14,570 And so you get 1 minus p minus p is 1 minus 2p. 842 00:52:14,570 --> 00:52:16,370 So that's your expected loss. 843 00:52:16,370 --> 00:52:21,300 Your expected winnings are the negative of that. 844 00:52:21,300 --> 00:52:25,700 So after x steps, you expect to lose-- well, 845 00:52:25,700 --> 00:52:27,700 I just add up the linearity of expectation. 846 00:52:27,700 --> 00:52:30,950 You expect to lose this much x times. 847 00:52:30,950 --> 00:52:32,480 So that's your expected drift. 848 00:52:32,480 --> 00:52:36,440 You're expected to lose that much. 849 00:52:36,440 --> 00:52:38,950 Now, the swing-- and we won't prove 850 00:52:38,950 --> 00:52:44,670 this-- the swing is expected to be square root of x 851 00:52:44,670 --> 00:52:45,480 times a constant. 852 00:52:45,480 --> 00:52:47,670 So I've used the theta notation here. 853 00:52:47,670 --> 00:52:50,230 And the constant is small. 854 00:52:50,230 --> 00:52:54,090 If I take x consecutive bets for $1, 855 00:52:54,090 --> 00:52:57,610 I'm very likely to be about square root of x 856 00:52:57,610 --> 00:53:01,510 off of the expected drift. 857 00:53:01,510 --> 00:53:05,040 And you can see that this is square root. 858 00:53:05,040 --> 00:53:06,550 That is linear. 859 00:53:06,550 --> 00:53:10,250 So this totally dominates that. 860 00:53:10,250 --> 00:53:14,110 So the swings are generally not enough to save you. 861 00:53:14,110 --> 00:53:17,300 And so you're just going to cruise downward and crash, 862 00:53:17,300 --> 00:53:18,136 almost surely. 863 00:53:21,330 --> 00:53:25,160 OK, any questions about that? 864 00:53:31,360 --> 00:53:34,430 All right, so we figured out the probability of winning m 865 00:53:34,430 --> 00:53:36,420 dollars before going broke. 866 00:53:36,420 --> 00:53:40,230 That's done with. 867 00:53:40,230 --> 00:53:43,060 Now, this means it's logical to conclude 868 00:53:43,060 --> 00:53:47,310 you're likely go home broke in an unfair game. 869 00:53:47,310 --> 00:53:50,820 Actually, before we do that, there's one other case 870 00:53:50,820 --> 00:53:52,760 we've got to rule out. 871 00:53:52,760 --> 00:53:56,512 We've proved you're likely not to go home a winner. 872 00:53:56,512 --> 00:53:58,720 Does that necessarily mean you're likely to go broke? 873 00:53:58,720 --> 00:54:00,845 I've been saying that, but there's some other thing 874 00:54:00,845 --> 00:54:03,240 we should check. 875 00:54:03,240 --> 00:54:07,484 What's one way you might not go home broke? 876 00:54:07,484 --> 00:54:08,400 AUDIENCE: [INAUDIBLE]. 877 00:54:08,400 --> 00:54:09,385 PROFESSOR: What is it? 878 00:54:09,385 --> 00:54:09,780 AUDIENCE: You don't go home. 879 00:54:09,780 --> 00:54:11,220 PROFESSOR: You don't go home. 880 00:54:11,220 --> 00:54:13,520 And why would you not go home? 881 00:54:13,520 --> 00:54:14,020 Yeah? 882 00:54:14,020 --> 00:54:15,395 AUDIENCE: You're playing forever. 883 00:54:15,395 --> 00:54:16,990 PROFESSOR: You're playing forever-- we 884 00:54:16,990 --> 00:54:19,840 didn't rule out that case-- you're playing forever. 885 00:54:19,840 --> 00:54:22,790 But it turns out, if you did the same analysis, 886 00:54:22,790 --> 00:54:25,200 you can analyze the probability of going home broke. 887 00:54:25,200 --> 00:54:27,366 And when you add it to the probability of going home 888 00:54:27,366 --> 00:54:30,320 a winner, it adds to 1, which means the probability 889 00:54:30,320 --> 00:54:33,480 playing forever is 0. 890 00:54:33,480 --> 00:54:35,757 Now, there are sample points where you play forever. 891 00:54:35,757 --> 00:54:37,590 But when you add up all those sample points, 892 00:54:37,590 --> 00:54:41,210 if their probability is 0, we ignore them. 893 00:54:41,210 --> 00:54:42,950 And we say it can't happen. 894 00:54:42,950 --> 00:54:46,379 Now, we're bordering on philosophy here, 895 00:54:46,379 --> 00:54:47,920 because there is a sample point here. 896 00:54:47,920 --> 00:54:50,640 You could win, lose, win, lose, win, lose forever. 897 00:54:50,640 --> 00:54:54,305 But because you add them all up at 0, measure theory 898 00:54:54,305 --> 00:54:56,430 and some math we're not going to get into tells you 899 00:54:56,430 --> 00:54:58,010 it doesn't happen. 900 00:54:58,010 --> 00:55:00,430 It's probability 1 you're a winner or a loser. 901 00:55:07,430 --> 00:55:09,760 All right, so I'm not going to prove 902 00:55:09,760 --> 00:55:13,350 that the probability you play forever is 0. 903 00:55:24,250 --> 00:55:27,660 But let's look at how long you play. 904 00:55:27,660 --> 00:55:32,230 How long does it take you to go home one way or another-- go 905 00:55:32,230 --> 00:55:33,750 broke? 906 00:55:33,750 --> 00:55:36,440 And to do this, we're going to set up another recurrence. 907 00:55:39,440 --> 00:55:42,160 So we know eventually we hit a boundary. 908 00:55:42,160 --> 00:55:44,160 I want to know how many bets does it 909 00:55:44,160 --> 00:55:48,100 take to hit the boundary? 910 00:55:48,100 --> 00:55:50,530 How long do we get to play before we go home unhappy? 911 00:55:53,270 --> 00:55:59,150 So S will be the number of steps until we hit a boundary. 912 00:56:04,320 --> 00:56:06,820 And I want to know the expected number-- I'll call it 913 00:56:06,820 --> 00:56:10,464 E sub n here-- is the expected value of S given 914 00:56:10,464 --> 00:56:11,630 that I start with n dollars. 915 00:56:14,884 --> 00:56:16,300 I mean, the reason you could think 916 00:56:16,300 --> 00:56:18,550 about this is, we know we're going to go home 917 00:56:18,550 --> 00:56:20,410 broke-- pretty likely. 918 00:56:20,410 --> 00:56:22,810 Do we at least have some fun in the meantime? 919 00:56:22,810 --> 00:56:25,640 Do we get a lot gambling in and free drinks, or whatever, 920 00:56:25,640 --> 00:56:28,700 before we're killed here? 921 00:56:31,590 --> 00:56:33,210 Now, this also has a recurrence. 922 00:56:33,210 --> 00:56:35,030 And I'm going to show you what it is, then 923 00:56:35,030 --> 00:56:37,940 prove that that's correct. 924 00:56:37,940 --> 00:56:42,610 So I claim that the expected number 925 00:56:42,610 --> 00:56:44,600 of steps given we start with n dollars 926 00:56:44,600 --> 00:56:51,500 is 0 if we start with no money, because we are already broke. 927 00:56:51,500 --> 00:56:57,370 It's 0 if we start with T dollars, 928 00:56:57,370 --> 00:56:59,110 because then we just go home happy. 929 00:56:59,110 --> 00:57:03,290 There's no bets, because we've already hit the upper boundary. 930 00:57:03,290 --> 00:57:09,490 And the interesting case will be it's 1 plus p times E n minus 1 931 00:57:09,490 --> 00:57:17,980 plus 1 minus p-- oops, n plus 1-- 1 minus p E n minus 1, 932 00:57:17,980 --> 00:57:21,423 if we start with between 0 and T dollars. 933 00:57:26,980 --> 00:57:30,650 OK, so let's prove that. 934 00:57:33,400 --> 00:57:38,660 Actually, the proof is exactly the same as the last one. 935 00:57:38,660 --> 00:57:40,194 So I don't think I need to do it. 936 00:57:44,300 --> 00:57:48,370 The proof is pretty simple, because we look at two cases. 937 00:57:48,370 --> 00:57:52,150 You win the first bet-- happens with probability p. 938 00:57:52,150 --> 00:57:55,250 And then you're starting with n plus $1 over again. 939 00:57:55,250 --> 00:57:58,050 Or you lose the first bet-- happens 940 00:57:58,050 --> 00:58:00,360 with probability 1 minus p. 941 00:58:00,360 --> 00:58:03,890 And you're starting over with n minus $1 942 00:58:03,890 --> 00:58:05,705 now-- same as last time. 943 00:58:05,705 --> 00:58:07,080 In fact, this whole recurrence is 944 00:58:07,080 --> 00:58:11,690 identical to last time except for one thing. 945 00:58:11,690 --> 00:58:13,914 What's the one thing that's different now? 946 00:58:13,914 --> 00:58:14,870 AUDIENCE: [INAUDIBLE]. 947 00:58:14,870 --> 00:58:15,994 PROFESSOR: What is it? 948 00:58:15,994 --> 00:58:18,780 AUDIENCE: You have [INAUDIBLE]. 949 00:58:18,780 --> 00:58:20,738 PROFESSOR: You have-- 950 00:58:20,738 --> 00:58:23,208 AUDIENCE: So it's not [INAUDIBLE] any more. 951 00:58:23,208 --> 00:58:24,690 PROFESSOR: That's different. 952 00:58:24,690 --> 00:58:26,920 There's another difference. 953 00:58:26,920 --> 00:58:30,100 That's one difference that's going to make it inhomogeneous. 954 00:58:30,100 --> 00:58:31,409 That's sort of a pain. 955 00:58:31,409 --> 00:58:33,200 What's the other difference from last time? 956 00:58:33,200 --> 00:58:35,025 This part's the same otherwise. 957 00:58:35,025 --> 00:58:35,900 AUDIENCE: Boundaries. 958 00:58:35,900 --> 00:58:36,400 PROFESSOR: What is it? 959 00:58:36,400 --> 00:58:37,650 AUDIENCE: Boundary conditions. 960 00:58:37,650 --> 00:58:40,120 PROFESSOR: Boundary conditions-- that was a 1 before. 961 00:58:40,120 --> 00:58:42,290 Now it's a 0. 962 00:58:42,290 --> 00:58:46,420 OK, so a little change here, and I added a 1 here. 963 00:58:46,420 --> 00:58:50,041 But that's going to make it a pretty different answer. 964 00:58:50,041 --> 00:58:51,540 So let's see what the recurrence is. 965 00:58:51,540 --> 00:58:57,310 I'll rearrange terms here to put it into recurrence. 966 00:58:57,310 --> 00:59:07,650 I get p E sub n plus 1 minus E n plus 1 minus p E n minus 1 967 00:59:07,650 --> 00:59:10,710 equals minus 1, not 0. 968 00:59:10,710 --> 00:59:15,570 And the boundary conditions are E 0 is 0 and E T is 0. 969 00:59:18,210 --> 00:59:21,550 OK, what's the first thing you do 970 00:59:21,550 --> 00:59:26,020 when you have an inhomogeneous linear recurrence? 971 00:59:26,020 --> 00:59:28,920 Solve the homogeneous one. 972 00:59:28,920 --> 00:59:32,050 And the answer there-- well, it's the same as before. 973 00:59:32,050 --> 00:59:33,990 This is the part we analyzed. 974 00:59:33,990 --> 00:59:36,650 And we'll do it for the case when p is not 975 00:59:36,650 --> 00:59:39,770 1/2-- so the unfair game. 976 00:59:39,770 --> 00:59:47,270 So the homogeneous solution is E n 977 00:59:47,270 --> 00:59:51,870 just from before-- same thing-- 1 minus p over p 978 00:59:51,870 --> 00:59:55,720 to the n plus B. And this is the case with two roots. 979 00:59:55,720 --> 00:59:56,842 p does not equal 1/2. 980 01:00:00,620 --> 01:00:07,634 What's the next thing you do for inhomogeneous recurrence? 981 01:00:07,634 --> 01:00:11,620 Are we plugging in boundary conditions yet? 982 01:00:11,620 --> 01:00:12,120 No. 983 01:00:12,120 --> 01:00:14,840 So what do I do next? 984 01:00:14,840 --> 01:00:15,860 Particular solution. 985 01:00:21,160 --> 01:00:25,660 And what's my first guess? 986 01:00:25,660 --> 01:00:31,780 We have the recurrence like this here. 987 01:00:34,590 --> 01:00:37,960 What do I guess for E n? 988 01:00:37,960 --> 01:00:42,610 I'm trying to guess something that looks like that. 989 01:00:42,610 --> 01:00:45,380 So what do I guess? 990 01:00:45,380 --> 01:00:47,740 Constant, yeah. 991 01:00:47,740 --> 01:00:48,420 That's a scalar. 992 01:00:48,420 --> 01:00:51,120 I just guess a constant. 993 01:00:51,120 --> 01:00:57,420 And if I plug a constant a into here, it's going to fail. 994 01:00:57,420 --> 01:01:01,730 Because I'll just pull the a out. 995 01:01:01,730 --> 01:01:05,740 I'll get p minus 1 plus 1 minus p is 0, 996 01:01:05,740 --> 01:01:07,640 and 0 doesn't equal minus 1. 997 01:01:07,640 --> 01:01:08,220 So it fails. 998 01:01:12,240 --> 01:01:13,290 So I guess again. 999 01:01:13,290 --> 01:01:16,380 What do I guess next time? 1000 01:01:16,380 --> 01:01:19,990 a n plus b. 1001 01:01:19,990 --> 01:01:22,580 All right, and I don't think I'll 1002 01:01:22,580 --> 01:01:28,430 drag you through all the algebra for that, but it works. 1003 01:01:28,430 --> 01:01:35,310 And when you do it, you find that a is minus 1 1004 01:01:35,310 --> 01:01:38,100 over 2p minus 1. 1005 01:01:38,100 --> 01:01:39,470 And b could be anything. 1006 01:01:39,470 --> 01:01:44,080 So let me just rewrite this as 1 over 1 minus 2p. 1007 01:01:44,080 --> 01:01:46,170 And b can be anything, so we'll set b equal to 0. 1008 01:01:49,490 --> 01:01:52,910 So we've got our particular solution. 1009 01:01:52,910 --> 01:01:54,520 It's not hard to go compute that. 1010 01:01:54,520 --> 01:01:57,402 You just plug it back in and solve. 1011 01:02:04,642 --> 01:02:06,850 Now we add them together to get the general solution. 1012 01:02:18,830 --> 01:02:25,440 This is A n plus B. B was 0, and here's A as 1 over 1 minus 2p. 1013 01:02:25,440 --> 01:02:29,270 And now what do we do to finish? 1014 01:02:29,270 --> 01:02:33,700 I've got my general solution here 1015 01:02:33,700 --> 01:02:37,537 by adding up the homogeneous and the particular solution. 1016 01:02:37,537 --> 01:02:38,870 Plug in the boundary conditions. 1017 01:02:45,680 --> 01:02:49,789 All right, I'm not going to drag you through solving this case, 1018 01:02:49,789 --> 01:02:51,330 but I'm going to show you the answer. 1019 01:02:55,430 --> 01:03:03,480 E n equals n over 1 minus 2p minus T, the upper boundary, 1020 01:03:03,480 --> 01:03:13,400 over 1 minus 2p times 1 minus p over p to the n minus 1 over 1 1021 01:03:13,400 --> 01:03:17,930 minus p over p to the T minus 1. 1022 01:03:17,930 --> 01:03:20,670 So actually, this looks a little familiar from the last time 1023 01:03:20,670 --> 01:03:23,742 when we did this recurrence, figuring out the probability we 1024 01:03:23,742 --> 01:03:24,450 go home a winner. 1025 01:03:24,450 --> 01:03:27,630 Here this is the expected number of steps 1026 01:03:27,630 --> 01:03:30,900 to hit a boundary, to go home. 1027 01:03:30,900 --> 01:03:33,130 If we plug in the values, it's a little hairy, 1028 01:03:33,130 --> 01:03:35,850 but you can compute it. 1029 01:03:35,850 --> 01:03:42,860 So for example, if m is 100, n is 1,000, 1030 01:03:42,860 --> 01:03:47,160 T would be 1,100 in that case. 1031 01:03:47,160 --> 01:03:52,210 p is 9/19 playing roulette. 1032 01:03:52,210 --> 01:03:59,580 Then the expected number of bets before you have to go home 1033 01:03:59,580 --> 01:04:13,480 is 1,900 from this part, minus 0.56 from that part. 1034 01:04:13,480 --> 01:04:17,570 So actually 19,000, sorry. 1035 01:04:17,570 --> 01:04:24,580 So it's very close to 19,000 bets you've got to make. 1036 01:04:24,580 --> 01:04:28,230 So it takes a long time to lose $1,000. 1037 01:04:28,230 --> 01:04:32,410 And it sort of comes very close to the answer 1038 01:04:32,410 --> 01:04:34,860 you would have guessed without thinking and solving 1039 01:04:34,860 --> 01:04:36,120 the recurrence. 1040 01:04:36,120 --> 01:04:41,350 If you expect to lose 1 minus 2p every bet, 1041 01:04:41,350 --> 01:04:44,160 and you want to know how long the expected time to lose 1042 01:04:44,160 --> 01:04:46,890 n dollars, you might well have said, 1043 01:04:46,890 --> 01:04:51,210 I think it's going to be n over the amount I lose every time. 1044 01:04:51,210 --> 01:04:54,460 That would be wrong, technically, 1045 01:04:54,460 --> 01:04:57,400 because you'd have left off this nasty thing. 1046 01:04:57,400 --> 01:05:00,780 But this nasty thing doesn't make much of a real difference, 1047 01:05:00,780 --> 01:05:04,245 because it goes to 0 really fast for any numbers like 100 1048 01:05:04,245 --> 01:05:06,570 and 1,000-- makes no difference at all. 1049 01:05:06,570 --> 01:05:08,380 So the intuition in that case comes out 1050 01:05:08,380 --> 01:05:11,430 to be pretty close, even though technically, it's 1051 01:05:11,430 --> 01:05:15,540 not exactly right. 1052 01:05:15,540 --> 01:05:21,460 Now, to see why this goes to 0, if T equals n plus m here-- 1053 01:05:21,460 --> 01:05:25,350 this is n plus m-- and your upper limits, 1054 01:05:25,350 --> 01:05:31,040 say m goes to infinity-- it's 100 in this case-- then 1055 01:05:31,040 --> 01:05:34,770 that just zooms to 0, and you're only left with that. 1056 01:05:34,770 --> 01:05:39,510 Which means that we can use asymptotic notation here 1057 01:05:39,510 --> 01:05:42,782 to sort of characterize the expected number of bets. 1058 01:05:48,020 --> 01:05:51,000 And it's totally dominated by the drift. 1059 01:05:51,000 --> 01:05:58,120 So as m goes to infinity, the expected time to live here 1060 01:05:58,120 --> 01:06:02,060 is tilde n over 1 minus 2p. 1061 01:06:02,060 --> 01:06:07,330 If you've got n dollars, losing 1 minus 2p every time, 1062 01:06:07,330 --> 01:06:11,650 then you last for n over 1 minus 2p steps. 1063 01:06:11,650 --> 01:06:17,180 OK, now, actually, what situation in words 1064 01:06:17,180 --> 01:06:19,900 does m going to infinity mean? 1065 01:06:19,900 --> 01:06:23,200 Say I set m to be infinity? 1066 01:06:23,200 --> 01:06:26,810 What is that kind of game if m is infinity? 1067 01:06:26,810 --> 01:06:28,120 How long am I playing now? 1068 01:06:28,120 --> 01:06:28,729 Yeah. 1069 01:06:28,729 --> 01:06:30,520 AUDIENCE: Now you're playing for as long as 1070 01:06:30,520 --> 01:06:32,760 it takes you to lose all of your money. 1071 01:06:32,760 --> 01:06:36,200 PROFESSOR: Yes, because there is no stopping condition up here-- 1072 01:06:36,200 --> 01:06:37,380 going home happy. 1073 01:06:37,380 --> 01:06:43,060 I'm going to play forever or until I lose everything. 1074 01:06:43,060 --> 01:06:47,460 And this says how long you expect to play. 1075 01:06:47,460 --> 01:06:51,220 It's a little less than n over 1 minus 2p. 1076 01:06:51,220 --> 01:06:53,900 So if you play until you go broke, 1077 01:06:53,900 --> 01:06:55,510 that's how long you expect to play. 1078 01:06:59,950 --> 01:07:03,200 So that sort of makes sense in that scenario. 1079 01:07:03,200 --> 01:07:06,570 That's not one where it surprises you by intuition. 1080 01:07:06,570 --> 01:07:08,904 It is interesting to consider the case of a fair game. 1081 01:07:08,904 --> 01:07:10,820 Because there's something that's non-intuitive 1082 01:07:10,820 --> 01:07:12,570 that happens there. 1083 01:07:12,570 --> 01:07:14,290 So in a fair game, p is 1/2. 1084 01:07:17,350 --> 01:07:24,280 Now, if I plug in 1/2 here, well, I divide by 0. 1085 01:07:24,280 --> 01:07:27,730 I expect to play forever. 1086 01:07:27,730 --> 01:07:29,500 That's not a good way to do the analysis, 1087 01:07:29,500 --> 01:07:30,950 that you get to a divide by 0. 1088 01:07:30,950 --> 01:07:33,580 Let's actually go back and look at this 1089 01:07:33,580 --> 01:07:35,100 for the case when p is 1/2. 1090 01:07:37,769 --> 01:07:39,310 And see what happens in a fair game-- 1091 01:07:39,310 --> 01:07:43,250 how long you expect to play in a fair game. 1092 01:07:43,250 --> 01:07:48,500 Then the homogeneous solution is the simple case. 1093 01:07:48,500 --> 01:07:54,270 E is A n plus B. You have a double root at 1, 1094 01:07:54,270 --> 01:07:57,340 which we don't have to worry about 1 to the n. 1095 01:07:57,340 --> 01:08:03,550 When you do your particular solution, 1096 01:08:03,550 --> 01:08:08,620 you'll try a single scalar, and it fails. 1097 01:08:08,620 --> 01:08:11,730 I'll use lowercase a-- fails. 1098 01:08:11,730 --> 01:08:18,460 You will then try a degree one polynomial, and that will fail. 1099 01:08:18,460 --> 01:08:21,010 What are you going to try next? 1100 01:08:21,010 --> 01:08:28,210 Second-degree polynomial, and that will work. 1101 01:08:28,210 --> 01:08:34,100 OK, and the answer you get when you 1102 01:08:34,100 --> 01:08:41,960 do that is that-- I'll put the answer here. 1103 01:08:41,960 --> 01:08:47,450 It turns out that a is minus 1 and b and c can be 0. 1104 01:08:47,450 --> 01:08:49,470 So it's just going to be minus n squared 1105 01:08:49,470 --> 01:08:51,660 for the particular solution. 1106 01:08:51,660 --> 01:08:59,931 That means your general solution is A n plus B minus n squared. 1107 01:08:59,931 --> 01:09:01,389 Now you do your boundary condition. 1108 01:09:06,660 --> 01:09:10,180 You have E 0 is 0. 1109 01:09:10,180 --> 01:09:11,359 Plug in 0 for n. 1110 01:09:11,359 --> 01:09:13,720 That's equal to B. So B is 0. 1111 01:09:13,720 --> 01:09:15,620 That's nice. 1112 01:09:15,620 --> 01:09:19,180 E T is 0. 1113 01:09:19,180 --> 01:09:25,029 And I plug in T here, I get AT, B is 0 minus T squared. 1114 01:09:25,029 --> 01:09:28,160 So I solve for A here. 1115 01:09:28,160 --> 01:09:35,550 That means that A equals T. AT squared minus T squared is 0. 1116 01:09:35,550 --> 01:09:38,439 A has to be T. 1117 01:09:38,439 --> 01:09:49,960 So that means that E n is Tn minus n squared. 1118 01:09:49,960 --> 01:09:52,090 Now, T is the upper bound. 1119 01:09:52,090 --> 01:09:53,140 It's just n plus m. 1120 01:09:56,800 --> 01:10:00,880 n plus m times n minus n squared-- 1121 01:10:00,880 --> 01:10:01,925 this gets really simple. 1122 01:10:01,925 --> 01:10:03,190 The m squared cancels. 1123 01:10:03,190 --> 01:10:06,470 I just get n out. 1124 01:10:06,470 --> 01:10:08,820 That says if you're playing a fair game, until you 1125 01:10:08,820 --> 01:10:14,400 win m or lose n, you expect to play for nm steps, which 1126 01:10:14,400 --> 01:10:15,680 is really nice. 1127 01:10:15,680 --> 01:10:21,100 This is p is 1/2-- very clean. 1128 01:10:21,100 --> 01:10:25,940 Now, if you let m equal to infinity, 1129 01:10:25,940 --> 01:10:29,680 you're going to expect to play forever. 1130 01:10:29,680 --> 01:10:33,680 So with a fair game, if you play until you're broke, 1131 01:10:33,680 --> 01:10:37,220 the expected number of bets is infinite. 1132 01:10:37,220 --> 01:10:39,510 That's nice. 1133 01:10:39,510 --> 01:10:41,990 You can play forever is the expectation. 1134 01:10:46,160 --> 01:10:50,430 Now, here's the weird thing. 1135 01:10:50,430 --> 01:10:53,420 If you expect to play forever, does that 1136 01:10:53,420 --> 01:10:55,725 mean you're not likely to go home broke? 1137 01:10:58,580 --> 01:11:02,410 You expect to play forever. 1138 01:11:02,410 --> 01:11:05,976 And as long as you're playing, you're not going home broke. 1139 01:11:05,976 --> 01:11:07,850 Now, there's some chance of going home broke, 1140 01:11:07,850 --> 01:11:10,330 because you might just lose every bet-- not likely. 1141 01:11:15,930 --> 01:11:18,580 Here's the weird thing-- the probability 1142 01:11:18,580 --> 01:11:24,460 you go home broke if you play until you go broke is 1. 1143 01:11:24,460 --> 01:11:26,970 You will go home broke. 1144 01:11:26,970 --> 01:11:30,140 It's just that it takes you expected 1145 01:11:30,140 --> 01:11:32,930 infinite amount of time to do it-- 1146 01:11:32,930 --> 01:11:36,350 sort of one of these weird things in a fair game. 1147 01:11:36,350 --> 01:11:40,330 So here we proved the expected number bets is nm. 1148 01:11:40,330 --> 01:11:44,420 If m is infinite, that becomes an infinite number of bets. 1149 01:11:44,420 --> 01:11:48,095 One more theorem here-- this one's a little surprising. 1150 01:11:52,172 --> 01:11:54,130 This theorem is called Quit While You're Ahead. 1151 01:12:06,570 --> 01:12:18,700 If you start with n dollars, and it's a fair game, 1152 01:12:18,700 --> 01:12:33,700 and you play until you go broke, then 1153 01:12:33,700 --> 01:12:38,540 the probability that you do go broke, 1154 01:12:38,540 --> 01:12:41,730 as opposed to playing forever, is 1. 1155 01:12:41,730 --> 01:12:43,430 It's a certainty. 1156 01:12:43,430 --> 01:12:47,140 You'll go broke, even though you expect it to take 1157 01:12:47,140 --> 01:12:49,570 an infinite amount of time. 1158 01:12:49,570 --> 01:12:51,074 All right, so let's prove that. 1159 01:13:06,561 --> 01:13:07,977 OK, the proof is by contradiction. 1160 01:13:15,330 --> 01:13:18,600 Assume it's not true. 1161 01:13:18,600 --> 01:13:23,220 And that means that you're assuming 1162 01:13:23,220 --> 01:13:26,080 that there exists some number of dollars 1163 01:13:26,080 --> 01:13:32,880 that you can start with, and some epsilon bigger than 0, 1164 01:13:32,880 --> 01:13:41,190 such that the probability that you lose the n 1165 01:13:41,190 --> 01:13:43,900 dollars-- in which case you're going home 1166 01:13:43,900 --> 01:13:56,310 broke-- let me write the probability you go broke-- 1167 01:13:56,310 --> 01:14:00,009 is at most 1 minus epsilon. 1168 01:14:00,009 --> 01:14:01,800 In other words, if the theorem is not true, 1169 01:14:01,800 --> 01:14:04,860 there's some amount of money you can start with such 1170 01:14:04,860 --> 01:14:09,000 that the chance you go broke is less than 1-- less than 1 1171 01:14:09,000 --> 01:14:12,150 minus epsilon. 1172 01:14:12,150 --> 01:14:17,590 OK, now that means that for all m, where you might possibly 1173 01:14:17,590 --> 01:14:20,680 stop but you're not going to, the probability 1174 01:14:20,680 --> 01:14:31,365 you lose n before you win m is at most 1 minus epsilon. 1175 01:14:35,700 --> 01:14:37,240 Because we're saying the probability 1176 01:14:37,240 --> 01:14:39,360 you lose n no matter what is at most that. 1177 01:14:39,360 --> 01:14:41,820 So it's certainly less than 1 minus epsilon 1178 01:14:41,820 --> 01:14:46,670 that you lose n before you win m dollars. 1179 01:14:46,670 --> 01:14:48,880 And we know what that probability is. 1180 01:14:48,880 --> 01:14:51,770 This probability is just m over n plus m. 1181 01:14:51,770 --> 01:14:54,700 We proved that earlier. 1182 01:14:54,700 --> 01:14:59,360 So that has to be less than 1 minus epsilon for all m. 1183 01:14:59,360 --> 01:15:05,150 And now I just multiply through for all m. 1184 01:15:05,150 --> 01:15:07,570 That means that m is less than or equal to 1 1185 01:15:07,570 --> 01:15:09,616 minus epsilon n plus m. 1186 01:15:12,930 --> 01:15:17,092 And then we'll solve that. 1187 01:15:25,960 --> 01:15:29,630 OK, so just multiply this out. 1188 01:15:29,630 --> 01:15:39,260 So for all m less than or equal to n plus m minus epsilon 1189 01:15:39,260 --> 01:15:45,360 n minus epsilon m, and now pull the m terms out here, 1190 01:15:45,360 --> 01:15:49,640 I get for all m, epsilon m is less than 1191 01:15:49,640 --> 01:15:53,020 or equal to 1 minus epsilon n. 1192 01:15:53,020 --> 01:15:55,840 That means for all m, m is smaller 1193 01:15:55,840 --> 01:16:01,170 than 1 minus epsilon over epsilon times n. 1194 01:16:01,170 --> 01:16:03,060 And that can't be true. 1195 01:16:03,060 --> 01:16:06,270 It's not true the for all m, this is less than that, 1196 01:16:06,270 --> 01:16:09,030 because these are fixed values. 1197 01:16:09,030 --> 01:16:11,790 That's a contradiction. 1198 01:16:11,790 --> 01:16:15,320 All right, so we proved that if you 1199 01:16:15,320 --> 01:16:17,530 keep playing until you're broke, you will go 1200 01:16:17,530 --> 01:16:20,030 broke with probability 1. 1201 01:16:20,030 --> 01:16:25,060 So even if you're playing a fair game, quit while you're ahead. 1202 01:16:25,060 --> 01:16:28,970 Because if you don't, you're going to go broke. 1203 01:16:28,970 --> 01:16:31,500 The swings will eventually catch up with you. 1204 01:16:31,500 --> 01:16:35,159 So if we draw the graph here, we'll see why that's true. 1205 01:16:51,810 --> 01:16:55,660 All right, if I have time going this way, 1206 01:16:55,660 --> 01:17:01,750 and I start with n dollars, my baseline is here. 1207 01:17:01,750 --> 01:17:03,884 The drift is 0. 1208 01:17:03,884 --> 01:17:04,925 I'm going to have swings. 1209 01:17:07,480 --> 01:17:09,510 I might have some really big, high swings, 1210 01:17:09,510 --> 01:17:12,700 but it doesn't matter, because eventually I'm 1211 01:17:12,700 --> 01:17:16,030 going to get a really bad swing, and I'm going to go broke. 1212 01:17:19,450 --> 01:17:21,190 Now, if you ever play a game where 1213 01:17:21,190 --> 01:17:25,960 you're likely to be winning each time, and the drift goes up, 1214 01:17:25,960 --> 01:17:27,635 that's a good game to play, obviously. 1215 01:17:27,635 --> 01:17:29,529 It just keeps getting better. 1216 01:17:29,529 --> 01:17:31,070 And that's a whole math change there. 1217 01:17:34,410 --> 01:17:36,380 So that's it. 1218 01:17:36,380 --> 01:17:39,030 Remember, we have the ice cream study session Monday. 1219 01:17:39,030 --> 01:17:41,790 So come to that if you'd like. 1220 01:17:41,790 --> 01:17:45,470 And definitely come to the final on Tuesday. 1221 01:17:45,470 --> 01:17:47,440 And thanks for your hard work, and being 1222 01:17:47,440 --> 01:17:49,170 such a great class this year. 1223 01:17:49,170 --> 01:17:52,820 [APPLAUSE]