1 00:00:00,530 --> 00:00:02,960 The following content is provided under a Creative 2 00:00:02,960 --> 00:00:04,370 Commons license. 3 00:00:04,370 --> 00:00:07,410 Your support will help MIT OpenCourseWare continue to 4 00:00:07,410 --> 00:00:11,060 offer high quality educational resources for free. 5 00:00:11,060 --> 00:00:13,960 To make a donation or view additional materials from 6 00:00:13,960 --> 00:00:19,790 hundreds of MIT courses, visit MIT OpenCourseWare at 7 00:00:19,790 --> 00:00:22,456 ocw.mit.edu. 8 00:00:22,456 --> 00:00:25,760 PROFESSOR: Today's focus is probability and statistics. 9 00:00:25,760 --> 00:00:29,180 So let's start with probability. 10 00:00:29,180 --> 00:00:33,246 Let's look at probability for binary variables. 11 00:00:39,160 --> 00:00:43,070 What do you mean by a binary variable? 12 00:00:43,070 --> 00:00:45,650 It can take only two outcomes. 13 00:00:45,650 --> 00:00:48,920 So it can take only two values. 14 00:00:48,920 --> 00:00:55,320 For example, it could be 0 or 1, head or tail, on or off. 15 00:00:58,460 --> 00:01:03,670 So we are going to call this variable A, for instance. 16 00:01:03,670 --> 00:01:11,900 So A could be H, or A is equal to T. But that could happen. 17 00:01:11,900 --> 00:01:16,110 That event could happen with a certain probability. 18 00:01:16,110 --> 00:01:18,920 So by that, I mean the probabilities, like we are 19 00:01:18,920 --> 00:01:21,520 expressing the belief that the 20 00:01:21,520 --> 00:01:24,170 particularly event could happen. 21 00:01:24,170 --> 00:01:28,190 So we could assign a value to that. 22 00:01:28,190 --> 00:01:36,380 That is the probability of A taking value H. 23 00:01:36,380 --> 00:01:41,170 So here, the values of A and B-- 24 00:01:41,170 --> 00:01:45,410 sorry, here, the value of A can be either H or T, which 25 00:01:45,410 --> 00:01:49,370 means it has only two possible outcomes. 26 00:01:49,370 --> 00:01:51,190 That's why we call it a binary variable. 27 00:01:51,190 --> 00:02:06,470 However, P of A is equal to H can lie anywhere from 0 and 1, 28 00:02:06,470 --> 00:02:08,878 including 0 and 1. 29 00:02:08,878 --> 00:02:10,190 AUDIENCE: They don't have to be even? 30 00:02:10,190 --> 00:02:10,876 PROFESSOR: Sorry? 31 00:02:10,876 --> 00:02:12,750 AUDIENCE: They don't have to be even? 32 00:02:12,750 --> 00:02:13,090 PROFESSOR: Even? 33 00:02:13,090 --> 00:02:17,190 AUDIENCE: Even chance, even probability, like the same. 34 00:02:17,190 --> 00:02:19,900 PROFESSOR: Sorry, I didn't get your question. 35 00:02:19,900 --> 00:02:23,050 AUDIENCE: Even though they're binary, don't you need be able 36 00:02:23,050 --> 00:02:27,780 to have the same probability? 37 00:02:27,780 --> 00:02:29,450 PROFESSOR: OK, we'll look at that later. 38 00:02:29,450 --> 00:02:32,630 Like, this particular event can take a particular 39 00:02:32,630 --> 00:02:33,600 probability. 40 00:02:33,600 --> 00:02:36,500 And we'll look at that particular case later. 41 00:02:36,500 --> 00:02:39,130 But in general, a probability will always lie 42 00:02:39,130 --> 00:02:40,740 between 0 and 1. 43 00:02:43,770 --> 00:02:48,740 And it can take any value between 0 and 1 since the 44 00:02:48,740 --> 00:02:51,395 range it can take is continuous, sorry discrete. 45 00:02:57,870 --> 00:03:02,330 However, the value the variable can take is going to 46 00:03:02,330 --> 00:03:03,330 be discrete. 47 00:03:03,330 --> 00:03:08,190 It can take only H or T. So that's why you call it a 48 00:03:08,190 --> 00:03:09,520 binary variable. 49 00:03:09,520 --> 00:03:13,110 For example, take a deck of cards. 50 00:03:13,110 --> 00:03:17,910 Here, the value could be, for example if you consider only 51 00:03:17,910 --> 00:03:20,420 one particular suit, then it can be any 52 00:03:20,420 --> 00:03:21,810 one of those 13 values. 53 00:03:24,350 --> 00:03:27,560 So there, this variable is not binary. 54 00:03:27,560 --> 00:03:30,380 However, the probability of a particular event happening is 55 00:03:30,380 --> 00:03:33,830 always between 0 and 1. 56 00:03:33,830 --> 00:03:37,690 Now, let's look at some probability, like what you 57 00:03:37,690 --> 00:03:42,470 asked earlier is whether they will be equal, whether the 58 00:03:42,470 --> 00:03:46,430 probably of head and tail can be equal. 59 00:03:46,430 --> 00:03:51,730 So let's represent the probability of A of H. This 60 00:03:51,730 --> 00:03:54,570 can be between 0 and 1. 61 00:03:54,570 --> 00:04:00,480 What is the probability of A not happening? 62 00:04:00,480 --> 00:04:01,810 So we call it by A bar. 63 00:04:06,000 --> 00:04:09,700 Given P of A, can you give me P of A bar? 64 00:04:09,700 --> 00:04:10,660 AUDIENCE:1 minus P of A. 65 00:04:10,660 --> 00:04:16,070 PROFESSOR: 1 minus P of A. If there are two events 66 00:04:16,070 --> 00:04:22,190 happening, for example, you're throwing two coins, then we 67 00:04:22,190 --> 00:04:23,730 can consider their joint probabilities. 68 00:04:26,520 --> 00:04:33,030 So let's say we have a coin, A, and this coin, B. So this 69 00:04:33,030 --> 00:04:34,940 coin can take two values. 70 00:04:34,940 --> 00:04:39,070 And so this coin can take another two values. 71 00:04:39,070 --> 00:04:40,320 Sorry. 72 00:04:51,618 --> 00:04:57,410 We know A can take H with probability, say I assume it's 73 00:04:57,410 --> 00:04:59,380 unbiased, so it'll be 1/2. 74 00:05:02,050 --> 00:05:03,330 All these are going to be 1/2. 75 00:05:09,050 --> 00:05:11,415 What's the probability of HT? 76 00:05:14,110 --> 00:05:20,020 So now, we are considering a joint event, P of A is equal 77 00:05:20,020 --> 00:05:32,900 to H and P of B is equal to T. So in probability, we 78 00:05:32,900 --> 00:05:35,160 represent it by something like this. 79 00:05:35,160 --> 00:05:40,200 P A- do you know what is that? 80 00:05:40,200 --> 00:05:45,450 P A intersection B, you want both events to happen. 81 00:05:48,000 --> 00:05:57,350 That will be P of A. And in this case, it's P of B. So we 82 00:05:57,350 --> 00:06:00,160 could simply say it's 1/4. 83 00:06:00,160 --> 00:06:01,570 Why is this possible? 84 00:06:04,200 --> 00:06:06,380 It's because these two events are independent. 85 00:06:09,760 --> 00:06:14,100 The coin A getting head doesn't affect 86 00:06:14,100 --> 00:06:17,810 coin B getting a tail. 87 00:06:17,810 --> 00:06:20,790 So it doesn't have any influence. 88 00:06:20,790 --> 00:06:23,510 That's why these two events are independent. 89 00:06:23,510 --> 00:06:27,360 The dependent events are a bit complex, to analyze. 90 00:06:27,360 --> 00:06:30,860 Let's skip them at the moment. 91 00:06:30,860 --> 00:06:33,190 So we know all these probabilities 92 00:06:33,190 --> 00:06:34,440 are going to be 1/4. 93 00:06:36,770 --> 00:06:41,380 So we looked at a particular condition here. 94 00:06:41,380 --> 00:06:44,780 That is, A taking head and B taking tail. 95 00:06:44,780 --> 00:06:53,640 What about the condition, what about the case where either A 96 00:06:53,640 --> 00:06:57,290 or B takes a head? 97 00:06:57,290 --> 00:06:59,950 How can we represent that? 98 00:06:59,950 --> 00:07:05,560 So it will be something like A is equal to H or B is equal to 99 00:07:05,560 --> 00:07:13,600 H. Oh, probability at least 1, so by that, I can also 100 00:07:13,600 --> 00:07:14,850 represent something like this. 101 00:07:18,370 --> 00:07:20,100 OK, here, this is sufficient anyway. 102 00:07:27,900 --> 00:07:29,400 So what are the possibility events? 103 00:07:54,000 --> 00:08:00,660 So these three events could give rise to this probability. 104 00:08:00,660 --> 00:08:02,840 It's better if you can represent this in a diagram. 105 00:08:02,840 --> 00:08:06,760 So let's go and represent this in a diagram. 106 00:08:06,760 --> 00:08:12,175 This is A and this is B getting, say, head. 107 00:08:15,200 --> 00:08:18,250 In one case, both can take head. 108 00:08:18,250 --> 00:08:22,410 That is, this particular condition, intersection we 109 00:08:22,410 --> 00:08:23,660 earlier looked at. 110 00:08:32,309 --> 00:08:35,789 So what is this whole thing? 111 00:08:41,150 --> 00:08:46,010 That is, either A gets H or B gets H, 112 00:08:46,010 --> 00:08:47,720 which is this condition. 113 00:08:51,200 --> 00:08:54,450 We call it P of A union B. Ok. 114 00:09:02,360 --> 00:09:07,720 Is there an efficient way of finding this rather than 115 00:09:07,720 --> 00:09:09,450 writing down all possible cases? 116 00:09:11,950 --> 00:09:17,760 Is there an efficient way of finding P of A union B? 117 00:09:17,760 --> 00:09:19,916 From high school maths, probably? 118 00:09:19,916 --> 00:09:21,730 No idea? 119 00:09:21,730 --> 00:09:22,670 OK. 120 00:09:22,670 --> 00:09:29,350 P of A union B is equal to P of A plus P of B minus P of A 121 00:09:29,350 --> 00:09:32,530 intersection B. Because if you consider P of A, you would 122 00:09:32,530 --> 00:09:34,800 have taken this full circle. 123 00:09:34,800 --> 00:09:35,940 When you take P of B, you would have 124 00:09:35,940 --> 00:09:38,010 taken this full circle. 125 00:09:38,010 --> 00:09:41,490 So which means you're counting this area twice. 126 00:09:41,490 --> 00:09:42,740 So here, we deduct it once. 127 00:09:47,130 --> 00:09:48,283 OK? 128 00:09:48,283 --> 00:09:49,533 Great. 129 00:09:51,600 --> 00:09:54,720 So this is the basics of the probability. 130 00:09:54,720 --> 00:10:00,900 Now, actually we looked at two events, two joint events here. 131 00:10:00,900 --> 00:10:04,040 But we should have a formal way of 132 00:10:04,040 --> 00:10:07,350 looking at multiple events. 133 00:10:07,350 --> 00:10:09,720 So how can we do that? 134 00:10:09,720 --> 00:10:11,640 The first way is doing it by trees. 135 00:10:16,020 --> 00:10:20,120 Let's say we represent the outcome of the 136 00:10:20,120 --> 00:10:22,540 first trial by a branch. 137 00:10:28,240 --> 00:10:32,240 We can represent the outcome of the second trial by another 138 00:10:32,240 --> 00:10:37,160 branch from these two previous branches. 139 00:10:37,160 --> 00:10:38,710 So this would be H HH HT TH TT. 140 00:10:51,840 --> 00:10:56,370 And we know this could happen with probability 1/2. 141 00:10:56,370 --> 00:11:00,430 So we know it's, again, 1/2, 1/2, 1/2, 1/2. 142 00:11:00,430 --> 00:11:01,680 So this is 1/4. 143 00:11:11,440 --> 00:11:18,955 Suppose we want to do this for an outcome of throwing dice. 144 00:11:22,060 --> 00:11:25,540 Then, probably we would have 6 branches here. 145 00:11:28,330 --> 00:11:33,270 Which, again, forks into another 36 branches. 146 00:11:33,270 --> 00:11:35,730 So there should be another easier way. 147 00:11:35,730 --> 00:11:38,730 For that, we could use a second method call grid. 148 00:11:42,410 --> 00:11:44,130 We could simply put that in a diagram. 149 00:11:52,470 --> 00:11:54,310 So this is the first trial. 150 00:11:57,040 --> 00:11:59,165 And this will be our second trial. 151 00:12:11,580 --> 00:12:17,710 So now, we can represent any possible outcome on this grid. 152 00:12:17,710 --> 00:12:22,090 For example, can give you me an example where you throw the 153 00:12:22,090 --> 00:12:27,430 same number in both the trials? 154 00:12:27,430 --> 00:12:30,710 Then, what would be the layout of it in this grid? 155 00:12:34,150 --> 00:12:37,790 Throwing the same number in both the trials. 156 00:12:37,790 --> 00:12:39,025 Here's the first trial. 157 00:12:39,025 --> 00:12:40,976 This, the second. 158 00:12:40,976 --> 00:12:42,720 Then it would be the diagonal. 159 00:12:48,000 --> 00:12:51,940 If you want to calculate the probability, do you know the 160 00:12:51,940 --> 00:13:01,580 probability is the ratio between the outcomes we expect 161 00:13:01,580 --> 00:13:04,170 over all possible outcomes? 162 00:13:04,170 --> 00:13:09,170 So here, we know there will be 6 instances in this 163 00:13:09,170 --> 00:13:11,060 highlighted area. 164 00:13:11,060 --> 00:13:15,840 Compare that, 36 to all possibilities. 165 00:13:15,840 --> 00:13:17,266 So it'll be simpler 6/36. 166 00:13:22,620 --> 00:13:26,840 How can you find the probability of getting a 167 00:13:26,840 --> 00:13:28,670 cumulative total of, say, 6? 168 00:13:33,880 --> 00:13:36,480 Then again, it would be very simple. 169 00:13:36,480 --> 00:13:43,930 It could be 1, 5; 2, 4; 3, 3; 4, 2; 1, 5. 170 00:13:43,930 --> 00:13:46,000 All right? 171 00:13:46,000 --> 00:13:49,360 So it'll be 5 by 36. 172 00:13:52,550 --> 00:13:53,480 OK? 173 00:13:53,480 --> 00:13:56,550 So either by using trees or grid, you can easily find the 174 00:13:56,550 --> 00:13:57,800 probabilities. 175 00:14:04,060 --> 00:14:06,806 Now, let's look at a few concrete examples. 176 00:14:22,440 --> 00:14:24,030 Let's see. 177 00:14:24,030 --> 00:14:27,710 Suppose we are throwing three coins. 178 00:14:27,710 --> 00:14:33,610 Then, what is the probability of one particular outcome in 179 00:14:33,610 --> 00:14:36,590 that trial, in all three trials? 180 00:14:36,590 --> 00:14:38,980 What is the probability, assuming that these are 181 00:14:38,980 --> 00:14:41,020 unbiased coins? 182 00:14:41,020 --> 00:14:44,170 What is the probability of one particular outcome? 183 00:14:44,170 --> 00:14:46,915 Because how many possible outcomes are there if you are 184 00:14:46,915 --> 00:14:48,165 throwing three coins? 185 00:14:50,440 --> 00:14:53,410 Consider this tree. 186 00:14:53,410 --> 00:14:54,760 First, it splits into 2. 187 00:14:54,760 --> 00:14:56,040 Then, it splits into 4. 188 00:14:56,040 --> 00:14:57,940 Then? 189 00:14:57,940 --> 00:15:00,860 8, all right? 190 00:15:00,860 --> 00:15:04,990 OK, so there are 8 possible outcomes. 191 00:15:04,990 --> 00:15:08,110 So each outcome will have the probability 1/8. 192 00:15:12,230 --> 00:15:16,310 so what is the probability of heads appearing exactly twice? 193 00:15:19,370 --> 00:15:21,760 How can you do that? 194 00:15:21,760 --> 00:15:24,620 Of course, you can write the tree and count. 195 00:15:24,620 --> 00:15:26,480 What is the easier way of doing that? 196 00:15:26,480 --> 00:15:30,450 Since we know this count, since we know this probability 197 00:15:30,450 --> 00:15:32,310 of a particular event happening? 198 00:15:32,310 --> 00:15:34,590 How can we come up with the probability of 199 00:15:34,590 --> 00:15:36,510 getting exactly 2 heads? 200 00:15:41,960 --> 00:15:44,880 It could be head, head, or tail-- so this is by 201 00:15:44,880 --> 00:15:47,790 enumerating all the possible outcomes. 202 00:15:47,790 --> 00:15:51,700 So it could have been head, head, tail, where me put the 203 00:15:51,700 --> 00:15:54,080 tail only at the end. 204 00:15:54,080 --> 00:15:56,545 It could have been head, tail, head. 205 00:15:56,545 --> 00:16:01,100 Or it could have been tail, head, head. 206 00:16:01,100 --> 00:16:06,670 In these three cases, you're getting exactly 2 heads. 207 00:16:06,670 --> 00:16:10,150 So we are enumerating all possible outcomes. 208 00:16:10,150 --> 00:16:12,560 And we know each possible outcome will take the 209 00:16:12,560 --> 00:16:14,400 probability 1/8. 210 00:16:14,400 --> 00:16:18,360 So the total probability here is 3/8. 211 00:16:18,360 --> 00:16:18,950 OK? 212 00:16:18,950 --> 00:16:21,540 So this is one way of handling a probability question. 213 00:16:25,600 --> 00:16:28,670 You can do that only because these are independent events. 214 00:16:28,670 --> 00:16:31,240 And you can sum them. 215 00:16:31,240 --> 00:16:32,490 We'll come to that later. 216 00:16:43,070 --> 00:16:47,500 Suppose you are rolling two four-sided dice. 217 00:16:47,500 --> 00:16:52,000 And assuming they're fair, how many possible 218 00:16:52,000 --> 00:16:53,900 outcomes are there? 219 00:16:53,900 --> 00:16:59,585 Two four-sided dice, and assuming that each of them are 220 00:16:59,585 --> 00:17:02,890 fair-- that means unbiased-- 221 00:17:02,890 --> 00:17:05,740 how many possible outcomes are there? 222 00:17:05,740 --> 00:17:08,839 Consider this tree. 223 00:17:08,839 --> 00:17:13,040 First, it branches into 4, OK? 224 00:17:13,040 --> 00:17:15,849 In the first trial, it's a four-sided dice, so there are 225 00:17:15,849 --> 00:17:17,710 4 possible outcomes. 226 00:17:17,710 --> 00:17:18,960 So it branches into 4. 227 00:17:22,770 --> 00:17:25,329 Then, each branch will, in turn, fork 228 00:17:25,329 --> 00:17:27,280 into another 4 branches. 229 00:17:27,280 --> 00:17:31,100 So there are totally 16 outcomes. 230 00:17:31,100 --> 00:17:35,540 So what is the probability of rolling a 2 and a 3? 231 00:17:35,540 --> 00:17:39,900 What is the probability of rolling a 2 and a 3? 232 00:17:39,900 --> 00:17:44,950 Not in a given order, not in the given order. 233 00:17:44,950 --> 00:17:46,770 Can anyone give the answer? 234 00:17:49,870 --> 00:17:51,130 OK, let's see. 235 00:17:51,130 --> 00:17:54,510 So we have to roll a 2 and a 3. 236 00:17:54,510 --> 00:17:57,250 So which means it could have been 2, 3, or 3, 2. 237 00:18:00,350 --> 00:18:05,730 And we know the probability of each event is 1/16. 238 00:18:05,730 --> 00:18:07,750 So this will be 1/16. 239 00:18:07,750 --> 00:18:12,230 And this will be 1/16. 240 00:18:12,230 --> 00:18:14,810 So the total probability is 1/8. 241 00:18:17,560 --> 00:18:23,820 What is the probability of getting the sum of the rolls 242 00:18:23,820 --> 00:18:25,960 an odd number? 243 00:18:25,960 --> 00:18:28,090 What is the probability of getting an odd number as sum 244 00:18:28,090 --> 00:18:30,110 of the rolls? 245 00:18:30,110 --> 00:18:33,790 Now, this is getting a bit tricky because now it's maybe 246 00:18:33,790 --> 00:18:37,880 a bit harder to enumerate all possible cases. 247 00:18:37,880 --> 00:18:39,130 So how can we do that? 248 00:18:46,250 --> 00:18:47,190 There should be a short cut. 249 00:18:47,190 --> 00:18:48,681 AUDIENCE: It can either be odd or even. 250 00:18:48,681 --> 00:18:49,540 PROFESSOR: Sorry? 251 00:18:49,540 --> 00:18:51,640 AUDIENCE: You can either get odd or even. 252 00:18:51,640 --> 00:18:53,620 PROFESSOR: It can be either odd or even, right? 253 00:18:53,620 --> 00:18:55,230 So it will be 1/2. 254 00:18:55,230 --> 00:18:59,000 OK, there's another trick we might be able to use to get 255 00:18:59,000 --> 00:19:00,250 the answers quickly. 256 00:19:02,640 --> 00:19:07,060 What is the probability of the first roll being equal to the 257 00:19:07,060 --> 00:19:08,310 second roll? 258 00:19:13,200 --> 00:19:16,240 In the same line, you can think. 259 00:19:16,240 --> 00:19:19,840 What is the probability of getting the first roll equal 260 00:19:19,840 --> 00:19:21,320 to the second roll? 261 00:19:21,320 --> 00:19:22,580 It's quite similar to this. 262 00:19:25,870 --> 00:19:27,120 Any ideas? 263 00:19:30,550 --> 00:19:31,840 It's a four-sided dice. 264 00:19:31,840 --> 00:19:34,380 There are 4 possible outcomes. 265 00:19:34,380 --> 00:19:37,510 This is one case where it could be 1, 1, or it could be 266 00:19:37,510 --> 00:19:39,900 2, 2, or 3, 3, or 4, 4. 267 00:19:39,900 --> 00:19:45,320 And if it's inside a dice, it would be n, right? 268 00:19:45,320 --> 00:19:50,690 So if it's n-sided dice, there and n possible outcomes 269 00:19:50,690 --> 00:19:56,550 desired, and totally n by n outcomes. 270 00:19:56,550 --> 00:19:58,960 So you get 1/n probability. 271 00:20:03,240 --> 00:20:08,340 What is the probability of at least 1 roll equal to 4? 272 00:20:08,340 --> 00:20:10,340 At least 1 roll equal to 4? 273 00:20:14,490 --> 00:20:15,750 This is very interesting. 274 00:20:15,750 --> 00:20:17,040 These type of questions, you'll get in 275 00:20:17,040 --> 00:20:19,770 that Psets, I know. 276 00:20:19,770 --> 00:20:21,890 Probably in the quiz, too. 277 00:20:21,890 --> 00:20:25,060 What is the probability of getting at least 1 278 00:20:25,060 --> 00:20:26,310 roll equal to 4? 279 00:20:28,690 --> 00:20:30,780 OK, so what are the possible outcomes? 280 00:20:30,780 --> 00:20:35,330 First roll, could be a 4. 281 00:20:35,330 --> 00:20:39,300 And the second roll could be anything. 282 00:20:42,565 --> 00:20:44,480 Or it could be 4, and the first roll 283 00:20:44,480 --> 00:20:46,650 could have been anything. 284 00:20:46,650 --> 00:20:49,740 Or both could have been 4, but we would have considered that 285 00:20:49,740 --> 00:20:50,990 here, as well. 286 00:20:56,640 --> 00:20:59,340 So what we had to do is we had to calculate this probability 287 00:20:59,340 --> 00:21:02,030 and this probability, add them, and deduct this, because 288 00:21:02,030 --> 00:21:04,760 this would have been double counted. 289 00:21:04,760 --> 00:21:08,230 It's quite like, this intersection. 290 00:21:08,230 --> 00:21:12,490 We want to remove that, and we want to find the union OK? 291 00:21:12,490 --> 00:21:15,560 So what is this probability? 292 00:21:15,560 --> 00:21:18,455 Since we don't care about the second roll, we have to care 293 00:21:18,455 --> 00:21:21,300 only about the first roll, our first roll 294 00:21:21,300 --> 00:21:24,590 getting 4, which is 1/4. 295 00:21:24,590 --> 00:21:28,450 And this is 1/4 similarly. 296 00:21:28,450 --> 00:21:32,770 And this is 1/4 by 1/4, so 1/16. 297 00:21:32,770 --> 00:21:35,280 So it'll be 1/2 minus 1/16. 298 00:21:37,890 --> 00:21:41,460 And when you give the answers, if it's hard, you can just 299 00:21:41,460 --> 00:21:43,050 leave it like this. 300 00:21:43,050 --> 00:21:46,190 So this is what we call giving the answers as formula instead 301 00:21:46,190 --> 00:21:47,990 of giving exact fractions. 302 00:21:47,990 --> 00:21:50,280 Because sometimes it might be hard to find the fraction. 303 00:21:50,280 --> 00:21:53,500 Suppose it's something like 1 over, say, 2 to the power 5 304 00:21:53,500 --> 00:21:55,370 and a 3 to the 2, something like this. 305 00:21:55,370 --> 00:21:56,800 Or we'll say 5. 306 00:21:56,800 --> 00:22:00,095 You're not supposed to give the exact value in this amount 307 00:22:00,095 --> 00:22:01,100 or even the fractions. 308 00:22:01,100 --> 00:22:03,180 You can give such formulas. 309 00:22:03,180 --> 00:22:07,205 You can give something like this, too, to give the inverse 310 00:22:07,205 --> 00:22:10,930 probability of that not happening. 311 00:22:10,930 --> 00:22:11,400 Let's see. 312 00:22:11,400 --> 00:22:16,310 Let's move into a little bit more complicated example. 313 00:22:16,310 --> 00:22:18,710 A pack of cards-- 314 00:22:18,710 --> 00:22:21,750 what is the probability of getting an ace? 315 00:22:21,750 --> 00:22:23,000 Anyone? 316 00:22:25,442 --> 00:22:26,354 AUDIENCE: 1 out of 2? 317 00:22:26,354 --> 00:22:28,180 PROFESSOR: 1 out of 2? 318 00:22:28,180 --> 00:22:30,880 AUDIENCE: out of 52. 319 00:22:30,880 --> 00:22:32,920 PROFESSOR: Not a particular-- 320 00:22:32,920 --> 00:22:37,055 an ace, yes, just ace. 321 00:22:37,055 --> 00:22:38,438 AUDIENCE: Is it 4 out of 52? 322 00:22:38,438 --> 00:22:42,030 PROFESSOR: 4/52, yes. 323 00:22:42,030 --> 00:22:44,400 Or if you consider one suit, it would have 324 00:22:44,400 --> 00:22:46,100 been like 1/13, right? 325 00:22:46,100 --> 00:22:48,480 You could have considered one suit, and out of-- 326 00:22:48,480 --> 00:22:50,690 OK. 327 00:22:50,690 --> 00:22:52,612 It's the same analysis, right? 328 00:22:52,612 --> 00:22:54,220 OK. 329 00:22:54,220 --> 00:22:57,630 What is the probability of getting a specific card, which 330 00:22:57,630 --> 00:22:59,795 means, say, the ace of hearts? 331 00:23:04,690 --> 00:23:08,560 It's what she said, yeah, 1/52. 332 00:23:08,560 --> 00:23:10,990 What is the probability of not getting an ace? 333 00:23:14,190 --> 00:23:15,170 AUDIENCE: [INAUDIBLE]? 334 00:23:15,170 --> 00:23:16,750 PROFESSOR: Sorry? 335 00:23:16,750 --> 00:23:18,220 AUDIENCE: 1 minus-- 336 00:23:18,220 --> 00:23:19,470 PROFESSOR: 1/13. 337 00:23:22,060 --> 00:23:25,950 OK, this is where me make you solve the inverse probability. 338 00:23:25,950 --> 00:23:29,480 OK, so that will come into play very often. 339 00:23:29,480 --> 00:23:33,980 OK, now let's get into two decks of playing cards. 340 00:23:33,980 --> 00:23:39,160 OK, what is the sample size? 341 00:23:39,160 --> 00:23:42,930 What is the sample size of drawing cards from 342 00:23:42,930 --> 00:23:44,630 two decks of cards? 343 00:23:44,630 --> 00:23:45,420 Two cards, actually. 344 00:23:45,420 --> 00:23:48,110 You're going to draw two cards from two different decks. 345 00:23:51,930 --> 00:23:53,530 Sorry? 346 00:23:53,530 --> 00:23:54,470 OK. 347 00:23:54,470 --> 00:23:59,850 What is the sample size of drawing a card from one deck? 348 00:23:59,850 --> 00:24:03,530 There are 52 possible outcomes. 349 00:24:03,530 --> 00:24:07,890 So for each outcome here, we have 52 outcomes there, right? 350 00:24:07,890 --> 00:24:09,500 So it's 52 by 52. 351 00:24:09,500 --> 00:24:11,810 It's like the tree, but here, we have 52 branches. 352 00:24:15,060 --> 00:24:17,830 So eventually, you will have 52 by 52. 353 00:24:17,830 --> 00:24:19,220 This is where you can't enumerate all 354 00:24:19,220 --> 00:24:20,650 the possible cases. 355 00:24:20,650 --> 00:24:24,420 So you should have a way to find the final 356 00:24:24,420 --> 00:24:26,317 probability, OK? 357 00:24:29,810 --> 00:24:33,440 So in this case, what is the probability of getting at 358 00:24:33,440 --> 00:24:34,775 least one ace? 359 00:24:37,820 --> 00:24:42,280 What's the probability of getting at least one ace? 360 00:24:42,280 --> 00:24:46,150 This is, again, similar to this case. 361 00:24:46,150 --> 00:24:47,000 Remember this diagram. 362 00:24:47,000 --> 00:24:48,250 It's called Venn diagram. 363 00:24:53,250 --> 00:24:54,720 Remember this. 364 00:24:54,720 --> 00:24:58,260 So what is the probability of getting at least one ace, 365 00:24:58,260 --> 00:25:01,170 which means you could have got the ace from the first deck, 366 00:25:01,170 --> 00:25:03,940 or the second deck, or both. 367 00:25:03,940 --> 00:25:05,950 But if you're getting from both, you have to deduct it 368 00:25:05,950 --> 00:25:11,510 because otherwise, you would have double counted it. 369 00:25:11,510 --> 00:25:16,220 So getting an ace from the first deck is 1/13. 370 00:25:16,220 --> 00:25:18,130 Second deck, 1/13. 371 00:25:18,130 --> 00:25:22,240 Getting from both is 1/52 by 52. 372 00:25:22,240 --> 00:25:27,460 Sorry, 1/13 by 1/13. 373 00:25:39,900 --> 00:25:40,375 Sorry. 374 00:25:40,375 --> 00:25:41,784 AUDIENCE: Are you adding them? 375 00:25:41,784 --> 00:25:46,010 PROFESSOR: Yeah, that's what I explained earlier. 376 00:25:46,010 --> 00:25:47,310 You're doing two trials. 377 00:25:50,400 --> 00:25:52,290 You could have got the ace from here. 378 00:25:52,290 --> 00:25:54,310 And this could have been anything. 379 00:25:54,310 --> 00:25:56,270 You could have got the ace from here, and this could have 380 00:25:56,270 --> 00:25:57,150 been anything. 381 00:25:57,150 --> 00:26:00,400 You could have got an ace from both. 382 00:26:00,400 --> 00:26:03,150 So you should add these two probabilities because we need 383 00:26:03,150 --> 00:26:07,590 a case where at least one card is ace. 384 00:26:07,590 --> 00:26:10,775 But the problem is, this could have happened here and here. 385 00:26:10,775 --> 00:26:12,025 And so you will deduct it. 386 00:26:16,330 --> 00:26:20,690 What is the probability of getting neither card-- 387 00:26:20,690 --> 00:26:22,690 what is the probability of neither card being an ace? 388 00:26:26,394 --> 00:26:27,320 AUDIENCE: 1 minus that? 389 00:26:27,320 --> 00:26:31,890 PROFESSOR: 1 minus this, exactly. 390 00:26:31,890 --> 00:26:33,040 OK, you're getting comfortable with the 391 00:26:33,040 --> 00:26:35,550 inverse probability now. 392 00:26:35,550 --> 00:26:42,320 What's the probability of two cards from the same suit? 393 00:26:42,320 --> 00:26:44,060 What is the probability of getting two cards 394 00:26:44,060 --> 00:26:45,310 from the same suit? 395 00:26:50,290 --> 00:26:52,810 Now, it's getting interesting. 396 00:26:52,810 --> 00:26:55,390 Two cards from the same suit. 397 00:26:55,390 --> 00:26:58,600 So how can we think about this? 398 00:26:58,600 --> 00:27:02,910 Of course, you can enumerate all possible cases and count. 399 00:27:02,910 --> 00:27:04,160 We don't want to do that. 400 00:27:08,970 --> 00:27:13,315 OK, you're going to use the grid here to visualize this. 401 00:27:18,100 --> 00:27:19,110 OK? 402 00:27:19,110 --> 00:27:21,240 It could have been a spades, or hearts, 403 00:27:21,240 --> 00:27:22,890 or clubs, or a diamond. 404 00:27:29,270 --> 00:27:32,270 So we want two cards of the same suit, right? 405 00:27:38,440 --> 00:27:42,280 So it's 4/16 possible outcomes. 406 00:27:45,480 --> 00:27:47,310 Do you see that? 407 00:27:47,310 --> 00:27:50,270 So see, we are using all the tools 408 00:27:50,270 --> 00:27:51,650 available at our disposal-- 409 00:27:51,650 --> 00:27:58,340 trees, grids, counting, Ven diagrams, inverse probability. 410 00:27:58,340 --> 00:28:01,000 Yeah, you should be able to do that to get the answers 411 00:28:01,000 --> 00:28:04,270 quickly because you could have actually done-- you could have 412 00:28:04,270 --> 00:28:06,130 done something like this, too. 413 00:28:06,130 --> 00:28:08,180 But it will take more time, right? 414 00:28:08,180 --> 00:28:14,240 So this will be a simpler way of visualizing things. 415 00:28:14,240 --> 00:28:18,170 What is the probability of getting neither card a diamond 416 00:28:18,170 --> 00:28:19,420 nor a club? 417 00:28:25,300 --> 00:28:27,615 Neither card is diamond nor club. 418 00:28:27,615 --> 00:28:28,865 That is tricky. 419 00:28:31,000 --> 00:28:36,080 But since we have this grid, we can easily visualize that. 420 00:28:39,360 --> 00:28:43,590 So if neither card is diamond nor club, then it could have 421 00:28:43,590 --> 00:28:45,130 been only these two values, right? 422 00:28:48,740 --> 00:28:52,530 Which is, again, 4/16. 423 00:28:52,530 --> 00:28:54,200 So there are 4 possible cases. 424 00:28:57,490 --> 00:28:58,740 OK? 425 00:29:06,930 --> 00:29:09,860 So what is the summary? 426 00:29:09,860 --> 00:29:11,870 What is the take home message here? 427 00:29:18,680 --> 00:29:22,940 In probability, the probability of the belief, or 428 00:29:22,940 --> 00:29:26,635 the way of expressing the belief, of a 429 00:29:26,635 --> 00:29:29,320 particular event happening. 430 00:29:29,320 --> 00:29:32,990 Now, there could be several possible outcomes. 431 00:29:32,990 --> 00:29:35,390 Out of those possible outcomes, you have a certain 432 00:29:35,390 --> 00:29:37,400 number of desired outcomes. 433 00:29:37,400 --> 00:29:39,900 How can you find that? 434 00:29:39,900 --> 00:29:41,600 You can either enumerate all of them. 435 00:29:41,600 --> 00:29:44,610 You can put them in a tree, or you can put them in a grid. 436 00:29:44,610 --> 00:29:48,430 Or you can use some sort of Venn diagram and come up with 437 00:29:48,430 --> 00:29:50,470 some sort of analysis. 438 00:29:50,470 --> 00:29:57,310 Here, we start with our belief that the coin is unbiased, or 439 00:29:57,310 --> 00:29:59,350 we have a fair chance of drawing any card 440 00:29:59,350 --> 00:30:00,820 from the deck of cards. 441 00:30:00,820 --> 00:30:06,650 So we have all these unbiased beliefs, or beliefs about the 442 00:30:06,650 --> 00:30:09,680 characteristics of each trial. 443 00:30:09,680 --> 00:30:11,140 So we start from that. 444 00:30:13,690 --> 00:30:19,440 Then, we find the probability of a particular event 445 00:30:19,440 --> 00:30:22,540 happening in a certain number of trials. 446 00:30:22,540 --> 00:30:30,230 But what if you don't have the knowledge about the coin? 447 00:30:30,230 --> 00:30:32,250 What if you don't know whether it's fair or not? 448 00:30:32,250 --> 00:30:37,920 What if you don't know P of A is equal to H is equal to 1/2? 449 00:30:37,920 --> 00:30:38,910 Suppose you don't know that. 450 00:30:38,910 --> 00:30:42,380 Suppose it's P. How can you find it? 451 00:30:47,250 --> 00:30:50,800 What you could do is you could simulate this. 452 00:30:50,800 --> 00:30:55,040 You can throw coin several times and count the total 453 00:30:55,040 --> 00:30:58,910 number of heads you get, OK? 454 00:30:58,910 --> 00:31:04,140 So it could be n of heads over n trial will 455 00:31:04,140 --> 00:31:05,550 give you the P, right? 456 00:31:10,860 --> 00:31:14,950 This is a way of finding the probabilities through a 457 00:31:14,950 --> 00:31:16,290 certain number of trials. 458 00:31:16,290 --> 00:31:20,150 It's like simulating the experiments. 459 00:31:20,150 --> 00:31:21,515 It's called Monte Carlo simulation. 460 00:31:24,400 --> 00:31:27,950 And using that, we try to find a particular 461 00:31:27,950 --> 00:31:29,986 parameter of the model. 462 00:31:29,986 --> 00:31:33,750 You know how they actually found the value of pi at the 463 00:31:33,750 --> 00:31:35,240 beginning, pi? 464 00:31:38,210 --> 00:31:40,290 It's again using a Monte Carlo simulation. 465 00:31:40,290 --> 00:31:49,980 What you could do is for a given radius, you can actually 466 00:31:49,980 --> 00:31:51,920 check whether it lies within a circle or not. 467 00:31:51,920 --> 00:31:53,680 You can simulate the Monte Carlo simulation. 468 00:31:53,680 --> 00:31:59,070 And given this radius, you can come up with a particular 469 00:31:59,070 --> 00:32:04,520 location at random and check whether it's within this 470 00:32:04,520 --> 00:32:07,700 boundary or not, OK? 471 00:32:07,700 --> 00:32:10,080 So then, you know the outcome. 472 00:32:10,080 --> 00:32:11,170 You know the outcomes, right? 473 00:32:11,170 --> 00:32:22,280 So suppose this is n_a, And the total outcome is n_t. 474 00:32:22,280 --> 00:32:24,250 This gives you the area, right? 475 00:32:24,250 --> 00:32:29,212 We know this is r-squared, and this is pi r-squared. 476 00:32:29,212 --> 00:32:30,462 Sorry. 477 00:32:36,920 --> 00:32:39,621 When this is 4 r-squared, this is 2r, right? 478 00:32:44,700 --> 00:32:47,135 So using this, you can easily calculate pi. 479 00:32:55,020 --> 00:32:59,270 So now, since we are going to come up with these parameters 480 00:32:59,270 --> 00:33:05,800 through repeating the trials, we need to have a standardized 481 00:33:05,800 --> 00:33:08,740 way of finding these parameters. 482 00:33:08,740 --> 00:33:11,470 We can't simply say this, right? 483 00:33:11,470 --> 00:33:13,615 Take this example. 484 00:33:13,615 --> 00:33:17,640 You know this MIT shuttle right? 485 00:33:17,640 --> 00:33:21,380 A shuttle arriving at the right time, or the time 486 00:33:21,380 --> 00:33:24,870 difference between the arrival and the actual quoted time can 487 00:33:24,870 --> 00:33:27,380 be plotted in a graph. 488 00:33:27,380 --> 00:33:31,220 So if you put that it is spread around 0, right? 489 00:33:31,220 --> 00:33:35,010 Probably, or we hope so. 490 00:33:35,010 --> 00:33:36,370 OK? 491 00:33:36,370 --> 00:33:47,840 Now, from this, we can see that actually the mean of this 492 00:33:47,840 --> 00:33:52,950 simulation will give you the expected difference in the 493 00:33:52,950 --> 00:33:58,330 time, the expected difference in the arrival time from the 494 00:33:58,330 --> 00:33:59,580 actual quoted time. 495 00:34:01,890 --> 00:34:06,830 And we hope this expectation to be 0. 496 00:34:06,830 --> 00:34:09,150 We call that mean. 497 00:34:09,150 --> 00:34:10,400 Means is taking the average. 498 00:34:20,550 --> 00:34:26,389 But this distribution might actually give you some 499 00:34:26,389 --> 00:34:29,650 information, some extra information, as well. 500 00:34:29,650 --> 00:34:34,150 That is, how well we can actually believe this, how 501 00:34:34,150 --> 00:34:35,700 much we can rely on this. 502 00:34:35,700 --> 00:34:41,340 If the spread is greater, something like this, then 503 00:34:41,340 --> 00:34:44,449 probably you might actually not trust the system, right? 504 00:34:44,449 --> 00:34:47,340 Although the mean is 0, it's going to come 505 00:34:47,340 --> 00:34:48,449 early or late, right? 506 00:34:48,449 --> 00:34:49,699 Which means it's useless. 507 00:34:52,750 --> 00:35:00,090 Similarly, in this case, we have a spread around mean 0. 508 00:35:00,090 --> 00:35:10,280 But if you take the score, the marks you get for 600, it 509 00:35:10,280 --> 00:35:11,290 could be something like this. 510 00:35:11,290 --> 00:35:13,730 It's not centered around 0, right? 511 00:35:13,730 --> 00:35:14,790 Hopefully. 512 00:35:14,790 --> 00:35:18,570 It's probably, say, 50. 513 00:35:18,570 --> 00:35:22,850 Then, we actually want the spread to be small or large? 514 00:35:25,420 --> 00:35:31,290 We want the spread to be large because we want to distinguish 515 00:35:31,290 --> 00:35:32,580 the levels, right? 516 00:35:32,580 --> 00:35:34,360 The students' level of understanding. 517 00:35:34,360 --> 00:35:40,270 600. 518 00:35:40,270 --> 00:35:44,930 Anyway, so the spread determines what is the 519 00:35:44,930 --> 00:35:50,650 variation percent in their distribution of the scores? 520 00:35:50,650 --> 00:35:53,305 We measure that by a variable called standard deviation. 521 00:35:59,340 --> 00:36:05,630 In this case, this particular sample will be different from 522 00:36:05,630 --> 00:36:10,770 its mean by a particular value, right? 523 00:36:10,770 --> 00:36:17,980 We can express that as x_i minus its mean. 524 00:36:17,980 --> 00:36:19,318 Let's call the mean mu. 525 00:36:22,070 --> 00:36:24,440 So this would be the difference. 526 00:36:24,440 --> 00:36:29,400 Standard deviation is summing up all the differences. 527 00:36:29,400 --> 00:36:32,210 But the problem is, when you sum up the differences, it'll 528 00:36:32,210 --> 00:36:34,210 be 0, right? 529 00:36:34,210 --> 00:36:36,890 The total summation of the differences will be 0 if 530 00:36:36,890 --> 00:36:42,380 that's how you get the mean because if you expand this, 531 00:36:42,380 --> 00:36:43,760 it'll be something like this, right? 532 00:36:49,000 --> 00:36:50,250 Which will be n mu. 533 00:37:03,030 --> 00:37:05,160 Should be equal to 0. 534 00:37:05,160 --> 00:37:08,690 So we have to sum, or actually take the 535 00:37:08,690 --> 00:37:10,490 differences into account. 536 00:37:10,490 --> 00:37:12,540 So, let's square this. 537 00:37:12,540 --> 00:37:17,350 So now, it will no longer be 0. 538 00:37:17,350 --> 00:37:21,142 Now, this gives 0, the differences. 539 00:37:21,142 --> 00:37:24,330 It's the squared sum of the differences averaged across 540 00:37:24,330 --> 00:37:25,580 all the samples. 541 00:37:27,820 --> 00:37:29,315 We call this variance. 542 00:37:32,280 --> 00:37:33,370 And the square root of 543 00:37:33,370 --> 00:37:36,555 variance is standard deviation. 544 00:37:45,530 --> 00:37:47,320 OK? 545 00:37:47,320 --> 00:37:51,930 Now, having a standard deviation-- 546 00:37:54,650 --> 00:37:57,050 so we know the standard deviation tells you how spread 547 00:37:57,050 --> 00:37:59,910 the distribution is. 548 00:37:59,910 --> 00:38:04,280 But can we actually rely only on the standard deviation to 549 00:38:04,280 --> 00:38:09,230 determine the consistency of some event? 550 00:38:09,230 --> 00:38:11,390 Can we? 551 00:38:11,390 --> 00:38:12,070 Probably not. 552 00:38:12,070 --> 00:38:19,050 Suppose take two examples, one is the scores, 50. 553 00:38:19,050 --> 00:38:20,920 And suppose the standard deviation is minus 554 00:38:20,920 --> 00:38:24,270 10, plus 10, OK? 555 00:38:24,270 --> 00:38:26,290 So the standard deviation is 10 here. 556 00:38:26,290 --> 00:38:29,720 Suppose it lies in this form. 557 00:38:29,720 --> 00:38:34,420 Consider another example, the weight, the weight of the 558 00:38:34,420 --> 00:38:38,360 people, like say at MIT. 559 00:38:38,360 --> 00:38:44,850 And suppose it's centered around 150. 560 00:38:44,850 --> 00:38:50,120 Now, if the standard deviation is, say, 10, then the standard 561 00:38:50,120 --> 00:38:53,780 deviation 10 here and the standard deviation 10 here 562 00:38:53,780 --> 00:38:59,640 don't convey the same message, OK? 563 00:38:59,640 --> 00:39:07,110 So we need to have a different way of expressing the 564 00:39:07,110 --> 00:39:10,650 consistency of a distribution. 565 00:39:10,650 --> 00:39:29,110 So we represent it by coefficient of variation, 566 00:39:29,110 --> 00:39:37,690 which is equal to the standard deviation divided by mean. 567 00:39:42,810 --> 00:39:47,240 Now here, it will be 10/150. 568 00:39:47,240 --> 00:39:50,810 Here, it will be 10/50. 569 00:39:50,810 --> 00:39:55,100 So we know this is more consistent than this. 570 00:39:55,100 --> 00:40:01,110 The weights of the students at MIT, it's more consistent than 571 00:40:01,110 --> 00:40:05,215 the marks you might get, or you get, for 600. 572 00:40:05,215 --> 00:40:06,465 It might be true. 573 00:40:11,120 --> 00:40:16,530 Now, what is for the use of the standard deviation? 574 00:40:16,530 --> 00:40:17,780 How can we use that? 575 00:40:20,610 --> 00:40:28,220 Let's look at this graph where suppose the mean is 0 and the 576 00:40:28,220 --> 00:40:31,150 standard deviation is, say, 5. 577 00:40:34,370 --> 00:40:37,460 Consider another example where standard deviation is 10. 578 00:40:43,890 --> 00:40:46,510 It might have been like this, OK? 579 00:40:46,510 --> 00:40:58,680 Now, before that, let me sort of digress a little bit so I 580 00:40:58,680 --> 00:41:00,030 can explain this better. 581 00:41:03,120 --> 00:41:08,106 We can take the outcome of a particular event as a sample 582 00:41:08,106 --> 00:41:10,440 in our distribution. 583 00:41:10,440 --> 00:41:12,920 So suppose you're throwing a die. 584 00:41:12,920 --> 00:41:15,560 So you get an outcome. 585 00:41:15,560 --> 00:41:21,650 You can represent that outcome as a distribution, OK? 586 00:41:21,650 --> 00:41:29,810 So here, there's x, which can take 1 to, say, 6. 587 00:41:29,810 --> 00:41:33,450 And we can represent x_i as a sample point in our 588 00:41:33,450 --> 00:41:36,110 distribution. 589 00:41:36,110 --> 00:41:43,060 So I don't know, it might be uniform, probably, we hope. 590 00:41:43,060 --> 00:41:46,750 So it's with 1/6 probability, we always take 591 00:41:46,750 --> 00:41:47,402 one of these values. 592 00:41:47,402 --> 00:41:48,652 OK. 593 00:41:50,120 --> 00:41:53,020 But this might not be the case with all events. 594 00:41:57,250 --> 00:42:02,090 OK, so what I'm trying to say here is you can actually 595 00:42:02,090 --> 00:42:07,040 represent the outcome of the trial in the distribution. 596 00:42:07,040 --> 00:42:10,410 Or you can also represent the probability of something 597 00:42:10,410 --> 00:42:12,115 happening in a distribution. 598 00:42:15,650 --> 00:42:16,700 How does it work? 599 00:42:16,700 --> 00:42:19,840 OK, in this case, we throw our dice. 600 00:42:19,840 --> 00:42:20,930 We get an outcome. 601 00:42:20,930 --> 00:42:23,170 We go and put it in the x-axis. 602 00:42:23,170 --> 00:42:26,140 It could be between 1 and 6. 603 00:42:26,140 --> 00:42:27,575 And it takes this distribution. 604 00:42:30,220 --> 00:42:34,550 In addition, what you could do is you could 605 00:42:34,550 --> 00:42:36,780 have, say, 100 trials. 606 00:42:36,780 --> 00:42:38,810 So you throw a coin. 607 00:42:38,810 --> 00:42:40,270 You take 100 trials. 608 00:42:40,270 --> 00:42:44,570 You get the mean, you get the probability of getting a head. 609 00:42:44,570 --> 00:42:46,850 And you have that mean, right? 610 00:42:46,850 --> 00:42:49,230 So probability of getting a head for 100 611 00:42:49,230 --> 00:42:53,690 trials, say, 0.51. 612 00:42:53,690 --> 00:42:58,610 You do another 100 trials, you got another one. 613 00:42:58,610 --> 00:43:00,900 So you have now another distribution. 614 00:43:00,900 --> 00:43:03,600 So there's a distribution of probabilities. 615 00:43:03,600 --> 00:43:05,910 So you can have a distribution of probabilities, or you can 616 00:43:05,910 --> 00:43:08,600 have a distribution for the events. 617 00:43:08,600 --> 00:43:12,280 We handle these two cases in the p-set. 618 00:43:12,280 --> 00:43:16,150 So probably you should be able to distinguish those two. 619 00:43:16,150 --> 00:43:21,410 Anyway, so here in this particular example, let's take 620 00:43:21,410 --> 00:43:23,710 this as our mu. 621 00:43:23,710 --> 00:43:25,700 Let's take this as our standard deviation. 622 00:43:25,700 --> 00:43:29,090 And for the first distribution, let's take the 623 00:43:29,090 --> 00:43:30,870 standard deviation to be 5. 624 00:43:30,870 --> 00:43:32,920 When the standard deviation is great, it's 625 00:43:32,920 --> 00:43:36,130 going to be more spread. 626 00:43:36,130 --> 00:43:39,320 It's going to be more distributed than the former. 627 00:43:39,320 --> 00:43:41,960 So here, say the standard deviation is 10. 628 00:43:45,330 --> 00:43:49,200 The standard deviation is a way of expressing how many 629 00:43:49,200 --> 00:43:53,790 items, how many samples are going to lie between those 630 00:43:53,790 --> 00:43:56,610 particular boundaries. 631 00:43:56,610 --> 00:44:02,080 So for a normal distribution, we know the exact area, exact 632 00:44:02,080 --> 00:44:03,950 probability of things happening. 633 00:44:07,670 --> 00:44:12,320 If there's no mu, we know within the first standard 634 00:44:12,320 --> 00:44:26,710 deviation, there will be 68% of events lie in that area. 635 00:44:26,710 --> 00:44:28,135 Within two standard deviations-- 636 00:44:34,150 --> 00:44:39,465 OK, one standard deviation, 68%. 637 00:44:42,580 --> 00:44:45,520 Two standard deviations on either side, 638 00:44:45,520 --> 00:44:47,910 it's going to be 95%. 639 00:44:47,910 --> 00:44:53,110 Three standard deviations, it's going to be 99%. 640 00:44:53,110 --> 00:44:59,760 So suppose you conducted so many trials. 641 00:44:59,760 --> 00:45:02,260 And you get the values. 642 00:45:02,260 --> 00:45:08,500 And in the distribution, suppose mu, mean, is 10, and 643 00:45:08,500 --> 00:45:09,750 the standard deviation is, say, 1. 644 00:45:12,510 --> 00:45:19,430 So now, with 99% confidence, we can say then the outcome of 645 00:45:19,430 --> 00:45:22,710 the next trial is going to be between what? 646 00:45:26,200 --> 00:45:31,250 7 and 13, right? 647 00:45:31,250 --> 00:45:34,480 So this is where finding the distribution and standard 648 00:45:34,480 --> 00:45:40,540 deviation helps us giving a confidence interval, 649 00:45:40,540 --> 00:45:43,340 expressing our belief of that particular event happening. 650 00:45:47,050 --> 00:45:51,290 We will look at a few examples because you might need this in 651 00:45:51,290 --> 00:45:52,540 your p-set. 652 00:46:18,600 --> 00:46:20,156 So this particular function you have 653 00:46:20,156 --> 00:46:22,930 already seen in the lecture. 654 00:46:27,310 --> 00:46:31,870 But we need to understand this particular part. 655 00:46:35,160 --> 00:46:39,150 Suppose you have a probability of something happening. 656 00:46:39,150 --> 00:46:40,620 Suppose you estimated the probability 657 00:46:40,620 --> 00:46:41,300 of something happening. 658 00:46:41,300 --> 00:46:46,880 Suppose you're given the coin is biased, OK? 659 00:46:46,880 --> 00:46:47,940 Sorry, unbiased. 660 00:46:47,940 --> 00:46:51,840 So we know p of H is equal to 1/2. 661 00:46:51,840 --> 00:46:55,210 How can we simulate an outcome? 662 00:46:55,210 --> 00:46:57,740 How can you simulate an outcome and see whether it's a 663 00:46:57,740 --> 00:47:01,030 head or a tail with this particular probability? 664 00:47:01,030 --> 00:47:08,090 We do that by calling this function, random.random(), 665 00:47:08,090 --> 00:47:12,160 which is going to give you a random value between 0 and 1. 666 00:47:12,160 --> 00:47:14,160 And you're going to check whether it's 667 00:47:14,160 --> 00:47:16,300 below this or not. 668 00:47:16,300 --> 00:47:19,710 If it's below this, we can take it as head. 669 00:47:19,710 --> 00:47:21,620 If it's not, it's tail. 670 00:47:21,620 --> 00:47:25,740 And this will happen with probability 1/2, because the 671 00:47:25,740 --> 00:47:29,780 random function is going to return a value between 0 and 1 672 00:47:29,780 --> 00:47:31,180 with equal probabilities. 673 00:47:31,180 --> 00:47:34,270 It's uniform probabilities. 674 00:47:34,270 --> 00:47:37,970 So to simulate a head or tail, you call that function. 675 00:47:37,970 --> 00:47:41,930 You write the expression like that, OK? 676 00:47:48,180 --> 00:47:53,110 Then, if you consider this example, for a certain number 677 00:47:53,110 --> 00:47:56,890 of flips, we simulate the event. 678 00:47:56,890 --> 00:47:58,970 And we count the number of heads we obtain. 679 00:48:03,950 --> 00:48:06,240 And also from that, you can calculate the 680 00:48:06,240 --> 00:48:07,590 number of tails as well. 681 00:48:07,590 --> 00:48:11,580 If you know the total flips, you know the number of tails. 682 00:48:11,580 --> 00:48:14,765 Using that, we are taking two ratios. 683 00:48:14,765 --> 00:48:16,890 Now, the ratio between the heads and tails, and the 684 00:48:16,890 --> 00:48:19,690 difference between heads and tails. 685 00:48:19,690 --> 00:48:24,160 We are doing this for certain number of trials. 686 00:48:24,160 --> 00:48:27,530 And we're going to take the mean and standard deviation of 687 00:48:27,530 --> 00:48:32,220 these trials, OK? 688 00:48:32,220 --> 00:48:38,170 So here in our distribution, what are we considering? 689 00:48:42,220 --> 00:48:46,000 What is going to build our distribution here? 690 00:48:49,010 --> 00:48:50,310 The ratios, right? 691 00:48:50,310 --> 00:48:53,560 The ratios of the events. 692 00:48:53,560 --> 00:48:58,130 And we simulated certain number of trials to get those 693 00:48:58,130 --> 00:49:01,570 events, OK? 694 00:49:01,570 --> 00:49:04,470 Only if you simulate certain number of trials, you can 695 00:49:04,470 --> 00:49:08,240 actually summarize the outcome of the events in mean and 696 00:49:08,240 --> 00:49:10,530 standard deviation. 697 00:49:10,530 --> 00:49:14,480 This is exactly like the difference in the times of the 698 00:49:14,480 --> 00:49:20,350 bus arriving and the quoted times. 699 00:49:20,350 --> 00:49:23,700 Let's check this example. 700 00:49:23,700 --> 00:49:25,010 Let's plot this and see. 701 00:49:41,830 --> 00:49:43,080 It's going to take a while. 702 00:49:48,390 --> 00:49:51,590 OK, that's another thing I want to explain here because 703 00:49:51,590 --> 00:49:53,555 since you're going to be going to plot-- 704 00:49:53,555 --> 00:49:58,050 we are going to use PyLab extensively and plot graphs. 705 00:49:58,050 --> 00:50:02,090 You'll need to put a title and labels to all the plots you're 706 00:50:02,090 --> 00:50:03,040 generating. 707 00:50:03,040 --> 00:50:06,160 Plus, you can use this text to actually put 708 00:50:06,160 --> 00:50:07,190 the text in the graph. 709 00:50:07,190 --> 00:50:09,720 We will show that in a while. 710 00:50:09,720 --> 00:50:10,970 Plus-- 711 00:50:13,250 --> 00:50:14,230 here, sorry. 712 00:50:14,230 --> 00:50:19,310 If you want to change the axis to log-log scale, you can call 713 00:50:19,310 --> 00:50:24,310 this comma at the end after calling the plot. 714 00:50:24,310 --> 00:50:27,250 Because you might sometimes need to change the axis to log 715 00:50:27,250 --> 00:50:28,913 scale in x and y-axis. 716 00:50:33,930 --> 00:50:40,260 So this is the mean, heads versus tails. 717 00:50:40,260 --> 00:50:45,760 And if you can see it, the mean tends to be 1 when we 718 00:50:45,760 --> 00:50:48,870 have a large number of flips. 719 00:50:48,870 --> 00:50:52,860 So to get the consistency, we need to simulate 720 00:50:52,860 --> 00:50:55,950 large number of trials. 721 00:50:55,950 --> 00:51:00,610 Then only it will tend to be close to the mean, OK? 722 00:51:04,000 --> 00:51:07,740 This is sort of a way of checking the evolution of the 723 00:51:07,740 --> 00:51:13,540 series by actually doing it for a certain number of flips 724 00:51:13,540 --> 00:51:14,926 at every time. 725 00:51:14,926 --> 00:51:19,280 So it's quite like a scatter plot. 726 00:51:19,280 --> 00:51:27,250 A scatter plot is like plotting the outcomes of our 727 00:51:27,250 --> 00:51:28,500 experiments. 728 00:51:30,530 --> 00:51:36,230 Suppose it's x1 and x2 in a graph. 729 00:51:36,230 --> 00:51:37,420 So we are going to say-- 730 00:51:37,420 --> 00:51:42,800 so for example, suppose you have a variable, and the 731 00:51:42,800 --> 00:51:46,090 variable causes an outcome-- 732 00:51:46,090 --> 00:51:51,360 a probability of the coin flip, so p of H. And it can 733 00:51:51,360 --> 00:51:57,290 result in a certain number of heads appearing, say n of H. 734 00:51:57,290 --> 00:52:02,150 Now, you can do a scatter plot between these two variables. 735 00:52:02,150 --> 00:52:04,050 And it will be probably a spread. 736 00:52:04,050 --> 00:52:07,990 But we know that if you increase the probability of 737 00:52:07,990 --> 00:52:11,510 heads, the number of heads is going to increase as well. 738 00:52:11,510 --> 00:52:13,340 So it would be probably something like this. 739 00:52:18,320 --> 00:52:20,742 From this, we can assume that it's linear or 740 00:52:20,742 --> 00:52:21,140 something like that. 741 00:52:21,140 --> 00:52:24,660 But the scatter plot is actually representing the 742 00:52:24,660 --> 00:52:28,620 outcomes of the trial versus some other variable in the 743 00:52:28,620 --> 00:52:30,877 graph and visualize it. 744 00:52:33,560 --> 00:52:36,230 And let me show the last graph, and we'll 745 00:52:36,230 --> 00:52:37,480 be done with that. 746 00:52:52,040 --> 00:52:55,710 So this, again, we actually know, instead of putting a 747 00:52:55,710 --> 00:53:00,080 scatter plot, we're actually giving the distribution as a 748 00:53:00,080 --> 00:53:06,340 histogram and printing a text box in the graph. 749 00:53:06,340 --> 00:53:09,970 This might be useful if you want to display something on 750 00:53:09,970 --> 00:53:12,840 your graph. 751 00:53:12,840 --> 00:53:15,990 I guess we will be uploading the code to the site. 752 00:53:15,990 --> 00:53:19,080 So you can check the code if you want later, OK? 753 00:53:19,080 --> 00:53:20,510 Sure. 754 00:53:20,510 --> 00:53:21,760 See you next week.