Congratulations on surviving module one
and welcome to module two of modeling complex system.
In this module, we're gonna tackle models
with explicit structure, structure and space
which we did not have in module one
and for a very interesting reason.
So we're gonna try and build the simplest possible
spatially explicit models that we can.
And those will be called cellular automata.
And because those are two very hard words
to pronounce for me, we'll call them CA
and the error that we made, or it's not an error
but this choice that we made early on in module one
that sort of sent us towards the path
of dynamical system and away
from spatially explicit model was when we were building
our mechanisms, our putting parts of a system
in boxes and and describing mechanisms as arrows.
We made the approximation that these boxes and arrows
were telling a complete story about the state of the system.
And so we could write down equations
using a mean field approximation,
where a given neighbor of an individual
in a social network or a piece of land
next to a fox or shark or a fish
in the (indistinct)systems was just randomly chosen
based on the current state of the system.
We were assuming that things were well mixed,
randomized and that we could do a mean field approximation.
That approximation got rid of space
made so that our models assume that things were either
fully random or completely connected,
either of which doesn't have
any interesting spatial features.
So what we wanna do is go back
to the very basic elements of our modeling recipe
and try and avoid making that mean filled approximation.
We won't get explicit equations for now,
but we'll get very interesting models nonetheless
and models that will allow us to consider space.
So we want to think about ingredients
preparation of the system and its presentation, right?
So for spatially explicit models, the goal here
is no mean-field approximation,
and then we start from scratch.
So importantly, what this means is that
before the updates rule for a fish or susceptible individual
or any piece of our system was based on its own state
and the state of the system
and that mean field approximation
was taken care of the rest.
Here, we're gonna have to be sure
to specify update rules that depend
on the state of the parts
and on the state of their neighbors.
And that's how we're going to be able
to keep track of space.
All right, so we want to do the simplest possible case
of that where the mechanisms are not as simple
as S goes to I with some rate,
but depend on what's around the S individual, right?
So what are the ingredients
for the simplest possible case
of a especially explicit model?
Well, we're gonna make a a discrete time approximation
because that's often easier at first.
We're gonna also make a discrete space approximation
and then we're gonna be working in one dimension.
So really discrete space in one dimension.
We're working sort of on an array, one dimensional array
or a vector where you have a bunch of cells
next to each other that can each take a given state, right?
Something like this.
So already it sort of makes sense
that we're gonna be leaning more
on computational model and less so mathematical equations
because that's a very natural data structure
to represent in a code, right?
An array or a vector or a list that contains
all the possible spaces that our model can occupy.
And then the parts of our system will be
the cells of this array and they'll be able
to take discrete states in the simplest possible case,
simply zero or one.
So we could call that off or on active or inactive.
And then we'll have to specify the neighborhood
because our rule set will now depend
on the state of explicit neighbors.
In this case, it makes sense that one array is connected
to the two arrays next to it.
So there's a symmetry, the left or right
doesn't necessarily matter at first.
You're connected to a neighbor on both side.
And then we need to specify rules that govern
the evolution of that system.
Well, what are the rules?
The rule set will have to specify something like this.
If my cell and I'm the center cell
or index cell in this picture,
if my cell is on and I have two on neighbors
maybe the rule set would say, well, you turn off, right?
And that's like changing the state of the index cell only.
So notice that in the output of this rule
I don't specify what happens on the left and right.
The idea is if I'm on and my two neighbors are on,
I turn off, right?
That could be overpopulation.
I don't like it if there are too many on people around me
or maybe I'm modeling something with a hipster effect.
I wanna be different somehow.
But one with two ones on on each side turns off,
goes to zero.
And really there's only a finite numbers
of rules that we need to specify.
So I could be on my neighbor to one side
could be on and the other neighbor could be off
in which case maybe I turn off.
If my two neighbors are on and I'm off, I stay off.
So really how many rules are there to specify
where we have three cells that can either be zero or one.
So two options for this one, two options for the middle one,
two options for the last one.
So that's two times, two times two options
or eight rules that we need to specify.
So here I'm giving one example of such a rule set
but really each of the boxes at the end of every arrow
could be either a zero or one.
So essentially to specify
these very simple spatially explicit models,
all I need is eight numbers that are either zero or one.
So two to the eight options for possible models.
Because that first rule is either zero or one, two options.
Two options for the second rule, two options for the third.
So that's two times two times two times two
times two times two times two times two or 256 models.
I'm stressing this here
because it's not that big of a number.
We never thought about the space or the size of the ensemble
of all possible models when talking
about dynamical system in module one.
But here, discrete state, simple spatially explicit model
there are only 256 that we can explore,
which is already very, very different.
The question is whether those are interesting or not
and that's a completely different question.
But that's something we can explore, right?
So that also means that we'll be ablet
to represent these rule set as binary numbers.
And if you are not familiar with binary number
I invite you to watch the quick intro video,
the bonus video that's on it.
If you need a refresher, watch it as well.
It's just to understand how binary numbers work
to represent numbers.
And so any sequence of zeros and one
can be used to represent the number.
And that means that we will be able to refer
to these spatially explicit models
by the number corresponding to their rule set.
We can talk about model 121 or model 24
and we'll see how to do that in the next few videos.
This one, for example, is rule 30
and I'm gonna show you what this model does
at the end of the video and we'll go into greater details
in the computational part of the week.
And so the key part here is that these very simple
or perhaps the simplest, especially explicit models
take only 256 flavors.
And so we'll refer to those as elementary CA
or elementary cellular automata.
They're cellular because they use discrete space
and cells to represent the system.
They're automata because this is a deterministic rule set.
Give me the state of the system and I can update all cells
at once and that's gonna give me a deterministic evolution.
So they're like cellular robots in a way.
And we call that these elementary because we'll be able
to add complexity to them either by making
the deterministic rule stochastic by growing space
in two dimensions, by changing the size of the neighborhood
or by adding states that the cells can take.
And so in the next video, I'll show you how to code
some of these elementary cellular automata.
This is what comes out of the one
that was just on the screen.
It seems like trivial little choices of zeros and one.
Some, but not all still have very complex behavior.
And if anything, that's the main story
behind cellular automata is that very simple
local rules can give rise to very complex,
interesting global behavior like the one on the screen now.
So I invite you to join me in the next video
where we'll be exploring the computational implementation
of these models.
So I'll see you in the next one.