1 00:00:01,540 --> 00:00:03,910 The following content is provided under a Creative 2 00:00:03,910 --> 00:00:05,300 Commons license. 3 00:00:05,300 --> 00:00:07,510 Your support will help MIT OpenCourseWare 4 00:00:07,510 --> 00:00:11,600 continue to offer high quality educational resources for free. 5 00:00:11,600 --> 00:00:14,140 To make a donation or to view additional materials 6 00:00:14,140 --> 00:00:18,100 from hundreds of MIT courses, visit MIT OpenCourseWare 7 00:00:18,100 --> 00:00:25,260 at ocw.mit.edu 8 00:00:25,260 --> 00:00:28,880 WILLIAM GREEN: All right, so today we're 9 00:00:28,880 --> 00:00:30,860 going to keep on working on stochastic. 10 00:00:30,860 --> 00:00:32,280 And I guess maybe we start-- 11 00:00:32,280 --> 00:00:34,840 if you guys have questions from the homework set, 12 00:00:34,840 --> 00:00:38,010 since I'm sure you're thinking about that a lot right now. 13 00:00:38,010 --> 00:00:39,284 Are there any questions? 14 00:00:43,751 --> 00:00:46,000 Should I take this to mean that you have it completely 15 00:00:46,000 --> 00:00:46,583 under control? 16 00:00:49,281 --> 00:00:49,780 That's good. 17 00:00:52,370 --> 00:00:57,330 All right-- so since we have Monte Carlo integration 18 00:00:57,330 --> 00:01:00,700 metropolis totally under control, 19 00:01:00,700 --> 00:01:06,140 let's talk about time dependent probability distributions. 20 00:01:06,140 --> 00:01:16,420 So in many situations, we'd like to predict 21 00:01:16,420 --> 00:01:18,520 what's going to happen in an experiment. 22 00:01:18,520 --> 00:01:21,210 And the fundamental equations of that experiment 23 00:01:21,210 --> 00:01:23,590 are time dependent, so we have different things happening 24 00:01:23,590 --> 00:01:24,890 at different times. 25 00:01:24,890 --> 00:01:26,980 And so we really want to know what 26 00:01:26,980 --> 00:01:33,178 d dt of the probability of some observable-- 27 00:01:37,695 --> 00:01:39,070 this is going to equal something. 28 00:01:39,070 --> 00:01:39,986 Let me fix the lights. 29 00:01:47,810 --> 00:01:51,140 All right, so we want some equation like this. 30 00:01:51,140 --> 00:01:55,430 And then when you actually made your measurement, 31 00:01:55,430 --> 00:01:57,622 you'd be sampling from P. 32 00:01:57,622 --> 00:01:59,613 So probability of the observables-- 33 00:02:02,930 --> 00:02:06,250 and so if you made the measurement, 34 00:02:06,250 --> 00:02:08,750 you'd have a certain probability that you observe something. 35 00:02:08,750 --> 00:02:10,291 And you made a different measurement, 36 00:02:10,291 --> 00:02:12,680 you'd have same probability if you made the measurement 37 00:02:12,680 --> 00:02:13,360 at this time. 38 00:02:13,360 --> 00:02:17,270 So this is going to be probability of the observable 39 00:02:17,270 --> 00:02:18,580 depending on the time. 40 00:02:18,580 --> 00:02:20,790 And you made the measurements at different times. 41 00:02:20,790 --> 00:02:22,414 So let's conceptually think about this. 42 00:02:22,414 --> 00:02:24,560 Suppose we had a box. 43 00:02:24,560 --> 00:02:28,130 And it had a uranium atom in it that's radioactive. 44 00:02:28,130 --> 00:02:30,390 And it can decay. 45 00:02:30,390 --> 00:02:31,640 So we look in the box. 46 00:02:31,640 --> 00:02:33,650 And at time zero, I look in there. 47 00:02:33,650 --> 00:02:36,267 And there's the uranium atom sitting there nicely. 48 00:02:36,267 --> 00:02:37,350 And I go away for a while. 49 00:02:37,350 --> 00:02:37,850 They come back. 50 00:02:37,850 --> 00:02:38,641 And I open the box. 51 00:02:38,641 --> 00:02:39,742 And I look again later. 52 00:02:39,742 --> 00:02:42,200 And there's some probability that the uranium atom is still 53 00:02:42,200 --> 00:02:42,860 there. 54 00:02:42,860 --> 00:02:44,360 And there's some probability that it 55 00:02:44,360 --> 00:02:47,930 fissioned during the time and it's gone, right? 56 00:02:47,930 --> 00:02:50,360 OK so there must be some kind of equation 57 00:02:50,360 --> 00:02:53,390 like this, how the probability that the uranium atom 58 00:02:53,390 --> 00:02:56,150 is still there in the box. 59 00:02:56,150 --> 00:02:57,550 Right, is this OK-- 60 00:02:57,550 --> 00:02:58,050 yeah? 61 00:03:01,130 --> 00:03:03,725 So just for that case, what do we think the probability-- 62 00:03:03,725 --> 00:03:05,902 how does that probably behave-- 63 00:03:05,902 --> 00:03:06,520 any ideas? 64 00:03:13,100 --> 00:03:15,820 So uranium has a half-life or something, right? 65 00:03:15,820 --> 00:03:18,080 You guys heard this before, right? 66 00:03:18,080 --> 00:03:21,149 So let's just try to think of how this should scale. 67 00:03:21,149 --> 00:03:23,190 Whatever it is, it probably should have something 68 00:03:23,190 --> 00:03:28,320 to do with a time constant for how fast uranium decays, yeah? 69 00:03:31,815 --> 00:03:33,690 You guys are looking at me, like, so blankly. 70 00:03:33,690 --> 00:03:34,255 This is not that hard. 71 00:03:34,255 --> 00:03:35,379 It's just one uranium atom. 72 00:03:35,379 --> 00:03:37,150 It's OK. 73 00:03:37,150 --> 00:03:40,270 All right, so let's just write a plausible equation. 74 00:03:40,270 --> 00:03:43,780 Maybe it's dP dt, where this is the probability 75 00:03:43,780 --> 00:03:46,130 that the uranium is in the box. 76 00:03:50,020 --> 00:03:51,983 This might be the probability divided by two. 77 00:03:51,983 --> 00:03:54,130 Something like that-- would that be-- 78 00:03:54,130 --> 00:03:57,440 all right, I guess we need a negative sign maybe. 79 00:03:57,440 --> 00:03:59,890 So then the probability-- the solution to this 80 00:03:59,890 --> 00:04:03,850 would be that the probability that uranium is still there 81 00:04:03,850 --> 00:04:07,106 is going to be equal to some initial probability e 82 00:04:07,106 --> 00:04:10,816 to the negative time over tau. 83 00:04:10,816 --> 00:04:12,229 Does that look right? 84 00:04:15,060 --> 00:04:16,899 Does this look very reasonable? 85 00:04:16,899 --> 00:04:19,542 You might have seen this before, yeah? 86 00:04:19,542 --> 00:04:21,250 Maybe you didn't think of it probability. 87 00:04:21,250 --> 00:04:23,890 Maybe you thought about it as number of uraniums in the box. 88 00:04:23,890 --> 00:04:27,620 If I had written it as the number of uraniums 89 00:04:27,620 --> 00:04:30,890 is equal to the original number of uraniums e 90 00:04:30,890 --> 00:04:32,699 to the negative t over tau, you guys 91 00:04:32,699 --> 00:04:34,490 would have believed that right away, right? 92 00:04:38,400 --> 00:04:42,470 OK, so I guess maybe this is highlighting a issue here, 93 00:04:42,470 --> 00:04:44,810 is that we use a macroscopic thinking. 94 00:04:44,810 --> 00:04:48,099 We're used to thinking of things as continuum, right? 95 00:04:48,099 --> 00:04:50,390 But if I only have one uranium there, it's either there 96 00:04:50,390 --> 00:04:51,290 or it's not there. 97 00:04:51,290 --> 00:04:54,010 It's 1 or 0. 98 00:04:54,010 --> 00:04:56,740 So the problem with this equation-- 99 00:04:56,740 --> 00:05:02,660 if you compute this, it computes irrational numbers, 100 00:05:02,660 --> 00:05:05,087 fractional numbers as the number of uraniums. 101 00:05:05,087 --> 00:05:06,670 But of course, the number of uraniums, 102 00:05:06,670 --> 00:05:08,336 it's just either-- it's integers, right? 103 00:05:08,336 --> 00:05:11,320 There's one uranium atom, or there's two, or there's three. 104 00:05:11,320 --> 00:05:13,290 So this equation is not right, right? 105 00:05:13,290 --> 00:05:15,394 So this is incorrect. 106 00:05:15,394 --> 00:05:17,560 So that was what you learned in high school, right-- 107 00:05:17,560 --> 00:05:18,890 that equation? 108 00:05:18,890 --> 00:05:20,410 But that's not right. 109 00:05:20,410 --> 00:05:23,800 So this is really the correct equation, that the probability, 110 00:05:23,800 --> 00:05:26,350 that you have some number of uraniums that does something. 111 00:05:26,350 --> 00:05:28,410 You know-- well this works for one atom, anyway. 112 00:05:31,780 --> 00:05:34,120 So that's the equation for one. 113 00:05:34,120 --> 00:05:36,852 So this is probability I have one uranium. 114 00:05:36,852 --> 00:05:38,560 It's the initial probability that there's 115 00:05:38,560 --> 00:05:40,310 one uranium in a box, which is basically-- 116 00:05:40,310 --> 00:05:41,365 my case would be one. 117 00:05:41,365 --> 00:05:42,580 I know I put one in there. 118 00:05:45,250 --> 00:05:46,720 And then it just decays. 119 00:05:46,720 --> 00:05:48,862 The probability decays. 120 00:05:48,862 --> 00:05:50,320 But it doesn't mean uranium decays. 121 00:05:50,320 --> 00:05:53,095 So it means when I do-- if I do the experiment once, 122 00:05:53,095 --> 00:05:58,940 and here I have the uranium-- 123 00:05:58,940 --> 00:06:02,620 the probability of the uranium is a simple exponential decay-- 124 00:06:02,620 --> 00:06:04,420 time. 125 00:06:04,420 --> 00:06:05,830 I know I had a uranium atom there 126 00:06:05,830 --> 00:06:07,360 when I first put it there. 127 00:06:07,360 --> 00:06:09,826 And at later times it's gone away, 128 00:06:09,826 --> 00:06:11,492 right? 'Cause at longer and longer times 129 00:06:11,492 --> 00:06:13,370 it's more and more likely it would have fissioned. 130 00:06:13,370 --> 00:06:13,870 They 131 00:06:13,870 --> 00:06:15,640 Now if I actually do this. 132 00:06:15,640 --> 00:06:17,590 And make a-- buy a million boxes. 133 00:06:17,590 --> 00:06:19,265 And put a million uranium atoms-- one 134 00:06:19,265 --> 00:06:21,549 in each one to start with. 135 00:06:21,549 --> 00:06:23,090 And then I just keep coming back once 136 00:06:23,090 --> 00:06:26,320 in a while and checking, what I'll see, 137 00:06:26,320 --> 00:06:29,520 is that initially I had-- 138 00:06:29,520 --> 00:06:32,490 here's the number of uraniums. 139 00:06:32,490 --> 00:06:36,550 Initially I had a million uranium atoms. 140 00:06:36,550 --> 00:06:39,419 And for some time period I still had a million. 141 00:06:39,419 --> 00:06:41,210 And then something happened and one of them 142 00:06:41,210 --> 00:06:45,360 went away, because one of the fissioned, turned into lead-- 143 00:06:45,360 --> 00:06:47,570 or whatever they turn into. 144 00:06:47,570 --> 00:06:52,240 All right, and so now I had a million minus one uraniums. 145 00:06:52,240 --> 00:06:53,690 They live for a while. 146 00:06:53,690 --> 00:06:56,380 And then maybe another one went away. 147 00:06:56,380 --> 00:06:58,100 And then this time, another went away. 148 00:06:58,100 --> 00:07:00,830 And that time it lasted longer-- 149 00:07:00,830 --> 00:07:01,610 right? 150 00:07:01,610 --> 00:07:04,080 This is what you really expect to observe. 151 00:07:04,080 --> 00:07:06,350 Is this OK? 152 00:07:06,350 --> 00:07:13,536 And so this is sampling from the probability distribution 153 00:07:13,536 --> 00:07:14,400 that you would use. 154 00:07:14,400 --> 00:07:16,500 Does that make sense? 155 00:07:16,500 --> 00:07:19,620 So I'm sampling a million times, so I have a million boxes. 156 00:07:19,620 --> 00:07:22,550 This is the probability distribution for one box. 157 00:07:22,550 --> 00:07:25,550 And so I'm able to figure this out. 158 00:07:25,550 --> 00:07:26,300 Is this OK? 159 00:07:30,240 --> 00:07:34,050 All right, so we'd like to write equations like this 160 00:07:34,050 --> 00:07:37,187 for more complicated systems. 161 00:07:37,187 --> 00:07:39,270 But you'll still going to have the same confusion, 162 00:07:39,270 --> 00:07:41,869 that the probability is going to be continuous variable. 163 00:07:41,869 --> 00:07:43,410 And it's going to behave in ways that 164 00:07:43,410 --> 00:07:45,300 seem perfectly sensible to you. 165 00:07:45,300 --> 00:07:47,479 But then every time you do the experiment, 166 00:07:47,479 --> 00:07:49,020 different things will happen in time. 167 00:07:49,020 --> 00:07:51,660 Because you have something at the time-varying probability, 168 00:07:51,660 --> 00:07:53,700 and each time you sample from the probability distribution-- 169 00:07:53,700 --> 00:07:55,074 every time you do the experiment, 170 00:07:55,074 --> 00:07:57,780 it's like a particular instance of sampling 171 00:07:57,780 --> 00:07:59,250 from that probability distribution. 172 00:07:59,250 --> 00:08:03,705 And you might get that there is 87 uranium atoms left. 173 00:08:03,705 --> 00:08:06,470 And you might get that there's 93. 174 00:08:06,470 --> 00:08:09,030 And it's not because of your measurement error. 175 00:08:09,030 --> 00:08:13,320 It's because the intrinsic system has its own randomness 176 00:08:13,320 --> 00:08:14,304 to it, right? 177 00:08:14,304 --> 00:08:15,970 You know, you look at one uranium atom-- 178 00:08:15,970 --> 00:08:18,020 some uranium atoms live for a million years. 179 00:08:18,020 --> 00:08:21,130 And some uranium atoms might decay in the next second, 180 00:08:21,130 --> 00:08:21,630 right? 181 00:08:21,630 --> 00:08:23,780 And you have no idea when they're going to decay. 182 00:08:23,780 --> 00:08:27,560 All you know is statistically, on the average, uraniums decay 183 00:08:27,560 --> 00:08:30,410 with a certain half-life, which is pretty long, right? 184 00:08:33,692 --> 00:08:35,150 All right, is this totally obvious? 185 00:08:35,150 --> 00:08:36,066 I can't figure it out. 186 00:08:36,066 --> 00:08:38,559 Is this, like, totally obvious, or totally confusing? 187 00:08:38,559 --> 00:08:40,809 It's very funny-- with your eyes and your expressions, 188 00:08:40,809 --> 00:08:42,517 totally obvious and totally confusing has 189 00:08:42,517 --> 00:08:43,660 the same blank expression. 190 00:08:47,100 --> 00:08:48,290 Can someone ask a question. 191 00:08:48,290 --> 00:08:52,130 Maybe that would help us to have a-- 192 00:08:52,130 --> 00:08:52,967 this is OK? 193 00:08:52,967 --> 00:08:54,050 All right, this is the OK. 194 00:08:54,050 --> 00:08:54,400 AUDIENCE: It's OK. 195 00:08:54,400 --> 00:08:55,100 WILLIAM GREEN: This is OK. 196 00:08:55,100 --> 00:08:56,600 All right, so it's totally obvious-- 197 00:08:56,600 --> 00:08:58,700 good, hard to tell sometimes. 198 00:08:58,700 --> 00:09:03,080 All right, so Joe Scott wrote some brilliant notes trying 199 00:09:03,080 --> 00:09:05,122 to explain how do this for chemical kinetics, OK? 200 00:09:05,122 --> 00:09:06,579 So you should definitely read them. 201 00:09:06,579 --> 00:09:08,810 They're in the-- posted under the materials, 202 00:09:08,810 --> 00:09:10,530 general section-- 203 00:09:10,530 --> 00:09:13,610 Stochastic Chemical Kinetics-- nice 20 page long thing, 204 00:09:13,610 --> 00:09:14,810 something like that. 205 00:09:14,810 --> 00:09:16,690 It's definitely worthwhile to read it. 206 00:09:16,690 --> 00:09:19,670 He was very nice at writing very clear notes. 207 00:09:19,670 --> 00:09:23,180 So I'll try to explain his notes inexpertly, 208 00:09:23,180 --> 00:09:24,440 in a short period of time. 209 00:09:24,440 --> 00:09:26,160 I strongly recommend you read them. 210 00:09:26,160 --> 00:09:32,140 So the idea is that the chemical kinetic equations 211 00:09:32,140 --> 00:09:35,390 you guys have all used are also incorrect, 212 00:09:35,390 --> 00:09:36,950 right-- just like this is incorrect. 213 00:09:39,860 --> 00:09:42,260 Because this is assuming that something that's 214 00:09:42,260 --> 00:09:45,470 really a discrete variable is a continuous variable. 215 00:09:45,470 --> 00:09:47,450 And we do this all the time, right? 216 00:09:47,450 --> 00:09:50,470 We know that material is made of atoms. 217 00:09:50,470 --> 00:09:54,110 And so when you measure our mass in a certain volume, 218 00:09:54,110 --> 00:09:57,180 there only can be certain discrete values. 219 00:09:57,180 --> 00:09:58,470 But we always ignore that. 220 00:09:58,470 --> 00:10:01,020 And we always treat is a continuous variable, right? 221 00:10:01,020 --> 00:10:02,070 So you have some flow-- 222 00:10:02,070 --> 00:10:03,665 some amount of liquid-- 223 00:10:03,665 --> 00:10:05,040 and you have some amount of mass. 224 00:10:05,040 --> 00:10:06,570 And it could be any number. 225 00:10:06,570 --> 00:10:11,935 And we treat dm dt, or things like dm dx, d rho dx-- 226 00:10:11,935 --> 00:10:13,560 we write those down as if everything is 227 00:10:13,560 --> 00:10:15,400 perfectly continuous variables. 228 00:10:15,400 --> 00:10:18,000 And that's because that in a lot of systems we have, 229 00:10:18,000 --> 00:10:20,880 we have so many atoms-- 230 00:10:20,880 --> 00:10:22,830 and we can't measure that well anyway-- 231 00:10:22,830 --> 00:10:25,680 that we couldn't tell if we were missing one or two atoms. 232 00:10:25,680 --> 00:10:28,890 Whether we end up with an extra half an atom in our equations 233 00:10:28,890 --> 00:10:31,421 or not makes no difference, because we're not that precise, 234 00:10:31,421 --> 00:10:31,920 right? 235 00:10:31,920 --> 00:10:33,045 So we don't worry about it. 236 00:10:33,045 --> 00:10:35,720 So we use contiuum equations everywhere and-- 237 00:10:35,720 --> 00:10:38,930 but in many cases, what we really should be using 238 00:10:38,930 --> 00:10:42,490 are continuous equations for probabilities. 239 00:10:42,490 --> 00:10:45,070 And then as going to show you how you do it for chemical 240 00:10:45,070 --> 00:10:46,380 kinetics in a minute. 241 00:10:46,380 --> 00:10:48,460 I'd say that this is super fundamental, actually. 242 00:10:48,460 --> 00:10:51,850 So quantum mechanics says that everything 243 00:10:51,850 --> 00:10:54,370 is wave functions, which is actually 244 00:10:54,370 --> 00:10:57,260 like the square root of a probability density. 245 00:10:57,260 --> 00:11:02,150 And the real equations are really probability densities. 246 00:11:02,150 --> 00:11:04,940 And so that's the real fundamental equations. 247 00:11:04,940 --> 00:11:06,441 Really, everything is probabilities. 248 00:11:06,441 --> 00:11:08,065 And when you make an experiment, you're 249 00:11:08,065 --> 00:11:09,530 just sampling from the probability. 250 00:11:09,530 --> 00:11:12,800 And all our continuum equations are like approximations. 251 00:11:12,800 --> 00:11:19,150 They're only valid in, like, the large number of atoms limit, 252 00:11:19,150 --> 00:11:21,720 OK? 253 00:11:21,720 --> 00:11:24,055 I know this takes maybe a change of thought, 254 00:11:24,055 --> 00:11:26,180 because you're so used to those continuum equations 255 00:11:26,180 --> 00:11:29,370 you start to believe they're really true, right? 256 00:11:29,370 --> 00:11:31,010 You've probably used them a lot. 257 00:11:31,010 --> 00:11:33,176 And you start to feel like you love those equations. 258 00:11:33,176 --> 00:11:34,550 They're your favorite equations. 259 00:11:34,550 --> 00:11:36,170 You know, you have a relationship with them. 260 00:11:36,170 --> 00:11:37,880 Some of them you might hate, some you love. 261 00:11:37,880 --> 00:11:40,130 But at least, you have a strong connection with them. 262 00:11:40,130 --> 00:11:41,660 And you just find out that actually they're 263 00:11:41,660 --> 00:11:43,090 not even related to the real equations. 264 00:11:43,090 --> 00:11:45,256 The real equations are actually something different. 265 00:11:45,256 --> 00:11:47,924 This can be very annoying, but it's true. 266 00:11:47,924 --> 00:11:50,090 And when you get to smaller and smaller systems that 267 00:11:50,090 --> 00:11:52,801 have fewer and fewer molecules in them, 268 00:11:52,801 --> 00:11:54,800 then you get more and more sensitive to the fact 269 00:11:54,800 --> 00:11:57,240 that the regular equations are incorrect. 270 00:11:57,240 --> 00:12:00,880 And this comes up a lot in small systems. 271 00:12:00,880 --> 00:12:02,810 So many of you probably will do research 272 00:12:02,810 --> 00:12:05,560 that has to do with biology. 273 00:12:05,560 --> 00:12:07,040 In biology there's cells. 274 00:12:07,040 --> 00:12:09,830 Inside cells there's subcellular structures. 275 00:12:09,830 --> 00:12:11,720 Inside those subcellular structures, 276 00:12:11,720 --> 00:12:13,950 there's not very many molecules. 277 00:12:13,950 --> 00:12:17,660 And so you often are at the limit where you have, like, 278 00:12:17,660 --> 00:12:20,780 one molecule of a certain type inside this mitochondria, 279 00:12:20,780 --> 00:12:21,940 or something. 280 00:12:21,940 --> 00:12:23,390 And that's it. 281 00:12:23,390 --> 00:12:27,440 And so you wouldn't expect the continuum equations to work. 282 00:12:27,440 --> 00:12:29,330 And in fact there's a big field-- 283 00:12:29,330 --> 00:12:31,130 many people at research do in here-- 284 00:12:31,130 --> 00:12:33,230 called single molecule spectroscopy, 285 00:12:33,230 --> 00:12:36,040 where you can measure the motion of one DNA molecule 286 00:12:36,040 --> 00:12:37,115 or something like that. 287 00:12:37,115 --> 00:12:41,870 And so you really see the individual molecules, 288 00:12:41,870 --> 00:12:46,610 and the effects of the individuality of the molecules. 289 00:12:46,610 --> 00:12:48,995 And this is not only true in biology. 290 00:12:51,356 --> 00:12:52,730 For a long time-- there's a field 291 00:12:52,730 --> 00:12:55,040 called emulsion polymerization. 292 00:12:55,040 --> 00:12:56,380 You guys ever hear of this? 293 00:12:56,380 --> 00:12:57,838 So like, all the paint on the walls 294 00:12:57,838 --> 00:13:00,259 here is made by that process, where they 295 00:13:00,259 --> 00:13:01,550 polymerize methyl methacrylate. 296 00:13:01,550 --> 00:13:04,070 They want to make the little beads of polymers 297 00:13:04,070 --> 00:13:07,900 all have a small dispersion as possible, 298 00:13:07,900 --> 00:13:10,160 to make all the molecules the same. 299 00:13:10,160 --> 00:13:12,430 So what they do is they make a colloidal suspension-- 300 00:13:12,430 --> 00:13:14,050 I'm going to draw a little picture. 301 00:13:14,050 --> 00:13:15,890 So they have the reactor. 302 00:13:15,890 --> 00:13:20,570 They make little bubbles of the monomer that 303 00:13:20,570 --> 00:13:22,920 are suspended in some solid. 304 00:13:22,920 --> 00:13:24,840 And inside each of these bubbles-- 305 00:13:24,840 --> 00:13:26,465 because the way they make them, they're 306 00:13:26,465 --> 00:13:27,504 all about the same size. 307 00:13:27,504 --> 00:13:28,920 So they all have a lot of bubbles, 308 00:13:28,920 --> 00:13:30,000 all about the same size. 309 00:13:30,000 --> 00:13:31,565 And then they polymerize. 310 00:13:31,565 --> 00:13:32,940 And they polymerize each of them. 311 00:13:32,940 --> 00:13:33,870 And they polymerize. 312 00:13:33,870 --> 00:13:35,703 And basically, all the material that's there 313 00:13:35,703 --> 00:13:38,100 polymerizes into one molecule. 314 00:13:38,100 --> 00:13:40,440 Now how do they make that happen-- 315 00:13:40,440 --> 00:13:43,800 is that they introduce, say, a free radical. 316 00:13:43,800 --> 00:13:47,160 And one free radical gets into one of these bubbles. 317 00:13:47,160 --> 00:13:48,960 And it can polymerize the whole thing, 318 00:13:48,960 --> 00:13:50,700 because the reactions are a radical plus 319 00:13:50,700 --> 00:13:54,840 monomer goes to a polymer-- 320 00:13:54,840 --> 00:13:55,860 bigger polymer, right? 321 00:13:55,860 --> 00:14:01,610 So polymer radical size n goes to polymer 322 00:14:01,610 --> 00:14:03,400 radical size n plus 1. 323 00:14:03,400 --> 00:14:06,020 That's the polymerization reaction. 324 00:14:06,020 --> 00:14:08,910 Now normally, if you did this in the bulk, 325 00:14:08,910 --> 00:14:11,110 there would be a lot of radicals. 326 00:14:11,110 --> 00:14:16,420 And some of these guys would react with each other. 327 00:14:19,430 --> 00:14:21,930 And the radical will be gone, because the two radicals would 328 00:14:21,930 --> 00:14:25,720 react, make a new chemical bond, and this process would stop. 329 00:14:25,720 --> 00:14:29,110 And so this gives a big dispersion in the size 330 00:14:29,110 --> 00:14:30,950 of the polymer chains you get. 331 00:14:30,950 --> 00:14:33,550 So to beat this, they do emulsion polymerization. 332 00:14:33,550 --> 00:14:35,890 And they make that number of radicals so small 333 00:14:35,890 --> 00:14:38,740 that statistically, at any time, any of these droplets 334 00:14:38,740 --> 00:14:42,930 either has zero or one of radicals in it. 335 00:14:42,930 --> 00:14:45,470 And there's not-- during the time 336 00:14:45,470 --> 00:14:47,690 it does the polymerization, there's not enough time 337 00:14:47,690 --> 00:14:49,114 for a second radical to come in. 338 00:14:49,114 --> 00:14:51,155 So it's only got one radical, so that one radical 339 00:14:51,155 --> 00:14:52,779 is going to eat up every single monomer 340 00:14:52,779 --> 00:14:54,524 molecule in the whole thing. 341 00:14:54,524 --> 00:14:56,440 And so it's going take a giant polymer, that's 342 00:14:56,440 --> 00:14:59,370 a whole size of the emulsion. 343 00:14:59,370 --> 00:15:02,642 If you made the drops too big, you get two radicals in there. 344 00:15:02,642 --> 00:15:04,100 And you get some of this happening. 345 00:15:04,100 --> 00:15:05,760 And then you get a dispersion. 346 00:15:05,760 --> 00:15:09,670 So this is emulsion polymerization. 347 00:15:14,080 --> 00:15:18,320 All right, so cells have small little volumes. 348 00:15:18,320 --> 00:15:21,110 Colloids and emulsions have small little volumes. 349 00:15:21,110 --> 00:15:22,790 They all have-- that the-- 350 00:15:22,790 --> 00:15:26,697 some of the molecules-- the important molecules are so-- 351 00:15:26,697 --> 00:15:29,030 have such low concentrations-- the volumes are so small, 352 00:15:29,030 --> 00:15:31,850 that the concentration times the volume is less than 1, 353 00:15:31,850 --> 00:15:33,290 or about 1. 354 00:15:33,290 --> 00:15:37,370 So that's for like-- you know, your copies of DNA in you, 355 00:15:37,370 --> 00:15:38,550 in your cells. 356 00:15:38,550 --> 00:15:42,800 It's the same kind of thing for radicals-- free radicals 357 00:15:42,800 --> 00:15:44,570 in a polymerization system. 358 00:15:44,570 --> 00:15:47,194 And similar things could happen with, like, explosions-- 359 00:15:47,194 --> 00:15:48,860 different kinds of rare events, that you 360 00:15:48,860 --> 00:15:50,734 might have a very small number of some really 361 00:15:50,734 --> 00:15:52,010 important molecule. 362 00:15:52,010 --> 00:15:53,900 And then whether or not you have one or not 363 00:15:53,900 --> 00:15:57,390 is really important, OK. 364 00:15:57,390 --> 00:16:00,490 All right, so we want to model those kinds of systems, 365 00:16:00,490 --> 00:16:02,370 we have to worry about the graininess. 366 00:16:02,370 --> 00:16:04,665 So we want to write down what the equation is dP dt. 367 00:16:08,240 --> 00:16:12,050 So first you've got to think, well what is P? 368 00:16:12,050 --> 00:16:19,625 Let's do a case where I have the reaction of A plus B 369 00:16:19,625 --> 00:16:21,717 goes to C, OK? 370 00:16:21,717 --> 00:16:23,300 Suppose this is the only reaction that 371 00:16:23,300 --> 00:16:24,500 can happen in our system. 372 00:16:24,500 --> 00:16:26,333 The only molecules we have in our system are 373 00:16:26,333 --> 00:16:27,640 A's, B's, and C's. 374 00:16:27,640 --> 00:16:29,630 And so our probability distribution-- 375 00:16:29,630 --> 00:16:31,130 our probability that we want to know 376 00:16:31,130 --> 00:16:34,170 is how many A's, how many B's, how many C's do 377 00:16:34,170 --> 00:16:38,664 we have in our system, OK? 378 00:16:38,664 --> 00:16:41,940 So that's the probability we're interested to know. 379 00:16:41,940 --> 00:16:45,210 We could have 5 A's, 2 B's, and 0 C's. 380 00:16:45,210 --> 00:16:49,720 We could have 3 A's, 7 B's, 11 C's-- who knows, right-- 381 00:16:49,720 --> 00:16:51,020 different numbers like that. 382 00:16:51,020 --> 00:16:53,396 If it gets out to be 10 to the 23, then there's no point. 383 00:16:53,396 --> 00:16:55,353 You don't have to do this, because you can just 384 00:16:55,353 --> 00:16:57,420 go back your continuum equations, right? 385 00:16:57,420 --> 00:17:00,450 But if you have 5, or 3, or 2, or 1, or 0, 386 00:17:00,450 --> 00:17:03,390 then you really need to worry about the graininess. 387 00:17:03,390 --> 00:17:07,190 So you want to write down an equation. 388 00:17:07,190 --> 00:17:13,819 So here's a probability of n A n B n C. 389 00:17:13,819 --> 00:17:20,214 And it's going to equal to reactions which consume-- 390 00:17:20,214 --> 00:17:22,130 if I'm in this state that has a certain number 391 00:17:22,130 --> 00:17:25,670 A's, B's, and C's, and I can react away, 392 00:17:25,670 --> 00:17:27,440 so I only have reactions-- 393 00:17:27,440 --> 00:17:29,090 for example, I'm in this state. 394 00:17:29,090 --> 00:17:32,020 An d plus B could react with each other, 395 00:17:32,020 --> 00:17:33,620 and will react away. 396 00:17:33,620 --> 00:17:35,316 So I'll have some reaction. 397 00:17:35,316 --> 00:17:36,690 I'm going to write a k, but we'll 398 00:17:36,690 --> 00:17:39,780 come back to what this really means exactly in a minute. 399 00:17:39,780 --> 00:17:46,040 So this is the k for A plus B going to C. 400 00:17:46,040 --> 00:17:47,840 And we think that this is going to scale 401 00:17:47,840 --> 00:17:53,370 with the number of A's and the number of B's I've got, right? 402 00:17:53,370 --> 00:18:01,670 And this depends on the probability that I have A B C. 403 00:18:01,670 --> 00:18:08,310 So if I'm in this state with n A's n B's n C's-- 404 00:18:08,310 --> 00:18:09,970 that probability is going to go down, 405 00:18:09,970 --> 00:18:14,330 because the A's and B's can react with each other, right? 406 00:18:14,330 --> 00:18:18,900 Now on the other hand, I have plus the same k. 407 00:18:22,790 --> 00:18:26,460 And this is going to be n A prime n B prime. 408 00:18:35,890 --> 00:18:40,630 If I have some other state that can react so that it makes 409 00:18:40,630 --> 00:18:42,730 this state, then I'll get a plus sign, 410 00:18:42,730 --> 00:18:44,990 because probability of this state would increase. 411 00:18:44,990 --> 00:18:52,700 So for example, if n A prime is equal to n A plus 1. 412 00:18:52,700 --> 00:18:57,450 And n B prime is equal to n B plus 1 413 00:18:57,450 --> 00:19:02,720 and n C prime is equal to n C minus 1, 414 00:19:02,720 --> 00:19:06,370 then that state can react by one of these A's and one 415 00:19:06,370 --> 00:19:09,220 of these B's combining together to make a C. That will get me 416 00:19:09,220 --> 00:19:11,850 to this exact state here. 417 00:19:11,850 --> 00:19:14,710 Does this make sense? 418 00:19:14,710 --> 00:19:19,294 All Right, so that's the master equation 419 00:19:19,294 --> 00:19:20,710 if I have a system that could only 420 00:19:20,710 --> 00:19:25,860 do the irreversible reaction A plus B goes to C. So the only-- 421 00:19:25,860 --> 00:19:28,120 I can go away-- because the probability density 422 00:19:28,120 --> 00:19:30,520 of this-- the probability that this state can reduce, 423 00:19:30,520 --> 00:19:33,310 because that reaction occurs starting from this state. 424 00:19:33,310 --> 00:19:35,620 And probability this state can increase, 425 00:19:35,620 --> 00:19:37,680 because I started from this other state here-- 426 00:19:37,680 --> 00:19:39,040 this special state here. 427 00:19:39,040 --> 00:19:42,230 And that would make the state interest. 428 00:19:42,230 --> 00:19:45,020 All right and so I have equation-- this equation 429 00:19:45,020 --> 00:19:47,750 over and over again, for every possible value of n A, n B, 430 00:19:47,750 --> 00:19:50,140 n C. Is this OK? 431 00:19:52,890 --> 00:19:55,200 Now I have to actually-- 432 00:19:55,200 --> 00:19:58,000 remember for chemical kinetics, that whenever 433 00:19:58,000 --> 00:20:01,990 you have a forward reaction, you also have the reverse reaction. 434 00:20:01,990 --> 00:20:05,800 So there's actually a couple more terms. 435 00:20:05,800 --> 00:20:08,010 So now I have another loss term. 436 00:20:08,010 --> 00:20:12,180 This is C goes to A plus B. This is going to tell of the number 437 00:20:12,180 --> 00:20:13,920 of C's. 438 00:20:13,920 --> 00:20:20,100 And that's P of n A n B n C. And then 439 00:20:20,100 --> 00:20:21,470 I have another source term. 440 00:20:28,210 --> 00:20:31,130 And this is where I start from the state with one more 441 00:20:31,130 --> 00:20:50,360 C. Is that OK? 442 00:20:50,360 --> 00:20:55,370 So this set of equations is called the kinetic master 443 00:20:55,370 --> 00:20:57,410 equation. 444 00:20:57,410 --> 00:21:00,750 And this is the equation that describes the real system. 445 00:21:00,750 --> 00:21:04,490 So this is the real probability of finding the system with any 446 00:21:04,490 --> 00:21:07,350 number of A's, B's, and C's. 447 00:21:07,350 --> 00:21:10,560 And I have an equation like this for every different possible 448 00:21:10,560 --> 00:21:14,630 number of A's, number of B's, number of C's. 449 00:21:14,630 --> 00:21:17,360 All right? 450 00:21:17,360 --> 00:21:20,350 And it's not bad as an equation goes. 451 00:21:20,350 --> 00:21:22,840 It's a linear differential equation, 452 00:21:22,840 --> 00:21:25,090 because it's linear in P's, right? 453 00:21:25,090 --> 00:21:29,140 There's just first-- everything's first power in P. 454 00:21:29,140 --> 00:21:38,950 So in general, I can rewrite this as dP dt is the some 455 00:21:38,950 --> 00:21:45,730 matrix times B. And the matrix entries are these prefactors-- 456 00:21:45,730 --> 00:21:48,910 things like this and this-- 457 00:21:48,910 --> 00:21:52,550 sorry, this, this. 458 00:21:52,550 --> 00:21:54,750 These are the different elements in the matrix, m. 459 00:22:00,790 --> 00:22:06,790 So you should go ahead and be able to write 460 00:22:06,790 --> 00:22:09,900 any kinetic equation system-- rewrite it in this form 461 00:22:09,900 --> 00:22:11,040 if you want. 462 00:22:11,040 --> 00:22:12,740 It's called the kinetic master equation. 463 00:22:23,751 --> 00:22:25,560 Now if I do an experiment like I talked 464 00:22:25,560 --> 00:22:28,980 about with uranium, where I put one uranium atom in there. 465 00:22:28,980 --> 00:22:30,700 And all uranium atoms can react to do 466 00:22:30,700 --> 00:22:32,650 is fall apart to lead plus neutrons, 467 00:22:32,650 --> 00:22:34,382 or whatever the heck they fall apart to. 468 00:22:34,382 --> 00:22:36,340 So I can write down-- there's like one reaction 469 00:22:36,340 --> 00:22:38,470 that uranium nuclei do. 470 00:22:38,470 --> 00:22:39,630 And so I can write it out. 471 00:22:39,630 --> 00:22:41,880 It will just be something like this. 472 00:22:41,880 --> 00:22:43,714 And this equation will work for a case 473 00:22:43,714 --> 00:22:45,880 where I put one uranium atom in there to begin with. 474 00:22:45,880 --> 00:22:48,296 I could do the case where I put two uranium atoms in there 475 00:22:48,296 --> 00:22:49,360 to begin with. 476 00:22:49,360 --> 00:22:50,605 I could write this down. 477 00:22:50,605 --> 00:22:52,720 Is that all right? 478 00:22:52,720 --> 00:23:02,230 OK, now if I had a case where I had 27 A's, 14 B's, and 33 C's 479 00:23:02,230 --> 00:23:05,230 to start with, then you can see that the number 480 00:23:05,230 --> 00:23:08,490 of possibilities here might get pretty large. 481 00:23:08,490 --> 00:23:11,140 'Cause I have to consider, well, I could lose one A, 482 00:23:11,140 --> 00:23:13,540 and lose one B, and get one more C. 483 00:23:13,540 --> 00:23:16,330 But then I'll have an equation for this term which 484 00:23:16,330 --> 00:23:17,510 will look just like this. 485 00:23:17,510 --> 00:23:19,880 But it'll go to ones where I have lost two A's and two 486 00:23:19,880 --> 00:23:21,485 B's and gained two C's. 487 00:23:21,485 --> 00:23:24,110 And then all the way down, until you get down to one of the n's 488 00:23:24,110 --> 00:23:26,630 to be zero. 489 00:23:26,630 --> 00:23:29,990 And so it could be quite a lot of possible equations, right? 490 00:23:29,990 --> 00:23:34,610 So the dimension-- the length of the vector P 491 00:23:34,610 --> 00:23:38,250 might get really long, right? 492 00:23:38,250 --> 00:23:52,110 So the length of P is something like the max number of A's, max 493 00:23:52,110 --> 00:23:56,060 number of B's, max number of C's. 494 00:24:00,690 --> 00:24:02,100 All right, so if I have-- 495 00:24:02,100 --> 00:24:06,010 I'll allow-- consider systems with up to 10 A's, 10 B's, 10 496 00:24:06,010 --> 00:24:07,140 C's-- 497 00:24:07,140 --> 00:24:09,660 then this is 1,000-- 498 00:24:09,660 --> 00:24:11,492 P's a length of approximately 1,000. 499 00:24:11,492 --> 00:24:13,700 And it might be less than that, because maybe there's 500 00:24:13,700 --> 00:24:17,160 some of them-- some particular states I can't get to. 501 00:24:17,160 --> 00:24:19,796 So maybe it's less than 1,000, but something like 1,000. 502 00:24:19,796 --> 00:24:21,670 On the other hand, if I allow it to a million 503 00:24:21,670 --> 00:24:24,390 A's, a million B's, and millions C's, then I, 504 00:24:24,390 --> 00:24:28,950 like, 10 to the 18 length of P. So P gets pretty long, pretty 505 00:24:28,950 --> 00:24:33,990 fast when the number of possible states goes up. 506 00:24:33,990 --> 00:24:35,990 Is that all right? 507 00:24:35,990 --> 00:24:40,780 So-- now, it's linear though. 508 00:24:40,780 --> 00:24:41,450 And it's linear. 509 00:24:41,450 --> 00:24:42,866 And this is constant coefficients. 510 00:24:42,866 --> 00:24:45,030 And so this is really not-- and sparse. 511 00:24:45,030 --> 00:24:47,460 So this is really-- it's not that bad. 512 00:24:47,460 --> 00:24:50,100 And in fact Professor Barton's group 513 00:24:50,100 --> 00:24:51,690 has worked on these kind of problems. 514 00:24:51,690 --> 00:24:54,450 And he has to solves that can work with P has dimension up 515 00:24:54,450 --> 00:24:56,410 to 200 million. 516 00:24:56,410 --> 00:24:58,960 So if you can keep the number-- say it's 200 million or less, 517 00:24:58,960 --> 00:25:01,360 you can actually solve this exactly. 518 00:25:01,360 --> 00:25:03,400 Now solving this exactly is really good, 519 00:25:03,400 --> 00:25:06,010 because then you actually have the exact probability 520 00:25:06,010 --> 00:25:09,620 of any observable measurement that you would possibly make 521 00:25:09,620 --> 00:25:13,390 at any time, all computed, OK? 522 00:25:13,390 --> 00:25:15,010 So that's really great. 523 00:25:15,010 --> 00:25:17,136 But as I just pointed out, if I make these numbers, 524 00:25:17,136 --> 00:25:19,176 like, 10 to the 6, 10 to the 6, and 10 to the 6-- 525 00:25:19,176 --> 00:25:20,380 this is like 10 of the 18. 526 00:25:20,380 --> 00:25:23,130 That's a lot bigger than 200 million. 527 00:25:23,130 --> 00:25:27,600 And so Professor Barton's numerical methods 528 00:25:27,600 --> 00:25:30,310 are going to poop out at some point, 529 00:25:30,310 --> 00:25:32,260 and not going to work for you anymore. 530 00:25:32,260 --> 00:25:34,770 So there's a limited number of problems you can do. 531 00:25:34,770 --> 00:25:38,010 So if your problem small enough, you can just solve this-- 532 00:25:38,010 --> 00:25:43,620 for really small ones you can solve this with OD45 or OD15s 533 00:25:43,620 --> 00:25:46,844 But because it's linear, there's special solution methods. 534 00:25:46,844 --> 00:25:49,260 I don't know if you remember solutions of linear equations 535 00:25:49,260 --> 00:25:52,110 this, you can relate them to the eigenvectors 536 00:25:52,110 --> 00:25:54,060 and eigenvalues of m. 537 00:25:54,060 --> 00:25:56,484 And so you can do-- that's one way to do it. 538 00:25:56,484 --> 00:25:58,400 And then there are special methods you can do. 539 00:25:58,400 --> 00:25:59,441 Talk to Professor Barton. 540 00:25:59,441 --> 00:26:02,421 If it's sparse-- and it has certain kinds properties, 541 00:26:02,421 --> 00:26:04,920 you can make this really-- you can make quite large systems, 542 00:26:04,920 --> 00:26:08,820 up to 10 to the 8 kind of size. 543 00:26:08,820 --> 00:26:11,470 If we get a system with more than 10 to 8 possible states, 544 00:26:11,470 --> 00:26:13,470 that means more than 10 to the 8 possible things 545 00:26:13,470 --> 00:26:16,770 could be observed or the result of experiment 546 00:26:16,770 --> 00:26:19,169 could have more than 10 to 8 possibilities, 547 00:26:19,169 --> 00:26:20,710 then this is-- you're not going to be 548 00:26:20,710 --> 00:26:21,970 able to solve it this way. 549 00:26:21,970 --> 00:26:23,553 And so then we're going to have to use 550 00:26:23,553 --> 00:26:26,390 a stochastic solid solution method to try to figure-- 551 00:26:26,390 --> 00:26:31,290 to do-- so we're going to try a sample from P of t. 552 00:26:31,290 --> 00:26:33,910 So I guess I should comment, again, I wrote it this way. 553 00:26:33,910 --> 00:26:34,729 But the thing-- 554 00:26:34,729 --> 00:26:36,270 P is definitely-- it depends on time. 555 00:26:36,270 --> 00:26:38,228 So it's you'll have different P for every time. 556 00:26:41,600 --> 00:26:43,315 Yeah? 557 00:26:43,315 --> 00:26:58,167 AUDIENCE: [INAUDIBLE] 558 00:26:58,167 --> 00:27:00,250 WILLIAM GREEN: Yeah maybe I'll just do better to-- 559 00:27:00,250 --> 00:27:02,250 I can substitute it in here. 560 00:27:17,250 --> 00:27:18,750 Is that all right? 561 00:27:18,750 --> 00:27:20,958 AUDIENCE: So, like, if you transfer all the neighbors 562 00:27:20,958 --> 00:27:22,750 in it, that's--? 563 00:27:22,750 --> 00:27:27,220 WILLIAM GREEN: Yeah, 'cause a key idea 564 00:27:27,220 --> 00:27:34,720 is that chemical kinetics only does one step at a time. 565 00:27:34,720 --> 00:27:41,954 So if you have a reaction like this, at any instant 566 00:27:41,954 --> 00:27:43,370 the probability that two reactions 567 00:27:43,370 --> 00:27:45,453 are going to be happening exactly the same instant 568 00:27:45,453 --> 00:27:46,770 is negligible. 569 00:27:46,770 --> 00:27:50,150 So at any instant you're only changing the numbers 570 00:27:50,150 --> 00:27:52,820 of the atoms by one unit, yeah. 571 00:27:52,820 --> 00:27:55,664 AUDIENCE: Then shouldn't you add another A minus 1 572 00:27:55,664 --> 00:27:56,612 and an E minus 1? 573 00:27:59,731 --> 00:28:01,480 WILLIAM GREEN: Maybe I got this backwards. 574 00:28:01,480 --> 00:28:07,680 n A plus 1 plus 1 minus 1, minus 1 minus 1 plus 1-- 575 00:28:07,680 --> 00:28:11,330 I think got-- I think this is right. 576 00:28:11,330 --> 00:28:14,600 So this is for the forward reaction that always reduces 577 00:28:14,600 --> 00:28:15,827 the number of A's and B's. 578 00:28:15,827 --> 00:28:18,326 And this is the reverse reaction that always increases them. 579 00:28:18,326 --> 00:28:20,117 And so I think you generally get like this. 580 00:28:20,117 --> 00:28:21,680 You always get-- for any reaction, 581 00:28:21,680 --> 00:28:24,190 you'll have four terms-- 582 00:28:24,190 --> 00:28:26,650 so the forward and reverse, starting 583 00:28:26,650 --> 00:28:29,385 from initial state, and the forward and reverse 584 00:28:29,385 --> 00:28:30,260 that make your state. 585 00:28:32,762 --> 00:28:34,220 And then if you add more reactions, 586 00:28:34,220 --> 00:28:35,540 you have a system where you've got a lot more reactions. 587 00:28:35,540 --> 00:28:38,150 Maybe you have C's that can just decompose 588 00:28:38,150 --> 00:28:40,580 into B's or something-- different reactions. 589 00:28:40,580 --> 00:28:44,150 Then you'd have a sum like this with terms 590 00:28:44,150 --> 00:28:45,950 like this from every reaction. 591 00:28:45,950 --> 00:28:48,283 And you'd go through all your list of all your reaction. 592 00:28:50,647 --> 00:28:52,730 I guess there's one funny thing I should point out 593 00:28:52,730 --> 00:28:56,120 to you about this, which is very important for this emulsion 594 00:28:56,120 --> 00:28:59,030 polymerization case-- 595 00:28:59,030 --> 00:29:07,480 Is that if you have a reaction of the type A plus A goes to-- 596 00:29:07,480 --> 00:29:14,900 I don't know-- B. That might be a reaction you could have. 597 00:29:14,900 --> 00:29:18,350 That when I write down the equation, if I only 598 00:29:18,350 --> 00:29:23,170 have one A in my sample, this probability of this happening 599 00:29:23,170 --> 00:29:24,320 is 0, right? 600 00:29:24,320 --> 00:29:27,390 Because I need two A's for this to happen. 601 00:29:27,390 --> 00:29:35,030 So really, the equation for this case is n A times n A minus 1. 602 00:29:35,030 --> 00:29:41,720 So it's k A plus A goes to B times n A times n A minus 1. 603 00:29:44,724 --> 00:29:47,140 And this is crucial for, like, the emulsion polymerization 604 00:29:47,140 --> 00:29:50,440 case, 'cause the fact that I don't have the second one is 605 00:29:50,440 --> 00:29:51,444 really important. 606 00:29:54,312 --> 00:29:56,270 Otherwise I always miscompute that this radical 607 00:29:56,270 --> 00:29:57,811 could react with itself and terminate 608 00:29:57,811 --> 00:29:58,906 itself, which is not true. 609 00:30:01,774 --> 00:30:03,100 Is that all right? 610 00:30:09,600 --> 00:30:13,260 I commented that these k's are a little bit odd. 611 00:30:13,260 --> 00:30:15,840 So if you remember, if you have a k for a unimolecular 612 00:30:15,840 --> 00:30:18,692 reaction, like C goes to A plus B, what units would it have? 613 00:30:22,550 --> 00:30:26,157 What are the units for regular kinetics? 614 00:30:26,157 --> 00:30:27,240 AUDIENCE: Inverse seconds. 615 00:30:27,240 --> 00:30:28,240 WILLIAM GREEN: Right, inverse seconds, right? 616 00:30:28,240 --> 00:30:29,740 So you would normally say this thing 617 00:30:29,740 --> 00:30:31,347 has units of inverse seconds. 618 00:30:31,347 --> 00:30:32,680 And that works fine here, right? 619 00:30:32,680 --> 00:30:36,760 Because I have dP dt, and it's in for a seconds times P, 620 00:30:36,760 --> 00:30:38,490 so it's fine. 621 00:30:38,490 --> 00:30:42,020 However, this guy-- to make the units work out, still 622 00:30:42,020 --> 00:30:44,452 has to also be inverse seconds, but that's not normally 623 00:30:44,452 --> 00:30:46,410 what you would have for a bimolecular reaction. 624 00:30:49,640 --> 00:30:54,020 And the other thing to watch out for here is that I have n's. 625 00:30:54,020 --> 00:30:56,270 But normally you would write them with concentrations, 626 00:30:56,270 --> 00:30:57,080 right? 627 00:30:57,080 --> 00:30:58,850 You have the-- you'd would write something 628 00:30:58,850 --> 00:31:02,490 like k times the concentration of C. It's 629 00:31:02,490 --> 00:31:05,060 the normal way you write your equations, the right equations. 630 00:31:05,060 --> 00:31:06,450 But this is not the same, right? 631 00:31:06,450 --> 00:31:07,460 This is n. 632 00:31:07,460 --> 00:31:11,010 This is unitless. 633 00:31:11,010 --> 00:31:13,580 Now it turns out, in this case, actually, you 634 00:31:13,580 --> 00:31:16,030 can use exactly the same as k and it works. 635 00:31:16,030 --> 00:31:19,120 But for the bimolecular case, it definitely does not work. 636 00:31:19,120 --> 00:31:20,950 The units are wrong. 637 00:31:20,950 --> 00:31:23,890 And also this concentration thing 638 00:31:23,890 --> 00:31:27,020 implies that we think the rate really has-- 639 00:31:27,020 --> 00:31:32,770 suppose we have k A k B. I could rewrite this as k times n 640 00:31:32,770 --> 00:31:37,880 A over the volume, n B over the volume. 641 00:31:37,880 --> 00:31:40,279 Is that all right? 642 00:31:40,279 --> 00:31:42,320 Actually one thing I should warn you about-- that 643 00:31:42,320 --> 00:31:45,420 usually when I write this, I write moles per liter. 644 00:31:45,420 --> 00:31:48,020 So I have factors of 10 to the 23 between this and this, 645 00:31:48,020 --> 00:31:51,520 because these n's have got to be the individual molecules 646 00:31:51,520 --> 00:31:52,780 for this to work. 647 00:31:52,780 --> 00:31:54,210 So watch out. 648 00:31:54,210 --> 00:31:57,680 First of all, there's a 10 to the 23 somewhere in here, 649 00:31:57,680 --> 00:31:58,180 right-- 650 00:31:58,180 --> 00:31:59,550 Avogadro's number. 651 00:31:59,550 --> 00:32:01,739 And then this is what-- 652 00:32:01,739 --> 00:32:03,030 how we would normally write it. 653 00:32:03,030 --> 00:32:06,360 But this k has the wrong units for us here. 654 00:32:06,360 --> 00:32:17,218 And so this guy here is the normal k divided by the volume. 655 00:32:22,008 --> 00:32:25,422 I think that's right. 656 00:32:25,422 --> 00:32:28,270 Maybe it's the other way around. 657 00:32:28,270 --> 00:32:31,489 No, this is normal k times the volume. 658 00:32:31,489 --> 00:32:32,030 That's right. 659 00:32:32,030 --> 00:32:37,450 So normally we would write units k normal-- 660 00:32:37,450 --> 00:32:47,430 normal kinetics, macro-- k for A plus B reactions, 661 00:32:47,430 --> 00:32:52,170 the units are centimeters cubed per mole second. 662 00:32:55,750 --> 00:32:57,385 But we want them to be units of-- 663 00:33:02,180 --> 00:33:08,227 the new k has got to be units of per second. 664 00:33:11,150 --> 00:33:23,515 And so the new k is equal to the old k new old times the volume. 665 00:33:26,160 --> 00:33:28,230 Is that right-- no divided by the volume. 666 00:33:28,230 --> 00:33:29,760 I was right the first time. 667 00:33:29,760 --> 00:33:32,810 This is volume-- yeah. 668 00:33:32,810 --> 00:33:36,530 Thank you-- centimetres cubed, centimeters cubed-- 669 00:33:36,530 --> 00:33:38,650 yeah, right. 670 00:33:38,650 --> 00:33:41,230 Cancelled out, good for a second. 671 00:33:41,230 --> 00:33:46,458 So this is k per volume normal k divided by n-- correct. 672 00:33:49,469 --> 00:33:51,260 And you may wonder, well how come it's only 673 00:33:51,260 --> 00:33:53,240 volume to the first power? 674 00:33:53,240 --> 00:33:54,880 Before I had volume to the second power 675 00:33:54,880 --> 00:33:56,930 in the denominator. 676 00:33:56,930 --> 00:34:01,480 And it's because I'm using n's up in the numerator. 677 00:34:01,480 --> 00:34:02,590 And it's just like here. 678 00:34:02,590 --> 00:34:05,216 I'm using n's instead of n over v. 679 00:34:05,216 --> 00:34:07,340 So I've sort of multiplied through by v everywhere. 680 00:34:07,340 --> 00:34:10,190 That's one way to look at it. 681 00:34:10,190 --> 00:34:16,248 All right, no questions yet? 682 00:34:16,248 --> 00:34:17,240 Yeah? 683 00:34:17,240 --> 00:34:18,728 AUDIENCE: So when you [INAUDIBLE] 684 00:34:21,219 --> 00:34:23,739 WILLIAM GREEN: Yeah, so I need a 10 to the 23 as well. 685 00:34:23,739 --> 00:34:26,180 So there's got to be an Avogadro's number. 686 00:34:26,180 --> 00:34:28,679 And you'll have to help me where the Avogadro's number goes. 687 00:34:28,679 --> 00:34:30,449 But it's got to be in there somewhere, 688 00:34:30,449 --> 00:34:34,597 to get from moles to molecules. 689 00:34:34,597 --> 00:34:36,055 So the numbers are a lot different. 690 00:34:41,005 --> 00:34:44,280 Is this OK? 691 00:34:44,280 --> 00:34:46,499 And this factor, this n minus 1 thing-- 692 00:34:46,499 --> 00:34:48,540 again, when these are macroscopic numbers like 10 693 00:34:48,540 --> 00:34:50,331 to the 23, this makes no difference, right? 694 00:34:50,331 --> 00:34:51,439 Because it's minus 1. 695 00:34:51,439 --> 00:34:53,775 So we can fit our data ignoring the 1-- 696 00:34:53,775 --> 00:34:55,400 It's 1. 697 00:34:55,400 --> 00:34:58,076 Perfectly well, the law of mass action-- it works fine. 698 00:34:58,076 --> 00:34:59,700 So you never notice this unless you get 699 00:34:59,700 --> 00:35:01,080 down to where n is very small. 700 00:35:04,940 --> 00:35:06,840 But this is actually the truth. 701 00:35:06,840 --> 00:35:08,999 This is really what the correct equation is. 702 00:35:14,870 --> 00:35:18,562 OK so now we have these-- the true equations 703 00:35:18,562 --> 00:35:20,520 for predicting how the probability distribution 704 00:35:20,520 --> 00:35:22,680 evolves in a reacting system. 705 00:35:22,680 --> 00:35:24,720 By the way, you can add transport in 706 00:35:24,720 --> 00:35:26,040 as well if you want. 707 00:35:26,040 --> 00:35:27,960 So you have control volumes, and you 708 00:35:27,960 --> 00:35:30,660 know formulas for the rate at which stuff is transported in 709 00:35:30,660 --> 00:35:32,220 and out of the control volume. 710 00:35:32,220 --> 00:35:33,870 You can add those terms in as well. 711 00:35:33,870 --> 00:35:37,240 And they'll affect the probability distribution. 712 00:35:37,240 --> 00:35:40,060 No problem, you should be able to do the same conversion. 713 00:35:40,060 --> 00:35:42,381 So just-- we've converted the reaction equations. 714 00:35:42,381 --> 00:35:43,630 You can write a similar thing. 715 00:35:43,630 --> 00:35:46,110 Once you get right the macroscopic transport equation, 716 00:35:46,110 --> 00:35:47,860 you can figure out how you would reduce it 717 00:35:47,860 --> 00:35:51,550 down to a time constant for transport 718 00:35:51,550 --> 00:35:53,660 that would work for the-- 719 00:35:53,660 --> 00:35:55,704 for this microscopic version of the equations. 720 00:35:55,704 --> 00:35:58,120 So transport reaction-- you can write the whole thing down 721 00:35:58,120 --> 00:35:58,994 as a master equation. 722 00:35:58,994 --> 00:36:01,390 That's a real solution, the real equation. 723 00:36:01,390 --> 00:36:04,300 And the problem is that the real equation oftentimes 724 00:36:04,300 --> 00:36:08,650 is too big, because P scales up so rapidly with the number 725 00:36:08,650 --> 00:36:10,562 of possible states. 726 00:36:10,562 --> 00:36:13,020 So then we have to figure out how are we going to solve it. 727 00:36:13,020 --> 00:36:14,740 And the way to solve it is by-- 728 00:36:14,740 --> 00:36:16,240 called kinetic Monte Carlo. 729 00:36:28,020 --> 00:36:33,090 And this method was invented by a guy named Joe Gillespie. 730 00:36:33,090 --> 00:36:34,755 And the journal paper is posted. 731 00:36:42,400 --> 00:36:45,140 And this is just like with Monte Carlo-- 732 00:36:45,140 --> 00:36:47,420 Metropolis Monte Carlo that you just did. 733 00:36:47,420 --> 00:36:49,930 We're trying to find a way to sample 734 00:36:49,930 --> 00:36:53,260 from the true probability density 735 00:36:53,260 --> 00:36:57,940 without ever computing the true probability density. 736 00:36:57,940 --> 00:36:59,760 So in the Monte Carlo integration 737 00:36:59,760 --> 00:37:01,450 you're doing for homework, you're 738 00:37:01,450 --> 00:37:04,905 sampling from the true Boltzmann probability density, 739 00:37:04,905 --> 00:37:06,530 but you never actually supposedly write 740 00:37:06,530 --> 00:37:09,665 down what that P is, right? 741 00:37:09,665 --> 00:37:11,540 And so we're going to do the same thing here, 742 00:37:11,540 --> 00:37:12,620 is we're going to-- 743 00:37:12,620 --> 00:37:15,147 from the differential equations-- 744 00:37:15,147 --> 00:37:16,730 from this differential equation system 745 00:37:16,730 --> 00:37:20,570 here, we're going to try to somehow never ever solve this 746 00:37:20,570 --> 00:37:24,144 directly, but instead just sample from the solution, P, 747 00:37:24,144 --> 00:37:25,060 which depends on time. 748 00:37:28,030 --> 00:37:34,070 And the way it's done is really to try 749 00:37:34,070 --> 00:37:36,980 to follow individual trajectories of what 750 00:37:36,980 --> 00:37:40,130 could have happened, OK? 751 00:37:40,130 --> 00:37:43,850 So at any time-step, we have some number 752 00:37:43,850 --> 00:37:46,510 of A's, B's and C's. 753 00:37:46,510 --> 00:37:49,600 And we're going to say, well in the next time 754 00:37:49,600 --> 00:37:52,700 period, some small time period, what could happen? 755 00:37:52,700 --> 00:37:54,700 And we're going to make the time period so small 756 00:37:54,700 --> 00:37:57,290 that the only thing that can happen is nothing happens, 757 00:37:57,290 --> 00:38:00,160 and A, B and C stay the same, or one event 758 00:38:00,160 --> 00:38:05,000 happens which will change one of the numbers, the A's, B's, 759 00:38:05,000 --> 00:38:08,870 and C's, by the same one reaction amount, OK? 760 00:38:08,870 --> 00:38:14,330 And then after we accomplish that, now we have a new state-- 761 00:38:14,330 --> 00:38:15,784 A, B, and C with some new values. 762 00:38:15,784 --> 00:38:17,200 And we'll do the same thing again. 763 00:38:17,200 --> 00:38:18,783 And we just repeat that over and over. 764 00:38:18,783 --> 00:38:19,990 So it's very brute force. 765 00:38:19,990 --> 00:38:25,250 You're just doing, like, what a single system would do. 766 00:38:25,250 --> 00:38:27,650 So for example, for the uranium atom case, 767 00:38:27,650 --> 00:38:29,690 we have one uranium atom in there. 768 00:38:29,690 --> 00:38:32,120 We wait for some time period, say 20 minutes. 769 00:38:32,120 --> 00:38:34,370 We compute the probability that the uranium would have 770 00:38:34,370 --> 00:38:36,130 decayed in the last 20 minutes. 771 00:38:36,130 --> 00:38:38,400 It's pretty small. 772 00:38:38,400 --> 00:38:42,490 And then we'll say, OK, now we'll draw a random number. 773 00:38:42,490 --> 00:38:47,840 If the random number is less than that probability, 774 00:38:47,840 --> 00:38:51,195 then we think that the uranium is still there. 775 00:38:51,195 --> 00:38:53,570 And if the random number is bigger than that probability, 776 00:38:53,570 --> 00:38:56,710 then the uranium is gone. 777 00:38:56,710 --> 00:38:59,370 If it's still there, then we'll do it again. 778 00:38:59,370 --> 00:39:01,690 And we'll just keep doing that over and over again. 779 00:39:01,690 --> 00:39:03,470 And we'll sample what could happen. 780 00:39:03,470 --> 00:39:07,650 The uranium atom could live for 38 years and 14 minutes, 781 00:39:07,650 --> 00:39:09,141 and then disappear. 782 00:39:09,141 --> 00:39:10,390 And that would be one example. 783 00:39:10,390 --> 00:39:11,973 And then we go back and we do it again 784 00:39:11,973 --> 00:39:13,590 from a different trajectory. 785 00:39:13,590 --> 00:39:15,420 And we do it over and over and over again. 786 00:39:15,420 --> 00:39:17,250 And we do it over and over again. 787 00:39:17,250 --> 00:39:20,130 Those trajectories are sampling from what could happen, 788 00:39:20,130 --> 00:39:21,935 with the right probability density. 789 00:39:21,935 --> 00:39:23,924 Does this make sense? 790 00:39:23,924 --> 00:39:25,340 So the way Gillespie says to do it 791 00:39:25,340 --> 00:39:44,012 is figure out the expected time until something would happen. 792 00:39:47,679 --> 00:39:48,720 We'll call this time tau. 793 00:39:53,090 --> 00:40:02,404 And we'll pull-- actually let's not use tau, 794 00:40:02,404 --> 00:40:03,820 because that's the only one that-- 795 00:40:03,820 --> 00:40:05,830 I'll try to be consistent with Joe's notation. 796 00:40:05,830 --> 00:40:07,510 He calls this thing 1/a. 797 00:40:20,925 --> 00:40:25,650 So a is like the expected rate per second. 798 00:40:25,650 --> 00:40:28,870 And 1/a is the expected time until something would happen. 799 00:40:28,870 --> 00:40:42,450 And then we'll draw a random number r-- 800 00:40:42,450 --> 00:40:43,220 he calls it r1. 801 00:40:46,867 --> 00:40:48,580 So we just call the rand function. 802 00:40:48,580 --> 00:40:51,480 It gives me a number between 0 and 1. 803 00:40:51,480 --> 00:40:55,430 And I'll say that my time-step, delta t-- 804 00:40:55,430 --> 00:41:02,100 which Joe calls tau, is 1/a the logarithm of 1/o. 805 00:41:06,790 --> 00:41:13,838 So I think there should be a negative sign. 806 00:41:13,838 --> 00:41:15,290 No, 1/r is positive. 807 00:41:15,290 --> 00:41:17,030 That's right-- positive. 808 00:41:17,030 --> 00:41:21,490 All right, so I choose a random number. 809 00:41:21,490 --> 00:41:22,790 Suppose it's 1/2. 810 00:41:22,790 --> 00:41:25,475 Then this fraction is 2-- 811 00:41:25,475 --> 00:41:27,080 1 over 1/2 is 2. 812 00:41:27,080 --> 00:41:29,780 Logarithm of 2 is some number bigger than 1. 813 00:41:29,780 --> 00:41:31,070 And I pull that. 814 00:41:31,070 --> 00:41:31,835 And I get some-- 815 00:41:34,540 --> 00:41:36,940 actually, some number less than 1-- logarithm of 2-- 816 00:41:36,940 --> 00:41:38,530 anyway, some positive number. 817 00:41:38,530 --> 00:41:42,040 Multiply it by the expected time until something happens-- 818 00:41:42,040 --> 00:41:44,410 and that's the time, in this particular simulation, 819 00:41:44,410 --> 00:41:46,725 when the next thing happened. 820 00:41:46,725 --> 00:41:48,850 And then I repeat this again, and again, and again. 821 00:41:48,850 --> 00:41:51,640 And I get the period of time intervals between when 822 00:41:51,640 --> 00:41:52,607 something happened. 823 00:41:52,607 --> 00:41:54,940 Now every time something happened, I have to figure out, 824 00:41:54,940 --> 00:41:56,930 well, what happened? 825 00:41:56,930 --> 00:42:00,626 So if I look at my-- 826 00:42:03,888 --> 00:42:07,360 plot back here when I had the uranium, I waited a long-- 827 00:42:10,090 --> 00:42:13,140 in this particular case, here's my tau. 828 00:42:13,140 --> 00:42:15,595 I'll call this tau 1-- 829 00:42:15,595 --> 00:42:18,232 the time that it took for the first thing to happen. 830 00:42:18,232 --> 00:42:19,690 And then, well-- what could happen? 831 00:42:19,690 --> 00:42:23,580 The only thing can happen with my single uranium atom case 832 00:42:23,580 --> 00:42:25,520 is it decayed. 833 00:42:25,520 --> 00:42:27,430 So it went away. 834 00:42:27,430 --> 00:42:30,250 All right, and then I do the random thing again. 835 00:42:30,250 --> 00:42:30,790 And I draw. 836 00:42:30,790 --> 00:42:32,415 And I get a different number this time. 837 00:42:34,234 --> 00:42:35,900 How long it is 'till something happened. 838 00:42:39,430 --> 00:42:42,090 Now notice-- maybe it's not so obvious-- 839 00:42:42,090 --> 00:42:46,535 that in the time until something happens changes as you run. 840 00:42:46,535 --> 00:42:50,840 So for example, if I started out with 100 uranium atoms 841 00:42:50,840 --> 00:42:52,070 in 100 little boxes. 842 00:42:52,070 --> 00:42:53,480 And I'm watching them. 843 00:42:53,480 --> 00:42:55,430 After I've run this for a long time, 844 00:42:55,430 --> 00:42:57,651 I only have 50 uranium atoms left. 845 00:42:57,651 --> 00:42:59,150 And that means that the average time 846 00:42:59,150 --> 00:43:01,482 period until something happens will be slower, 847 00:43:01,482 --> 00:43:02,690 because I don't have as many. 848 00:43:02,690 --> 00:43:06,060 The more I have, the more rapidly something will happen. 849 00:43:06,060 --> 00:43:07,660 Does that make sense? 850 00:43:07,660 --> 00:43:11,450 So I have to compute this a thing at each iteration. 851 00:43:11,450 --> 00:43:14,976 So I compute the time until something happens. 852 00:43:14,976 --> 00:43:16,950 Then I'm going to compute what happened. 853 00:43:16,950 --> 00:43:18,060 I'll tell you what that the second. 854 00:43:18,060 --> 00:43:20,185 In the uranium case, the only thing that can happen 855 00:43:20,185 --> 00:43:22,310 is one of the uranium atoms decayed. 856 00:43:22,310 --> 00:43:23,780 So I took that away. 857 00:43:23,780 --> 00:43:26,520 Now I have to compute a again. 858 00:43:26,520 --> 00:43:32,170 So a is the sum of all the things that can happen. 859 00:43:32,170 --> 00:43:34,980 So in my case where I have 100 uranium atoms, 860 00:43:34,980 --> 00:43:36,420 I have 100 different boxes. 861 00:43:36,420 --> 00:43:39,690 In each one of them, there is a rate at which uranium atom 862 00:43:39,690 --> 00:43:41,870 probability is decaying. 863 00:43:41,870 --> 00:43:44,480 It's like 1 over the normal half life uranium-- or something 864 00:43:44,480 --> 00:43:45,690 like that. 865 00:43:45,690 --> 00:43:48,310 And I add them up. 866 00:43:48,310 --> 00:44:01,190 So a is the sum of the rates of everything that can happen. 867 00:44:10,017 --> 00:44:11,850 So we just list out all the different things 868 00:44:11,850 --> 00:44:13,240 that can happen. 869 00:44:13,240 --> 00:44:15,330 So in the case-- suppose I have two boxes-- 870 00:44:15,330 --> 00:44:17,160 two uranium atoms. 871 00:44:17,160 --> 00:44:20,220 I can have decay of uranium atom number one or uranium atom 872 00:44:20,220 --> 00:44:21,630 number two. 873 00:44:21,630 --> 00:44:25,394 So I have-- this thing would be equal to-- 874 00:44:25,394 --> 00:44:26,600 so two uranium atoms-- 875 00:44:33,500 --> 00:44:40,914 a is equal to 1 over tau normal for a uranium atom plus one 876 00:44:40,914 --> 00:44:41,580 over tau normal. 877 00:44:41,580 --> 00:44:44,700 Because they're both normal uranium atoms. 878 00:44:44,700 --> 00:44:47,040 So it's equal to 2/tau. 879 00:44:47,040 --> 00:44:50,620 And so 1/a is half of the normal lifetime. 880 00:44:50,620 --> 00:44:53,430 And that's when I would expect that something 881 00:44:53,430 --> 00:44:57,570 would happen by then, OK? 882 00:44:57,570 --> 00:45:00,550 One of them would probably decay. 883 00:45:00,550 --> 00:45:05,050 So that would be the a value I would use here. 884 00:45:05,050 --> 00:45:07,230 Draw my random number, get my tau 885 00:45:07,230 --> 00:45:09,480 until something probably happened, 886 00:45:09,480 --> 00:45:11,400 then figure out what happens. 887 00:45:11,400 --> 00:45:13,830 Now in the kinetics case, several different things 888 00:45:13,830 --> 00:45:14,580 can happen, right? 889 00:45:14,580 --> 00:45:23,275 I wrote down if I'm in state n A n B n C, I-- 890 00:45:23,275 --> 00:45:26,850 the state can change by two different ways. 891 00:45:26,850 --> 00:45:33,330 I can move out of that state this way or this way. 892 00:45:33,330 --> 00:45:34,830 Two different reactions can happen-- 893 00:45:34,830 --> 00:45:36,470 a forward or reverse reaction. 894 00:45:36,470 --> 00:45:38,370 And they would both take me out of the state. 895 00:45:38,370 --> 00:45:40,453 So those are two different things that can happen. 896 00:45:42,930 --> 00:45:46,680 And so I have to add those rates. 897 00:45:46,680 --> 00:45:54,510 So I would add this number and this number. 898 00:45:54,510 --> 00:45:56,970 And they would be the two things that could happen. 899 00:45:56,970 --> 00:45:59,740 And that would give me the a value. 900 00:45:59,740 --> 00:46:03,690 Now I figured out something happened. 901 00:46:03,690 --> 00:46:04,940 But now I'm not doing uranium. 902 00:46:04,940 --> 00:46:07,649 Now doing, say, number of A's. 903 00:46:07,649 --> 00:46:09,190 Now I figured out something happened. 904 00:46:09,190 --> 00:46:10,981 But now I have to figure out what happened. 905 00:46:10,981 --> 00:46:14,080 And the number of A's could have gone up or gone down, 906 00:46:14,080 --> 00:46:15,730 because if it was a forward reaction, 907 00:46:15,730 --> 00:46:16,997 the number of A's went down. 908 00:46:16,997 --> 00:46:19,330 If it was a reverse reaction, the number of A's went up. 909 00:46:19,330 --> 00:46:22,540 So I have to decide which way is going to happen. 910 00:46:22,540 --> 00:46:25,780 So I could have either the number of A's went down, 911 00:46:25,780 --> 00:46:27,850 or the number of A's went up. 912 00:46:27,850 --> 00:46:29,150 Those are two possibilities. 913 00:46:29,150 --> 00:46:30,820 I have to figure out which one happened. 914 00:46:30,820 --> 00:46:31,590 I have to figure-- 915 00:46:31,590 --> 00:46:33,670 draw another random number to figure out 916 00:46:33,670 --> 00:46:35,870 which one probably happened. 917 00:46:35,870 --> 00:46:38,590 So I'll list out the list of all the things that 918 00:46:38,590 --> 00:46:42,210 can happen with their rates. 919 00:46:42,210 --> 00:46:46,350 And one of them, say, is twice as big as the other. 920 00:46:46,350 --> 00:46:49,000 So that'll be twice as likely to happen. 921 00:46:49,000 --> 00:46:50,880 So I have to choose a random number, 922 00:46:50,880 --> 00:46:53,220 and use that to choose the next one. 923 00:46:53,220 --> 00:47:00,722 So first I figured out-- 924 00:47:00,722 --> 00:47:02,180 this is actually what we did first. 925 00:47:02,180 --> 00:47:04,700 I figured out what my rates are. 926 00:47:04,700 --> 00:47:07,922 Second thing is I figure out the time until something happened. 927 00:47:07,922 --> 00:47:10,130 Third thing is I'm going to figure out what happened. 928 00:47:16,030 --> 00:47:18,240 And what I do is I say-- 929 00:47:18,240 --> 00:47:21,290 I draw a random number called r2. 930 00:47:25,079 --> 00:47:26,620 And if there's only two possibilities 931 00:47:26,620 --> 00:47:29,280 like in this case, then I can say 932 00:47:29,280 --> 00:47:43,690 if r2 is less than the rate of process one divided 933 00:47:43,690 --> 00:47:49,200 by the sum of the rates, which is the same as the a, right? 934 00:47:49,200 --> 00:47:53,810 So this is-- it this is true, then process one happened. 935 00:47:57,769 --> 00:48:00,310 On the other hand, if the rate-- if the random number I chose 936 00:48:00,310 --> 00:48:05,206 is larger than this ratio, then I'll say process two happened. 937 00:48:05,206 --> 00:48:07,830 And that's how I decide whether a number of A's went up or went 938 00:48:07,830 --> 00:48:09,717 down. 939 00:48:09,717 --> 00:48:12,300 And then I would recompute the a-- depending on what happened. 940 00:48:12,300 --> 00:48:13,490 Suppose I do this. 941 00:48:13,490 --> 00:48:16,294 And I found out that the number of A's went up-- 942 00:48:16,294 --> 00:48:19,100 because I-- by drawing the random number. 943 00:48:19,100 --> 00:48:21,905 Then I'll go and I'll recompute the A. Now 944 00:48:21,905 --> 00:48:24,430 the rates will all be different, because n A is bigger. 945 00:48:24,430 --> 00:48:27,050 So the rate of the n A reaction is faster. 946 00:48:27,050 --> 00:48:28,320 So I recompute it. 947 00:48:28,320 --> 00:48:33,170 I redraw a number here, and get some different time, tau 2. 948 00:48:33,170 --> 00:48:35,290 It's not the same as tau 1. 949 00:48:35,290 --> 00:48:36,790 And then something happened here. 950 00:48:36,790 --> 00:48:39,012 I do the same process here out what happened. 951 00:48:39,012 --> 00:48:41,220 Maybe this time A reacted away and it went back down. 952 00:48:44,310 --> 00:48:46,810 And then I do it again. 953 00:48:46,810 --> 00:48:50,190 And this time I draw a longer time, tau 3. 954 00:48:50,190 --> 00:48:51,510 And I do-- what happened? 955 00:48:51,510 --> 00:48:53,635 And maybe this time, again, something reacted away. 956 00:48:53,635 --> 00:48:55,100 And it went down. 957 00:48:55,100 --> 00:48:57,320 And on, and on, and on-- 958 00:48:57,320 --> 00:48:59,710 and after my computer is done doing that for a while, 959 00:48:59,710 --> 00:49:02,739 like, after a long enough time, I say, OK, I'm done. 960 00:49:02,739 --> 00:49:03,780 Oh-- I'm not really done. 961 00:49:03,780 --> 00:49:05,321 I have to go back and start it again, 962 00:49:05,321 --> 00:49:08,540 and run another simulation to run 963 00:49:08,540 --> 00:49:10,210 through all the possibilities. 964 00:49:10,210 --> 00:49:12,230 And I want to save all these results of all 965 00:49:12,230 --> 00:49:14,150 these simulations, because these guys are 966 00:49:14,150 --> 00:49:17,077 samples from the probability distribution. 967 00:49:17,077 --> 00:49:19,160 And if I built histograms of stuff from those guys 968 00:49:19,160 --> 00:49:21,336 I can figure out what really is going to happen. 969 00:49:21,336 --> 00:49:26,188 All right, so it's a way to represent the P. Questions? 970 00:49:29,954 --> 00:49:31,120 All right-- perfectly clear? 971 00:49:33,770 --> 00:49:38,540 All right, so what's nice about this is actually, 972 00:49:38,540 --> 00:49:41,032 it's not that hard once you do this once. 973 00:49:41,032 --> 00:49:41,990 It's not hard to do it. 974 00:49:41,990 --> 00:49:44,280 And you can do it for any problem at all. 975 00:49:44,280 --> 00:49:45,700 And so it's like-- 976 00:49:45,700 --> 00:49:47,990 often cases people do this even for cases 977 00:49:47,990 --> 00:49:51,260 where you actually could solve-- 978 00:49:51,260 --> 00:49:53,267 you might be able to solve this equation. 979 00:49:53,267 --> 00:49:54,600 A lot times, people won't do it. 980 00:49:54,600 --> 00:49:57,882 They'll do this instead just because it's so easy. 981 00:49:57,882 --> 00:49:59,840 So though maybe it looks hard to you right now, 982 00:49:59,840 --> 00:50:00,990 it's only a three step thing. 983 00:50:00,990 --> 00:50:02,330 And just do it over, and over again. 984 00:50:02,330 --> 00:50:02,870 You're not doing it. 985 00:50:02,870 --> 00:50:04,130 The computer's doing it-- 986 00:50:04,130 --> 00:50:05,580 no big deal. 987 00:50:05,580 --> 00:50:07,164 And so this one you have to, like, 988 00:50:07,164 --> 00:50:08,830 look at the sparsity pattern of your m-- 989 00:50:08,830 --> 00:50:11,390 and some complicated stuff. 990 00:50:11,390 --> 00:50:16,210 So this is actually done extremely commonly. 991 00:50:16,210 --> 00:50:19,260 All right, see you on Friday.