1 00:00:02,670 --> 00:00:04,950 Congratulations on surviving module one 2 00:00:04,950 --> 00:00:08,550 and welcome to module two of modeling complex system. 3 00:00:08,550 --> 00:00:10,950 In this module, we're gonna tackle models 4 00:00:10,950 --> 00:00:14,100 with explicit structure, structure and space 5 00:00:14,100 --> 00:00:16,080 which we did not have in module one 6 00:00:16,080 --> 00:00:18,210 and for a very interesting reason. 7 00:00:18,210 --> 00:00:21,240 So we're gonna try and build the simplest possible 8 00:00:21,240 --> 00:00:23,610 spatially explicit models that we can. 9 00:00:23,610 --> 00:00:26,598 And those will be called cellular automata. 10 00:00:26,598 --> 00:00:29,040 And because those are two very hard words 11 00:00:29,040 --> 00:00:31,540 to pronounce for me, we'll call them CA 12 00:00:33,330 --> 00:00:36,100 and the error that we made, or it's not an error 13 00:00:37,350 --> 00:00:40,320 but this choice that we made early on in module one 14 00:00:40,320 --> 00:00:42,780 that sort of sent us towards the path 15 00:00:42,780 --> 00:00:44,700 of dynamical system and away 16 00:00:44,700 --> 00:00:48,030 from spatially explicit model was when we were building 17 00:00:48,030 --> 00:00:50,970 our mechanisms, our putting parts of a system 18 00:00:50,970 --> 00:00:55,260 in boxes and and describing mechanisms as arrows. 19 00:00:55,260 --> 00:00:58,710 We made the approximation that these boxes and arrows 20 00:00:58,710 --> 00:01:02,580 were telling a complete story about the state of the system. 21 00:01:02,580 --> 00:01:04,560 And so we could write down equations 22 00:01:04,560 --> 00:01:07,410 using a mean field approximation, 23 00:01:07,410 --> 00:01:10,530 where a given neighbor of an individual 24 00:01:10,530 --> 00:01:15,530 in a social network or a piece of land 25 00:01:15,810 --> 00:01:19,140 next to a fox or shark or a fish 26 00:01:19,140 --> 00:01:22,080 in the (indistinct)systems was just randomly chosen 27 00:01:22,080 --> 00:01:23,910 based on the current state of the system. 28 00:01:23,910 --> 00:01:25,950 We were assuming that things were well mixed, 29 00:01:25,950 --> 00:01:29,400 randomized and that we could do a mean field approximation. 30 00:01:29,400 --> 00:01:32,280 That approximation got rid of space 31 00:01:32,280 --> 00:01:36,060 made so that our models assume that things were either 32 00:01:36,060 --> 00:01:38,973 fully random or completely connected, 33 00:01:40,140 --> 00:01:41,250 either of which doesn't have 34 00:01:41,250 --> 00:01:43,830 any interesting spatial features. 35 00:01:43,830 --> 00:01:45,600 So what we wanna do is go back 36 00:01:45,600 --> 00:01:48,780 to the very basic elements of our modeling recipe 37 00:01:48,780 --> 00:01:52,500 and try and avoid making that mean filled approximation. 38 00:01:52,500 --> 00:01:56,460 We won't get explicit equations for now, 39 00:01:56,460 --> 00:01:59,040 but we'll get very interesting models nonetheless 40 00:01:59,040 --> 00:02:02,010 and models that will allow us to consider space. 41 00:02:02,010 --> 00:02:03,750 So we want to think about ingredients 42 00:02:03,750 --> 00:02:07,053 preparation of the system and its presentation, right? 43 00:02:08,670 --> 00:02:11,280 So for spatially explicit models, the goal here 44 00:02:11,280 --> 00:02:13,140 is no mean-field approximation, 45 00:02:13,140 --> 00:02:14,733 and then we start from scratch. 46 00:02:16,230 --> 00:02:18,180 So importantly, what this means is that 47 00:02:18,180 --> 00:02:22,740 before the updates rule for a fish or susceptible individual 48 00:02:22,740 --> 00:02:25,470 or any piece of our system was based on its own state 49 00:02:25,470 --> 00:02:26,940 and the state of the system 50 00:02:26,940 --> 00:02:28,500 and that mean field approximation 51 00:02:28,500 --> 00:02:30,090 was taken care of the rest. 52 00:02:30,090 --> 00:02:31,819 Here, we're gonna have to be sure 53 00:02:31,819 --> 00:02:36,330 to specify update rules that depend 54 00:02:36,330 --> 00:02:37,920 on the state of the parts 55 00:02:37,920 --> 00:02:39,870 and on the state of their neighbors. 56 00:02:39,870 --> 00:02:41,280 And that's how we're going to be able 57 00:02:41,280 --> 00:02:43,083 to keep track of space. 58 00:02:43,950 --> 00:02:45,960 All right, so we want to do the simplest possible case 59 00:02:45,960 --> 00:02:48,150 of that where the mechanisms are not as simple 60 00:02:48,150 --> 00:02:50,133 as S goes to I with some rate, 61 00:02:51,300 --> 00:02:54,483 but depend on what's around the S individual, right? 62 00:02:55,530 --> 00:02:57,060 So what are the ingredients 63 00:02:57,060 --> 00:02:58,830 for the simplest possible case 64 00:02:58,830 --> 00:03:00,990 of a especially explicit model? 65 00:03:00,990 --> 00:03:04,470 Well, we're gonna make a a discrete time approximation 66 00:03:04,470 --> 00:03:06,420 because that's often easier at first. 67 00:03:06,420 --> 00:03:09,660 We're gonna also make a discrete space approximation 68 00:03:09,660 --> 00:03:12,180 and then we're gonna be working in one dimension. 69 00:03:12,180 --> 00:03:14,610 So really discrete space in one dimension. 70 00:03:14,610 --> 00:03:17,460 We're working sort of on an array, one dimensional array 71 00:03:17,460 --> 00:03:20,190 or a vector where you have a bunch of cells 72 00:03:20,190 --> 00:03:24,660 next to each other that can each take a given state, right? 73 00:03:24,660 --> 00:03:26,550 Something like this. 74 00:03:26,550 --> 00:03:28,788 So already it sort of makes sense 75 00:03:28,788 --> 00:03:31,050 that we're gonna be leaning more 76 00:03:31,050 --> 00:03:34,470 on computational model and less so mathematical equations 77 00:03:34,470 --> 00:03:37,260 because that's a very natural data structure 78 00:03:37,260 --> 00:03:38,700 to represent in a code, right? 79 00:03:38,700 --> 00:03:41,520 An array or a vector or a list that contains 80 00:03:41,520 --> 00:03:45,153 all the possible spaces that our model can occupy. 81 00:03:46,350 --> 00:03:49,500 And then the parts of our system will be 82 00:03:49,500 --> 00:03:51,720 the cells of this array and they'll be able 83 00:03:51,720 --> 00:03:55,650 to take discrete states in the simplest possible case, 84 00:03:55,650 --> 00:03:57,570 simply zero or one. 85 00:03:57,570 --> 00:04:01,860 So we could call that off or on active or inactive. 86 00:04:01,860 --> 00:04:04,110 And then we'll have to specify the neighborhood 87 00:04:04,110 --> 00:04:05,790 because our rule set will now depend 88 00:04:05,790 --> 00:04:07,830 on the state of explicit neighbors. 89 00:04:07,830 --> 00:04:10,620 In this case, it makes sense that one array is connected 90 00:04:10,620 --> 00:04:12,480 to the two arrays next to it. 91 00:04:12,480 --> 00:04:14,700 So there's a symmetry, the left or right 92 00:04:14,700 --> 00:04:16,590 doesn't necessarily matter at first. 93 00:04:16,590 --> 00:04:19,233 You're connected to a neighbor on both side. 94 00:04:20,130 --> 00:04:22,170 And then we need to specify rules that govern 95 00:04:22,170 --> 00:04:23,793 the evolution of that system. 96 00:04:25,470 --> 00:04:26,610 Well, what are the rules? 97 00:04:26,610 --> 00:04:29,883 The rule set will have to specify something like this. 98 00:04:31,830 --> 00:04:34,080 If my cell and I'm the center cell 99 00:04:34,080 --> 00:04:37,290 or index cell in this picture, 100 00:04:37,290 --> 00:04:39,750 if my cell is on and I have two on neighbors 101 00:04:39,750 --> 00:04:43,023 maybe the rule set would say, well, you turn off, right? 102 00:04:44,430 --> 00:04:47,130 And that's like changing the state of the index cell only. 103 00:04:47,130 --> 00:04:49,110 So notice that in the output of this rule 104 00:04:49,110 --> 00:04:51,570 I don't specify what happens on the left and right. 105 00:04:51,570 --> 00:04:54,120 The idea is if I'm on and my two neighbors are on, 106 00:04:54,120 --> 00:04:55,230 I turn off, right? 107 00:04:55,230 --> 00:04:56,940 That could be overpopulation. 108 00:04:56,940 --> 00:04:59,580 I don't like it if there are too many on people around me 109 00:04:59,580 --> 00:05:01,680 or maybe I'm modeling something with a hipster effect. 110 00:05:01,680 --> 00:05:03,450 I wanna be different somehow. 111 00:05:03,450 --> 00:05:07,320 But one with two ones on on each side turns off, 112 00:05:07,320 --> 00:05:08,253 goes to zero. 113 00:05:10,020 --> 00:05:12,660 And really there's only a finite numbers 114 00:05:12,660 --> 00:05:14,370 of rules that we need to specify. 115 00:05:14,370 --> 00:05:16,890 So I could be on my neighbor to one side 116 00:05:16,890 --> 00:05:19,170 could be on and the other neighbor could be off 117 00:05:19,170 --> 00:05:21,150 in which case maybe I turn off. 118 00:05:21,150 --> 00:05:23,910 If my two neighbors are on and I'm off, I stay off. 119 00:05:23,910 --> 00:05:26,010 So really how many rules are there to specify 120 00:05:26,010 --> 00:05:30,000 where we have three cells that can either be zero or one. 121 00:05:30,000 --> 00:05:32,880 So two options for this one, two options for the middle one, 122 00:05:32,880 --> 00:05:34,530 two options for the last one. 123 00:05:34,530 --> 00:05:36,930 So that's two times, two times two options 124 00:05:36,930 --> 00:05:40,260 or eight rules that we need to specify. 125 00:05:40,260 --> 00:05:43,000 So here I'm giving one example of such a rule set 126 00:05:44,280 --> 00:05:47,400 but really each of the boxes at the end of every arrow 127 00:05:47,400 --> 00:05:49,800 could be either a zero or one. 128 00:05:49,800 --> 00:05:52,560 So essentially to specify 129 00:05:52,560 --> 00:05:54,750 these very simple spatially explicit models, 130 00:05:54,750 --> 00:05:59,750 all I need is eight numbers that are either zero or one. 131 00:06:00,180 --> 00:06:03,870 So two to the eight options for possible models. 132 00:06:03,870 --> 00:06:07,470 Because that first rule is either zero or one, two options. 133 00:06:07,470 --> 00:06:09,690 Two options for the second rule, two options for the third. 134 00:06:09,690 --> 00:06:12,000 So that's two times two times two times two 135 00:06:12,000 --> 00:06:16,590 times two times two times two times two or 256 models. 136 00:06:16,590 --> 00:06:17,760 I'm stressing this here 137 00:06:17,760 --> 00:06:21,000 because it's not that big of a number. 138 00:06:21,000 --> 00:06:25,500 We never thought about the space or the size of the ensemble 139 00:06:25,500 --> 00:06:27,600 of all possible models when talking 140 00:06:27,600 --> 00:06:31,050 about dynamical system in module one. 141 00:06:31,050 --> 00:06:34,890 But here, discrete state, simple spatially explicit model 142 00:06:34,890 --> 00:06:38,892 there are only 256 that we can explore, 143 00:06:38,892 --> 00:06:41,883 which is already very, very different. 144 00:06:43,650 --> 00:06:45,690 The question is whether those are interesting or not 145 00:06:45,690 --> 00:06:47,340 and that's a completely different question. 146 00:06:47,340 --> 00:06:50,520 But that's something we can explore, right? 147 00:06:50,520 --> 00:06:52,260 So that also means that we'll be ablet 148 00:06:52,260 --> 00:06:55,353 to represent these rule set as binary numbers. 149 00:06:56,640 --> 00:06:58,860 And if you are not familiar with binary number 150 00:06:58,860 --> 00:07:02,220 I invite you to watch the quick intro video, 151 00:07:02,220 --> 00:07:03,690 the bonus video that's on it. 152 00:07:03,690 --> 00:07:06,149 If you need a refresher, watch it as well. 153 00:07:06,149 --> 00:07:11,149 It's just to understand how binary numbers work 154 00:07:11,220 --> 00:07:12,660 to represent numbers. 155 00:07:12,660 --> 00:07:14,730 And so any sequence of zeros and one 156 00:07:14,730 --> 00:07:16,560 can be used to represent the number. 157 00:07:16,560 --> 00:07:19,410 And that means that we will be able to refer 158 00:07:19,410 --> 00:07:22,230 to these spatially explicit models 159 00:07:22,230 --> 00:07:24,720 by the number corresponding to their rule set. 160 00:07:24,720 --> 00:07:28,500 We can talk about model 121 or model 24 161 00:07:28,500 --> 00:07:31,683 and we'll see how to do that in the next few videos. 162 00:07:32,700 --> 00:07:35,040 This one, for example, is rule 30 163 00:07:35,040 --> 00:07:37,500 and I'm gonna show you what this model does 164 00:07:37,500 --> 00:07:40,320 at the end of the video and we'll go into greater details 165 00:07:40,320 --> 00:07:42,903 in the computational part of the week. 166 00:07:44,700 --> 00:07:48,623 And so the key part here is that these very simple 167 00:07:50,190 --> 00:07:53,440 or perhaps the simplest, especially explicit models 168 00:07:54,570 --> 00:07:57,690 take only 256 flavors. 169 00:07:57,690 --> 00:08:00,720 And so we'll refer to those as elementary CA 170 00:08:00,720 --> 00:08:03,120 or elementary cellular automata. 171 00:08:03,120 --> 00:08:05,970 They're cellular because they use discrete space 172 00:08:05,970 --> 00:08:07,670 and cells to represent the system. 173 00:08:08,790 --> 00:08:12,780 They're automata because this is a deterministic rule set. 174 00:08:12,780 --> 00:08:16,103 Give me the state of the system and I can update all cells 175 00:08:16,103 --> 00:08:20,190 at once and that's gonna give me a deterministic evolution. 176 00:08:20,190 --> 00:08:22,800 So they're like cellular robots in a way. 177 00:08:22,800 --> 00:08:25,560 And we call that these elementary because we'll be able 178 00:08:25,560 --> 00:08:28,571 to add complexity to them either by making 179 00:08:28,571 --> 00:08:32,520 the deterministic rule stochastic by growing space 180 00:08:32,520 --> 00:08:35,880 in two dimensions, by changing the size of the neighborhood 181 00:08:35,880 --> 00:08:39,333 or by adding states that the cells can take. 182 00:08:41,100 --> 00:08:43,560 And so in the next video, I'll show you how to code 183 00:08:43,560 --> 00:08:45,990 some of these elementary cellular automata. 184 00:08:45,990 --> 00:08:47,610 This is what comes out of the one 185 00:08:47,610 --> 00:08:48,540 that was just on the screen. 186 00:08:48,540 --> 00:08:52,170 It seems like trivial little choices of zeros and one. 187 00:08:52,170 --> 00:08:55,890 Some, but not all still have very complex behavior. 188 00:08:55,890 --> 00:08:58,440 And if anything, that's the main story 189 00:08:58,440 --> 00:09:01,260 behind cellular automata is that very simple 190 00:09:01,260 --> 00:09:04,350 local rules can give rise to very complex, 191 00:09:04,350 --> 00:09:07,800 interesting global behavior like the one on the screen now. 192 00:09:07,800 --> 00:09:09,990 So I invite you to join me in the next video 193 00:09:09,990 --> 00:09:14,990 where we'll be exploring the computational implementation 194 00:09:15,780 --> 00:09:16,613 of these models. 195 00:09:16,613 --> 00:09:18,190 So I'll see you in the next one.