Simulating Natural Selection


This video is about natural selection. If you’ve watched the previous videos in this series, you’ve seen these blob creatures live, die, and replicate; but it’s been a little bit artificial. We just gave each type of creature a replication chance and a death chance and we saw what happened. With natural selection though, we usually can’t know precise replication and death chances. Instead, selection comes from interactions between a creature’s traits and its environment. So in this video we’re going to make a real evolving system by putting our blob creatures into a simple environment and giving them traits. Let’s see what we can learn by watching some actual natural selection happen. Alright so what does our environment look like? Creatures will live on this plane, and each morning, food appears on the plane and the blobs emerge from their homes around the edge to go out and eat the food. Here are the rules: if a blob fails to find any food before running out of energy, it will die. If a blob gets one piece of food and manages to get back home to the edge, it will live on to the next day. And, if a blob gets two pieces and gets home, it will survive to the next day and also replicate, adding another creature to the next day. So that’s the environment. Before we talk about a creatures traits and how they might vary, let’s just watch these creatures live their lives for a few generations. So we see that these creatures can manage to live over several generations in this environment and The number of creatures actually expanded over the first few days and then leveled off. So the population started out below the carrying capacity but once the population expanded to around 95, the creatures really had to compete with each other for food. Once we allow mutations, the variation will give some creatures an advantage and we’ll start seeing some natural selection of traits. So let’s turn on mutations and see what happens. Let’s start out with one trade varying: speed. Each time a creature replicates, there’s a chance that a mutation will give the new creature a slightly lower or slightly higher speed. Speed is great because it allows you to beat other creatures to the food; but speed will also have a cost: moving quickly is less efficient. If a creature speed is doubled, it will cover a distance in half the time but use twice as much energy to go that distance. Faster creatures can’t forage over as much ground as slower creatures, so they might not find food before running out of energy. If we unpause this world with speed mutations turned on, what would you predict? When the faster creatures start appearing, will they sprint to victory? Or will the slower creatures prove the virtue of patience? It could also turn out that the current creatures have struck a good balance, or it could be that being fast and being slow are both good strategies; it’s hard to say at this point. We’ll just have to unpause and see what the nature of the situation is. Let’s speed it up a bit so we can see more generations. All right, so it turns out to be worth sacrificing efficiency for speed in this environment. Or, at least the initial speed value I picked was slower than optimal. This is our first example of natural selection. We didn’t know the best speed value going in, but the creatures mutated and somewhat randomly tried out different speed values, and then through natural selection the population evolved to have a higher average speed over time. I want to double down on that last point: the *population* evolved. As much as we all love Pokemon, individuals don’t evolve in the biological sense of the word. Populations evolve over generations. One interesting thing to notice is that as the average speed of the population went up, the number of creatures in any given day tended to go down. The creatures now compete more fiercely and are less efficient overall. This is part of the meaning of the term “Selfish Gene”. We’ll talk more about genes and the term “Selfish Gene” in future videos, but for now just notice that even though we might call these creatures better because they did better in the competition for survival, the total population size actually went down. Selection didn’t happen for the good of the species as a whole, but again, more on that in future videos. Alright, now that we’ve gotten our feet wet with one varying trait, let’s add two more: size and sense. First, size. Size scales the creature in all three dimensions. The benefit of size is that it lets you eat other creatures if you’re at least 20% larger than them. Getting an extra food source is great if you can pull it off, but being big costs a lot of energy. The energy cost depends on the cube of a creature size value I could have picked any function for the energy cost I suppose, but I made it a cube because volume scales as the cube of length, and volume is closely linked to the mass a creature has to carry around. The total energy cost of a creature’s movement each time step is equal to the cube of the creature’s size times the square of the creatures speed from before, which you might notice is reminiscent of the formula for kinetic energy. But anyway, it’s especially costly to be both big and fast. And, on top of this cost, smaller creatures will actually run from creatures big enough to eat them. So, to benefit from being big, you need at least some speed. Long story short, being big is high-risk and high-reward. The third trait is sense. Each creature has a certain sensing distance at which it can sense food or other creatures. Once a creature sees food or a smaller creature, it can move straight toward it. Or, if it sees a bigger creature it can run away. This sensing distance gets larger as a creature’s sense rate goes up, allowing it to avoid danger and be more efficient with its movements. Each time step, a creature pays a movement energy cost which depends on its size and speed, and a sensing energy cost which is just equal to its sense rate. All right, so now that we have three traits, let’s rewind to before we turned on speed mutations, and instead, turn on mutations for all three traits. To keep track of what’s happening to all three traits at once, we’re going to use this three dimensional graph. Each dot in the graph represents one creature, and the position of the dot depends on the speed, size, and sense values for that creature. All right, let’s see how it goes. So what can we say about the results? The first thing I notice is that the average speed is significantly different from what it was when only speed was allowed to vary, which is a little bit surprising because we didn’t explicitly change anything about how speed works. But with sense and size able to vary, different creatures were able to appear. A creature’s environment includes all the creatures around it, and for whatever reason, speed just wasn’t as valuable this time around. And there’s one other thing I noticed: when I first ran the simulation, I thought there would be a pretty intense selection toward creatures with higher sense, because sense informs everything else that creature does and it doesn’t cost very much. But instead, sense is fairly spread out and centered roughly around the starting value. That’s the thing about natural selection. It doesn’t care what I or anyone else thinks is best. It. Just does what it does. All right, one last simulation. Let’s see what happens if we change the environment more explicitly. Let’s go to ten food each day. It’s pretty clear that this won’t be able to support the population of about 50 creatures we currently have, so the number of creatures will go down. But what else will happen? I don’t know. We’ll just have to see. Hm. Okay, well, apparently, the creatures that thrived with 100 food just aren’t able to cut it with only ten, even though there should be enough for, say, five to ten creatures. So it looks like if it’s going to be possible to survive with only ten food, there’s gonna have to be some time for the population to adjust. So instead, let’s do this: we’ll rewind to before we reduce the food and then every two days we’ll put out one less piece of food until eventually we’re only putting out 10 pieces of food each day. All right… So it’s not too surprising that in a lower food environment, things aren’t just crowded and being big just isn’t worth it anymore. Sense, on the other hand, became super valuable now that a low sense creature can easily go a whole day without seeing anything, and die. And now speed is actually really valuable again. This surprised me actually; I thought in a sparse environment that efficiency would be king, making both size and speed go down, but apparently speed is actually more valuable now. So again, I can’t predict it. So other than reiterating the fact that I don’t know what’s going to happen, what can this teach us? Well, to put it plainly: the environment matters. A lot. Reducing the amount of food didn’t just reduce the number of creatures; it totally changed which creatures exist. You’ll often see evolution depicted as this march toward more and more advanced or complex or higher creatures, but that’s not how it is at all. The only thing that matters is how well the creature is adapted to its environment. Okay, so, before we go, let’s do a quick recap: Even with this relatively simple environment we created, we were able to see some important principles in action. But we’re not done yet. In the next few videos, we’ll keep exploring natural selection by trying to see how some more complicated and even counterintuitive traits can be favored. See you then!

100 thoughts on “Simulating Natural Selection

  1. If you're about to leave a comment saying that faster creatures aren't actually less efficient, read this first. I presented that part a bit strangely.

    At 2:14, I say moving quickly is less efficient, giving the example of a creature moving a unit distance in half the time, using twice the energy. Then, at 4:53, I show a formula for the energy cost per unit time, which depends on the square of the creature's speed.

    I gave distance per time, energy per time, and distance per energy at separate parts of the video, and that was confusing.

    So here's a more explicit summary.
    If we double a creature's speed…
    – its distance per time is doubled (the definition of speed)
    – its energy per time is quadrupled (because it depends on the square of speed)
    – its distance per energy is halved: (2x distance per time) / (4x energy per unit time)

    That last bullet is the "efficiency" from the video. With its starting energy for a day, a 2x-speed creature can only travel half the distance.

  2. Is this an actual game or just an animation? I hope I can do my own little experiments, it seems very interesting.

  3. I feel so smart watching this but 10 minutes later i go back to ignorance by slamming my hand on the desk when raging at a video game while yelling "ooga booga"

  4. Natural selection is a scale that can be tipped to ones favor. There has to be a balance at the same time much like the over population of dear in yellow stone, I recommend to look for a video on how wolves helped the ecosystem there. The thing is if you have to many herbivores you lose a lot more than just grass. And if later on screws with the chain of life. It all looks good in your simulation but the factors need to be much more wide spread. This is a very controlled experiment clearly and is hard to actually base it on life. Great job on your edit and hard work though it looks really well made.

  5. We see this theory in practice on Earth, see Madagascar, although being a Large Island, its isnt large enough to maintain big mamals, look theres only small mamals…

  6. The reason why sense has a high amount of variance is because there are tradeoffs. Having a high amount of sense is great for big creatures because it means they can see the smaller creatures, but having too much sense when you're small and slow means wasting your time running from things that are going to kill you, and running from things that perhaps aren't a threat. Smaller, slower creatures need to only focus on what's in front of them basically and rely on luck and efficiency in order to survive rather than dominating the food chain. This is kinda how things operate today, with slower creatures mostly burrowing into the ground.

  7. Real natural selection is saying use a fork to straighten out your plugs to 1st grade kids and see who was smart enough to survive

  8. I wonder what would happen if a more intelligent creature took home two pieces of food and saved it for tomorrow instead of reproducing.

  9. A lesson in physics from someone who knows nothing about physics. Big Bang Theory is religion not science. Invented by a priest working with his pope. Sound like science to you? If it does, that's because you're a Christian who believes in fairies, Peter Pan and Tinkerbell. Not science.

  10. Awesome video aside, I now want to make my own blobs in Blender and animate them! It's both inspiring and weird thinking evolution led to this 😅

  11. This may be a good base for atheism. Natural selection, selfish gene, evolution.
    I loved the simulation though.

  12. Speed becomes more valuable in a low food environment, being slower may be more efficient, but not when theirs 10 food and 11 creatures and they can eat before you leave the house.

  13. Random positions for the food and spawning point of individuals make this unfair, that could be avoided by just not randomizing (couple less code lines, so very unfortunate)

  14. Now all you need is genetic drift playing a larger part and you've got an even more correct simulation of evolution in the neutral theory of molecular evolution.

  15. excuse me what about friendliness and memory if it were to have good memory, it would know where the food forms, and what about food chance for each spot, you would need to add a grid for this
    and what about mountains and hills and valleys making food harder to get

  16. Pokemon = evolution
    reality = adaptation
    he spells this out super clearly…
    so why is evolution taught as if its a law, seems more a lie than law…
    hmmm

  17. Population evolve because your simulation doesnt includes a individual that can adapt, only will reproduce with a mutation. But the human can adapt without the need of a next generation mutation. And more: There are theories that the human receive mutations in own living life.

    And the key of survive is feedback. So we must pay too much attention and take care of how to put food and where. You can have two places of two kind or amount of food.

    If you have a place with plenty of food and another one with less food you can observe interesting behaviours.
    Will the creatures from the place with less food evolve to eat the others in the place with a lot of food?

  18. Seems a fine simulation of natural selection. Notably, living animals try to adapt to their environment, too. Bears didn't need to evolve to eat out of garbage cans, they already had all the capabilities, and just intelligently did what seemed best.

  19. this makes a poor representation of natural selection because some creatures make 'illogical' decisions that just work, this isn't much more then a poor basis for a math equation that just doesn't functionally successfully apply to anything

  20. I'm french. I hate maths. I don't truly understand what this guy say. But the blobs are so cute, i want to watch it eat forever.

  21. Another interesting discovery was made here; if the environment changes rapidly, the odds of extinction go up. It's not that there wasn't room for a population in the lower food environment, or that the population couldn't optimize for the lower food environment, but that the change was too drastic and there wasn't time to adjust before extinction occurred. That, I think, is the real danger of rapid human-caused climate change; the environment changes so quickly that there is insufficient time for populations to adjust and extinction is the result. That is why even though certain regions are made more "hospitable" (areas in the arctic circle get warmer on average, more rain falls in some arid areas, etc) extinctions still occur.

  22. It would be interesting to see what happen if an animal can eat a dead one and you start to reduce the food.

  23. CONCEPT;
    Make one where you change it from just bring a flat surface as well, maybe a mountain or Hill or lake or something idk

  24. Guys, I think we found the creator of Agar.io

    P.S.
    I LOL’d when he reduced the food count and everybody died 😂

  25. 8:10 the food from each day appears to remain on the field for the following days. Didn't remaining food pellets use to disappear every day in other simulations?

  26. @3:23 The creatures aren't "sacrificing efficiency for speed" since you stated that they move twice as fast, but take twice the energy. So, they are finding the same amount of food per unit energy expended. If you wanted to simulate a decrease in efficiency, you could make it something like 3x more energy to move twice as fast. That way, the cost of getting food is higher in terms of energy expended.

  27. Imagine we’re the simulation, and there’s just some highly advanced ‘alien’ controlling us and adding in random factors along the way like;

    What if I add intelligence?

    What if I add the ability to create cities and communities?

    What if I add non-renewable resources that my little fleshlings will have to fight over?

    What if I add an hierarchy?

    What if I add racism?

    What if I add ReLiGiOn?!

    WhAt If I aDd ThE iNtErNet?!?!

  28. Could you do one where food has to grow and it takes 3 days to seeds would be 1/2 and good stay the same you could do it with the hank stuff as a base could be cool to see

Leave a Reply

Your email address will not be published. Required fields are marked *