1 00:00:00,690 --> 00:00:01,523 Welcome back. 2 00:00:01,523 --> 00:00:03,103 I just wanna make another short video 3 00:00:03,103 --> 00:00:07,530 about Solar Automata showing you an example of a code 4 00:00:07,530 --> 00:00:10,480 that we developed in a life coding experiment 5 00:00:11,945 --> 00:00:13,350 in the last edition of modeling complex systems. 6 00:00:13,350 --> 00:00:15,810 Hopefully we'll have some times to do interactions 7 00:00:15,810 --> 00:00:17,550 like this as well. 8 00:00:17,550 --> 00:00:20,043 So let me share my workstation with you. 9 00:00:21,150 --> 00:00:24,210 So you should now be seeing a beautiful painting 10 00:00:24,210 --> 00:00:25,740 by Marc-Aurele Fortin, 11 00:00:25,740 --> 00:00:27,450 which is my usual background. 12 00:00:27,450 --> 00:00:28,923 Let me just bring this over. 13 00:00:30,690 --> 00:00:34,260 So as I said, this is a life coding exercise 14 00:00:34,260 --> 00:00:36,990 that was done with the group 15 00:00:36,990 --> 00:00:39,963 from modeling complex systems in the fall of 2019. 16 00:00:42,120 --> 00:00:46,380 Someone in the group was interested in modeling the spread 17 00:00:46,380 --> 00:00:49,053 of different words for different things. 18 00:00:49,950 --> 00:00:51,123 So essentially, 19 00:00:53,220 --> 00:00:58,220 here we were looking at soft drinks, which I call, liquor 20 00:01:00,720 --> 00:01:03,930 and in the US people will call soft drinks tonic apparently? 21 00:01:03,930 --> 00:01:07,743 That's one Coke, soda or pop which I also like. 22 00:01:08,672 --> 00:01:10,350 And then we want to know 23 00:01:10,350 --> 00:01:12,270 how might these different terms 24 00:01:12,270 --> 00:01:14,610 for the same thing spread spatially. 25 00:01:14,610 --> 00:01:17,350 So we're gonna do a CA, where we're gonna be thinking 26 00:01:19,212 --> 00:01:20,045 about every spot as a household 27 00:01:20,045 --> 00:01:21,818 like a family that could live somewhere. 28 00:01:21,818 --> 00:01:22,980 And we're gonna say 29 00:01:22,980 --> 00:01:27,960 that when a family adopts a language, it keeps it forever. 30 00:01:27,960 --> 00:01:30,270 But when a new family emerges 31 00:01:30,270 --> 00:01:32,883 it will adopt the language of the local majority. 32 00:01:35,280 --> 00:01:37,768 So we will be starting 33 00:01:37,768 --> 00:01:40,320 with uniform or adult initial conditions. 34 00:01:40,320 --> 00:01:41,850 That's our initialization. 35 00:01:41,850 --> 00:01:45,150 So it's still a grid 256 by 256. 36 00:01:45,150 --> 00:01:48,067 Our population initially is a bunch of zeros. 37 00:01:48,067 --> 00:01:53,067 Then I have some figure color scheme elements here as well. 38 00:01:55,260 --> 00:01:57,450 I'm gonna be observing. 39 00:01:57,450 --> 00:01:59,580 And that's the O part of our I O U. 40 00:01:59,580 --> 00:02:01,620 I'm gonna be observing the number of zeros 41 00:02:01,620 --> 00:02:03,600 the number of one, twos, three, and four. 42 00:02:03,600 --> 00:02:06,480 So remember those are my five discrete states. 43 00:02:06,480 --> 00:02:11,100 Actually there is six 'cause there will be available houses. 44 00:02:11,100 --> 00:02:15,000 But what these numbers represent is zero for pop 45 00:02:15,000 --> 00:02:16,440 one for soda, two for Coke 46 00:02:16,440 --> 00:02:18,390 three for tonic and four for soft drink. 47 00:02:18,390 --> 00:02:20,820 I like keeping a dictionary 48 00:02:20,820 --> 00:02:23,460 of what the integer values mean 49 00:02:23,460 --> 00:02:24,910 in terms of the model states. 50 00:02:26,173 --> 00:02:30,318 Then we'll have a stochastic process. 51 00:02:30,318 --> 00:02:34,518 So we're gonna say that our discrete time unit is a decade. 52 00:02:34,518 --> 00:02:37,020 Family moves once a decade. 53 00:02:37,020 --> 00:02:39,450 Actually what it moves is just a death process. 54 00:02:39,450 --> 00:02:41,220 We remove that family 55 00:02:41,220 --> 00:02:44,400 from the system and it's gonna be a unoccupied house. 56 00:02:44,400 --> 00:02:47,610 So that's a sixth state in the system 57 00:02:47,610 --> 00:02:50,643 which I believe will be given the state minus one. 58 00:02:54,648 --> 00:02:55,553 So let me just note that down. 59 00:02:57,133 --> 00:02:58,853 Have all houses have state minus one. 60 00:03:00,240 --> 00:03:01,590 Then there will be a birth rate 61 00:03:01,590 --> 00:03:05,223 which will fix to one but won't always be used. 62 00:03:06,150 --> 00:03:10,410 There is a hipster effect that was introduced late. 63 00:03:10,410 --> 00:03:12,390 Once you have a model, that's the fun thing you can 64 00:03:12,390 --> 00:03:14,850 you can play with very different mechanisms 65 00:03:14,850 --> 00:03:17,160 but I won't use the hipster effect for now. 66 00:03:17,160 --> 00:03:20,670 This was just houses that thought they were cool and instead 67 00:03:20,670 --> 00:03:22,740 of adopting the language of the majority would just 68 00:03:22,740 --> 00:03:26,170 picked whatever is the least popular term going around. 69 00:03:26,170 --> 00:03:29,580 And then for every time step, what we're gonna do 70 00:03:29,580 --> 00:03:32,400 and here I'm using mesh tool notation to make it 71 00:03:32,400 --> 00:03:34,620 a little faster for MATLAB. 72 00:03:34,620 --> 00:03:36,600 So I'm drawing N by N. 73 00:03:36,600 --> 00:03:40,410 So for every house in my system, I'm drawing a random number 74 00:03:40,410 --> 00:03:43,170 and I get a matrix of random numbers. 75 00:03:43,170 --> 00:03:46,200 If at a given location that random number is smaller 76 00:03:46,200 --> 00:03:49,810 than death, so smaller than 0.1, my death parameter 77 00:03:50,760 --> 00:03:53,940 then I set the value of that cell to minus one. 78 00:03:53,940 --> 00:03:56,518 So in one line, I'm essentially going 79 00:03:56,518 --> 00:03:59,430 over every cell, drawing a random number 80 00:03:59,430 --> 00:04:00,480 between zero and one. 81 00:04:00,480 --> 00:04:02,910 If it's smaller than my death probability, 82 00:04:02,910 --> 00:04:06,333 I assign that cell a value of minus one. 83 00:04:07,691 --> 00:04:11,670 Then for every cell what these crazy lines are doing 84 00:04:11,670 --> 00:04:13,293 is looking at neighbors. 85 00:04:14,877 --> 00:04:19,473 Let's see, below them, to the right. 86 00:04:22,263 --> 00:04:23,096 What is this? 87 00:04:26,490 --> 00:04:28,450 To the left and above 88 00:04:29,490 --> 00:04:34,490 Yes, to the left and I'm, I'm getting confused 89 00:04:34,800 --> 00:04:36,700 but this is what these are doing here. 90 00:04:37,620 --> 00:04:42,620 The second dimension is in MATLAB is the row. 91 00:04:42,960 --> 00:04:47,010 So this would be, this would be to the left. 92 00:04:47,010 --> 00:04:49,590 And here we have, we have periodic boundaries 93 00:04:49,590 --> 00:04:50,850 which is what I wanted to point out. 94 00:04:50,850 --> 00:04:53,566 So we look at to the left, we look at to the right 95 00:04:53,566 --> 00:04:57,453 and below and above and again periodic boundaries. 96 00:04:58,295 --> 00:05:02,994 Okay? So we look everywhere and we count the number 97 00:05:02,994 --> 00:05:06,450 of neighbors in every cell that are equal 98 00:05:06,450 --> 00:05:08,370 to 0, 1, 2, 3, and four. 99 00:05:08,370 --> 00:05:11,040 So we now have five matrices that tell us 100 00:05:11,040 --> 00:05:13,620 for every cell how many neighbors 101 00:05:13,620 --> 00:05:17,910 in this four neighborhood are in a given state. 102 00:05:17,910 --> 00:05:20,917 And then if that cell is currently unoccupied, then we 103 00:05:20,917 --> 00:05:22,683 we pick this. 104 00:05:23,852 --> 00:05:24,685 This is like a bad way to code it up, 105 00:05:24,685 --> 00:05:26,040 but this is all life coding. 106 00:05:26,040 --> 00:05:28,710 This was all done with the students life 107 00:05:28,710 --> 00:05:30,630 and this is how we did it. 108 00:05:30,630 --> 00:05:35,340 So then if you're available to be repopulated 109 00:05:35,340 --> 00:05:37,500 you're populated by whatever is the majority. 110 00:05:37,500 --> 00:05:40,260 Note that there are no like greater than or equality 111 00:05:40,260 --> 00:05:43,590 which means that if there is a tie, you stay unavailable 112 00:05:43,590 --> 00:05:46,980 an undecided family until the tie is broken. 113 00:05:46,980 --> 00:05:48,450 And then we're gonna plot two things. 114 00:05:48,450 --> 00:05:49,770 We're gonna plot the numbers 115 00:05:49,770 --> 00:05:51,570 of zeroes, one, two, threes, and four. 116 00:05:51,570 --> 00:05:54,093 And we're gonna plot the state of the system. 117 00:05:59,670 --> 00:06:02,687 So we have the evolving number of 118 00:06:02,687 --> 00:06:04,380 zeros, one, two, three, and fours 119 00:06:04,380 --> 00:06:07,680 and the state of the system in the bottom figure here. 120 00:06:07,680 --> 00:06:09,720 So I've assigned them all a color 121 00:06:09,720 --> 00:06:14,720 I've chosen a little psychedelic camo color scheme 122 00:06:15,000 --> 00:06:16,700 and I'm letting the system evolve. 123 00:06:18,270 --> 00:06:20,700 Know that I start with random initial condition. 124 00:06:20,700 --> 00:06:24,120 I have a big system, they all start, you know 125 00:06:24,120 --> 00:06:28,110 close together and yet sometimes they can cross. 126 00:06:28,110 --> 00:06:32,490 So green, which is my number of fours 127 00:06:32,490 --> 00:06:35,999 which means people using soft drinks was initially, 128 00:06:35,999 --> 00:06:40,290 at some point lower than reds, which is my number of zeros. 129 00:06:40,290 --> 00:06:41,310 So people using pop. 130 00:06:41,310 --> 00:06:42,450 So I'm a big fan of pop 131 00:06:42,450 --> 00:06:45,720 but it got overtaken through stochastic effect 132 00:06:45,720 --> 00:06:48,660 or through geometrical effect in the structure, 133 00:06:48,660 --> 00:06:51,466 got overtaken by soft drink. 134 00:06:51,466 --> 00:06:53,260 And now it decays 135 00:06:54,489 --> 00:06:56,864 And it seems like some of them, yellow and blue 136 00:06:56,864 --> 00:07:01,864 which are respectively threes and ones meaning tonic 137 00:07:02,220 --> 00:07:05,613 and soda are getting real popular here. 138 00:07:08,820 --> 00:07:12,040 And then what's going on here at in the bottom is 139 00:07:13,126 --> 00:07:14,700 that we're sort of stabilizing around neighborhoods. 140 00:07:14,700 --> 00:07:16,650 Neighborhoods that use a fixed language. 141 00:07:16,650 --> 00:07:20,117 Even though we started with a complete mess, right? 142 00:07:22,470 --> 00:07:26,550 And I can start this, I'm drawing new values here 143 00:07:26,550 --> 00:07:28,500 like look how much of a mess it started 144 00:07:29,650 --> 00:07:30,483 with and then it's self-organized 145 00:07:30,483 --> 00:07:32,433 into sort of stable neighborhood. 146 00:07:34,770 --> 00:07:35,603 Okay? 147 00:07:41,088 --> 00:07:46,088 I will go back to the code and put back that hipster rule. 148 00:07:52,980 --> 00:07:56,730 So remember what the hipster rule is saying is 149 00:07:56,730 --> 00:08:01,170 that with small value, one in a percent of new family 150 00:08:01,170 --> 00:08:05,100 if there are hipsters and we're saying 151 00:08:05,100 --> 00:08:10,100 that if everyone, oh actually okay, I couldn't remember. 152 00:08:13,230 --> 00:08:15,660 The hipster mechanism means that with a small value 153 00:08:15,660 --> 00:08:17,560 if you're currently saying a word 154 00:08:18,482 --> 00:08:19,920 and all your neighbors are saying the same word 155 00:08:19,920 --> 00:08:23,040 you just switch and you switch to the coolest value. 156 00:08:23,040 --> 00:08:26,400 And the coolest value is just the most rare value, right? 157 00:08:26,400 --> 00:08:30,150 So real hipsters, I'm gonna bring back my figures here 158 00:08:30,150 --> 00:08:31,350 figure one at the bottom 159 00:08:32,700 --> 00:08:37,083 and now I'm gonna run it with this hipster mechanism. 160 00:08:39,240 --> 00:08:41,220 And usually what a hipster mechanism 161 00:08:41,220 --> 00:08:46,220 like this does is stabilize any initial inequalities 162 00:08:47,400 --> 00:08:51,060 or any geometrical inequalities and help like make sure 163 00:08:51,060 --> 00:08:53,370 that no one term or 164 00:08:53,370 --> 00:08:56,970 or no strategy or no collar takes over the others. 165 00:08:56,970 --> 00:08:59,610 So now they're all getting really close to 20% 166 00:08:59,610 --> 00:09:01,620 which is perfect split. 167 00:09:01,620 --> 00:09:03,190 We're just below 20% because 168 00:09:04,264 --> 00:09:06,270 at any given time there are some unoccupied houses. 169 00:09:06,270 --> 00:09:08,760 So sales in the minus one state 170 00:09:08,760 --> 00:09:11,220 but we're still getting this neighborhood effect 171 00:09:11,220 --> 00:09:14,493 just people's changing randomly and stabilizing the system. 172 00:09:19,530 --> 00:09:20,363 Okay. 173 00:09:23,400 --> 00:09:25,800 The last thing I wanna show you is 174 00:09:25,800 --> 00:09:28,860 that this model was made a little complicated 175 00:09:28,860 --> 00:09:31,560 at first, sort of by design students. 176 00:09:31,560 --> 00:09:32,970 I mean we had a diverse group 177 00:09:32,970 --> 00:09:34,890 and people had a lot of words in mind. 178 00:09:34,890 --> 00:09:35,723 I'm still not sure 179 00:09:35,723 --> 00:09:39,170 that tonic is a word for soft drink, but it was mentioned. 180 00:09:39,170 --> 00:09:44,170 One thing we can do is say 181 00:09:44,280 --> 00:09:47,583 really the only common ones are soda and coke. 182 00:09:48,570 --> 00:09:52,860 So pop is very cool, but not that common around here. 183 00:09:52,860 --> 00:09:55,140 Tonic, never heard that in my life. 184 00:09:55,140 --> 00:09:58,953 Soft drink sounds like an old person, which is fine. 185 00:10:00,060 --> 00:10:02,913 So we're just gonna put the birds of those terms to zero. 186 00:10:04,488 --> 00:10:06,888 And for this I'll remove the hipster rule again. 187 00:10:08,040 --> 00:10:13,040 Basically what I want is for pop, tonic 188 00:10:13,080 --> 00:10:16,230 and soft drinks to be phased out of the population quickly. 189 00:10:16,230 --> 00:10:17,220 They won't come back. 190 00:10:17,220 --> 00:10:19,442 And really we just want to look 191 00:10:19,442 --> 00:10:21,060 at the interplay between soda and coke. 192 00:10:21,060 --> 00:10:23,250 So two terms, two colors only. 193 00:10:23,250 --> 00:10:24,850 So we start with a lot of colors 194 00:10:25,840 --> 00:10:26,673 but we end up with just green and blue. 195 00:10:26,673 --> 00:10:27,506 This is a nice mix. 196 00:10:29,130 --> 00:10:32,190 Obviously I made a mistake 197 00:10:32,190 --> 00:10:34,530 and I haven't matched my colors correctly. 198 00:10:34,530 --> 00:10:38,340 So I'm not sure which color black 199 00:10:38,340 --> 00:10:41,160 and the top figure refers to versus the bottom figure. 200 00:10:41,160 --> 00:10:45,450 Well what's very cool is that we find this stripe 201 00:10:45,450 --> 00:10:47,956 pattern that emerges any set, any island. 202 00:10:47,956 --> 00:10:49,680 So like this green island 203 00:10:49,680 --> 00:10:52,710 and the blue sea are slowly getting eroded. 204 00:10:52,710 --> 00:10:54,400 Similarly, blue island 205 00:10:55,791 --> 00:10:57,660 and a green sea are getting eroded and disappearing. 206 00:10:57,660 --> 00:11:00,900 And what we're gonna be left with is just continuous patches 207 00:11:00,900 --> 00:11:03,240 of green, why continuous patches of green? 208 00:11:03,240 --> 00:11:04,860 Because we have created boundaries 209 00:11:04,860 --> 00:11:07,083 and one continuous patch of blue. 210 00:11:08,220 --> 00:11:12,012 So the model we ended up creating sort of 211 00:11:12,012 --> 00:11:16,500 accidentally to model something fun 212 00:11:16,500 --> 00:11:19,596 like the spread of words to describe soft drinks. 213 00:11:19,596 --> 00:11:22,813 We ended up like creating a model that would be 214 00:11:22,813 --> 00:11:25,290 cool to explain something like patterns on a leopards 215 00:11:25,290 --> 00:11:29,623 or something like creates interesting patterns and 216 00:11:32,700 --> 00:11:34,560 and that's one of the things we'll see time 217 00:11:34,560 --> 00:11:36,951 and time again is this course is 218 00:11:36,951 --> 00:11:39,429 that once you get an intuition for what modeling does what 219 00:11:39,429 --> 00:11:42,300 this wasn't purely coincidental, I can like 220 00:11:42,300 --> 00:11:45,300 guide the class to like rediscover classic models. 221 00:11:45,300 --> 00:11:47,400 Maybe they were invented in the context 222 00:11:47,400 --> 00:11:49,920 of evolutionary biology and pattern formation 223 00:11:49,920 --> 00:11:52,060 but we can rediscover them 224 00:11:52,951 --> 00:11:54,923 in the context of soft drinks and funny words. 225 00:11:56,700 --> 00:11:58,380 So if you have any question about this model 226 00:11:58,380 --> 00:12:00,720 or if you want to get access to this code, just let me know. 227 00:12:00,720 --> 00:12:02,040 I'll be happy to just share it 228 00:12:02,040 --> 00:12:04,500 with anyone and hopefully we can play around 229 00:12:04,500 --> 00:12:07,350 with some models on our own and start brainstorming 230 00:12:07,350 --> 00:12:11,550 about other cool things to do with these cellular cataratas. 231 00:12:11,550 --> 00:12:13,290 I'll see you soon in discussion groups. 232 00:12:13,290 --> 00:12:14,123 Bye.