Simulating Competition and Logistic Growth - YouTube

Channel: Primer

[0]
we've seen how creatures that replicate
[2]
can have their numbers grow
[3]
exponentially without limit but in the
[6]
real world there are limits so a more
[8]
realistic growth curve would look
[10]
something like this sorry buddy
[14]
[Music]
[17]
as we've built up our model in the last
[19]
few videos we've been running
[20]
simulations where the computer steps
[22]
through time and at each time step it
[24]
decides which creatures live die and
[26]
reproduce according to certain odds and
[28]
we both an equation to help us predict
[31]
what we expect to happen from one
[32]
instant to the next in the simulation
[34]
the expected change in the number of
[36]
creatures is equal to the creatures
[38]
replication chance - its death chance
[40]
all times the current number of
[42]
creatures and we can graph this equation
[45]
to help us visualize our prediction the
[49]
most interesting case is when R is
[51]
greater than D for example with a
[53]
replication chance of 10% and a death
[55]
chance of 5% then this graph becomes a
[59]
straight line with a positive slope the
[61]
more creatures there are the more new
[63]
creatures we expect to appear from one
[64]
time to the next this leads to
[67]
exponential growth we went over this
[70]
pretty quickly but an earlier video in
[71]
the series called how to grow
[73]
exponentially it goes through in more
[74]
detail
[75]
ok so that's what the world looks like
[77]
when growth is completely unchecked but
[80]
what should it look like if we want
[81]
growth to level off at some point to
[84]
figure this out let's work backward we
[86]
want the population curve to look
[87]
something like this it's like an
[90]
exponential curve toward the beginning
[91]
but it levels out at a certain point at
[93]
50 creatures for the population to level
[97]
out here we need the expected change per
[99]
time step two go to zero when there are
[101]
50 creatures so this curve is going to
[103]
need to bend downward how can we change
[106]
the equation to make that happen
[108]
this function equation already gives us
[111]
Delta equals 0 when n is 0 but we want
[114]
Delta to also be 0 when n is 50 one way
[118]
to do this is to make the creatures more
[120]
likely to die when there are lots of
[122]
creatures around there's only so much
[123]
space and food in the environment so
[125]
when it's crowded a creature might
[127]
starve
[128]
to do this we'll leave the bass death
[130]
chance alone but we'll include an extra
[131]
term to adjust to the overall death
[133]
chance based on crowding what should
[136]
this term be well we want the term to be
[139]
small when there aren't many creatures
[140]
and we want it to be big when there are
[142]
a lot of creatures a simple way to
[144]
achieve this is to write it as the
[146]
current number of creatures multiplied
[148]
by a constant one and as small the
[150]
effect of carding will be small and when
[151]
and as large the effect will be large
[153]
let's call this constant the crowding
[156]
coefficient just to give it a short name
[157]
its value specifies how much the death
[160]
chance goes up for each creature when we
[162]
add a new creature so if the value is
[165]
say 0.001 that means adding another
[169]
creature increases the death chance of
[170]
all creatures by a tenth of a percent
[173]
the new creature is eating food and
[175]
taking up space so there's less to go
[177]
around for everyone else and when we
[179]
have a lot of creatures this term really
[180]
adds up and because I looked ahead when
[183]
picking these numbers a crowding
[184]
coefficient of 0.001 does cause Delta to
[189]
be zero when n is 50 this is because the
[191]
death chance when adjusted for crowding
[193]
becomes equal to the replication chance
[195]
for creature
[196]
so each creature is just as likely to
[197]
die as it is to reproduce the
[199]
replication and death chances balance
[201]
each other up and we found equilibrium
[203]
again to give you some of the usual
[206]
terminology this equilibrium number is
[207]
called the carrying capacity because
[209]
it's the largest number of creatures
[211]
that the environment can sustainably
[212]
support and this number over time curve
[215]
is called a logistic growth curve as
[218]
opposed to an exponential growth curve
[220]
now that we've decided how to tweak the
[223]
equation and seen how it affects the
[225]
graph let's double check that this
[226]
actually does predict this s-shaped
[228]
logistic growth curve when n is small
[231]
the Delta curve is pretty similar to
[233]
that upward sloping line from the
[235]
exponential case so we'll expect the
[237]
population to look like it's growing
[239]
about exponentially at first in this
[242]
middle region the Delta curve is near
[244]
its maximum and it's mostly horizontal
[246]
so the overall expected growth rate
[248]
doesn't change much the growth rate is
[250]
still high but it's just not speeding up
[252]
anymore
[253]
and finally in this last region the
[256]
growth rate is actually slowing down
[257]
towards zero so we'll expect the
[259]
population to level off and if n goes
[262]
above the carrying capacity which again
[263]
is an equilibrium number the growth rate
[265]
goes negative pushing n back down all
[269]
right let's run a simulation to see
[270]
whether this prediction works it sort of
[277]
works and remember this is all based on
[280]
chance though so to really see how good
[282]
this prediction is we need to look at
[283]
many simulations at once next let's look
[289]
at what happens if new kinds of
[290]
creatures appear through mutation this
[293]
green creature will come out of 1% of
[295]
Blues replications and it'll be slightly
[297]
less good at replication than the blue
[299]
creatures with a replication chance of
[301]
8% but its replication chance is still
[303]
higher than its death chance and this
[306]
orange creature will also come out of 1%
[308]
of glues replications and this one will
[310]
have a lower death chance all three of
[313]
these creatures will share the same
[314]
resources so their Delta equations would
[316]
have a crowding term that includes the
[318]
total number of all kinds of creatures
[321]
if we start a simulation with a few blue
[324]
creatures how do you expect things to go
[329]
[Music]
[334]
as you might have guessed orange
[336]
eventually takes over it's not enough
[338]
anymore for blue to be good at surviving
[340]
in isolation it now needs to be better
[342]
than its competitors to maintain numbers
[345]
one surprising thing in this simulation
[347]
is that Green is doing better than blue
[349]
after 500 time steps you wouldn't expect
[352]
that since it has the worst stats of all
[354]
the creatures but this is a good example
[355]
of how luck is a big part of you
[357]
involving systems the most likely
[359]
outcome doesn't always happen alright
[363]
that's it for the fundamentals of
[364]
limited growth and competition but
[366]
before we say goodbye in this video
[368]
let's take stock of where we are we've
[370]
seen how replication can lead to
[372]
exponentially growing populations we've
[375]
seen how mistakes and replication can
[377]
lead to new kinds of creatures leading
[379]
to diversity and just now we saw how a
[382]
finite pool of resources puts a cap on
[384]
populations and causes competition
[386]
between different types of creatures
[388]
replication mutation and competition
[390]
make up the core of evolution anywhere
[393]
replicators exist even if there's life
[395]
on other planets everything we've said
[397]
so far would apply we're not done yet
[399]
though so far we've been making all the
[401]
decisions ourselves you could say that
[403]
we've been artificially selecting
[405]
successful creatures in the next video
[408]
we'll let go of the reins and let the
[409]
selectmen happen a bit more naturally
[411]
see you then
[418]
[Music]
[431]
[Music]