# Simulating the Evolution of Aggression

3M+ views   |   153K+ likes   |   2K+ dislikes   |
Jul 27, 2019

### Transcription

• - [Justin] In this video, we're gonna start
• exploring conflict between creatures.
• To try to build some understanding here,
• we're gonna use some simulations and some ideas
• from a field of math called Game Theory.
• (light music)
• Okay, so in our simulation, food will appear each day,
• and then blobs will appear and go out to eat the food.
• We'll use the same survival and reproduction rules
• as in previous videos.
• Eating one piece of food lets a creature
• survive to the next day,
• and eating two pieces of food allows a creature
• to both survive and reproduce.
• What's different in this simulation though
• is that food will come in pairs.
• Each creature randomly picks a pair of food to walk to,
• so it might get the pair all to itself
• and get to go home with two food and then reproduce,
• or another creature might find the pair at the same time.
• And when this happens, they have to somehow figure out
• how to split things up.
• We'll start out by having only one possible strategy
• for creatures who run into each other.
• They'll just share, each taking a piece of food
• and going home to survive to the next day.
• And because this strategy is so nice,
• we'll give it the name "dove."
• All right, let's let things run for a bit.
• (light music)
• All right, now let's add a new strategy
• called the hawk strategy.
• Hawks are more aggressive.
• If a hawk meets a dove,
• the hawk will go for the same piece of food as the dove,
• eat half of it, and then quickly eat
• the other piece of food, taking it for itself.
• This half food does complicate our survival
• and reproduction rules a little bit.
• So in this situation, a dove ends the day with half a food,
• so it'll have a 50% chance of surviving to the next day,
• and the hawk ends its day with one-and-a-half food,
• so it'll survive for sure,
• and also have a 50% chance of reproducing.
• So it looks good to be a hawk, but it's also risky.
• If two hawks meet, they'll fight,
• and fighting is taxing.
• At the very least, they use a lot of energy,
• and they might also get injured.
• So, when hawks fight, each one gets a piece of food,
• but they spend so much energy fighting
• that they use up all the benefit of the food right away
• and effectively go home with zero food,
• meaning they won't survive.
• So, now let's try adding a hawk creature to our simulation,
• and see what happens.
• Now is a good time to pause and predict
• what you think will happen.
• (light music)
• All right, it looks like we have a mixture
• that fluctuates roughly around half and half.
• And, there are also fewer creatures overall,
• even with the same amount of food.
• Here's an example of how natural selection
• doesn't necessarily act for the good of the species.
• And, to cover our bases, let's try starting with all hawks.
• (light music)
• Okay, not too surprisingly,
• they're tearing each other apart,
• and their max population size didn't even reach
• half of the population size of the doves.
• Now, if we add a dove to the mix in the next day,
• what do you think will happen?
• Okay, so it took the doves a little while
• to gain a foothold here,
• but eventually we end up in a similar situation,
• with a fluctuating mixture of hawks and doves.
• So why do we care?
• Well, this is a situation where survival of the fittest
• doesn't help us understand what's going on.
• There isn't one fittest strategy.
• We can get a better sense for why this is
• by translating our conflict rules from before into a table.
• If two doves face each other, they'll each get one food.
• If a dove faces a hawk, the dove gets half a food,
• and the hawk gets one and a half or three-halves food.
• And if we reverse perspectives, if a hawk faces a dove,
• they'll get three halves and one half.
• And when a hawk faces another hawk,
• they'll each end up with zero
• after they waste a lot of that energy fighting each other.
• Now that we have this table, let's imagine blobs
• that can choose which strategy they want to play.
• Say I control the blob on top,
• and you control the blob on the left.
• Say you know that I'm going to play a hawk strategy,
• which of course I am, what should you do?
• Well, you're better off just backing down
• and taking your half food.
• That might be annoying since it feels
• like I'm winning somehow,
• and you might be tempted to challenge me and also play hawk
• to teach me that I can't just push you around.
• This could make sense if we were gonna play this game
• against each other over and over again,
• as two humans might do,
• and that is something we'll talk about in future videos.
• But, in this situation,
• we're just these simple blobs with no social structure,
• interacting once, and even if we do see each other again,
• we won't remember it.
• So, all that matters is how much food
• we take home right now.
• And if you want to maximize your chances of surviving
• and reproducing, you'll play dove.
• Discretion is the better part of valor here.
• Let's record this by drawing an arrow.
• If we're in the right-hand column because I'm playing hawk,
• the situation in the upper-right square
• is the best you can do.
• Okay, in the other case where I'm not so mean,
• you know that I'm going to play the dove strategy.
• In this case, you'll do better playing hawk.
• And here again, because you're a very smart human,
• you might be tempted to think about the future,
• and want to reward me for playing nice
• and play dove yourself,
• but we're just these really simple blob creatures
• who might never see each other again.
• So, if you want to maximize your chance of reproducing,
• you'll play hawk.
• And, we can record this with another arrow.
• So now, to complete this table,
• we can reverse perspectives and think about
• what I should do in response to you,
• which I won't go through in detail, it's the same reasoning.
• But, we'd get similar arrows in the rows here.
• These arrows all point to more advantageous strategies,
• and the interesting thing to notice
• is that there are two stable situations:
• either you play hawk and I play dove,
• or you play dove and I play hawk.
• If we're in one of those two situations,
• either one of us would be worse off
• if we pick a different strategy.
• And by the way, this way of analyzing choices
• is called Game Theory,
• which is a whole field of math.
• In a situation where nobody benefits
• from changing their strategy,
• it's called a Nash Equilibrium, named after John Nash,
• who some would say had a beautiful mind.
• So, the best strategy isn't hawk or dove.
• It's to do the opposite of what your opponent is doing.
• When there are a lot of doves, it's better to be a hawk,
• and when there are a lot of hawks, it's better to be a dove.
• There's some equilibrium fraction of doves
• that the population is always pulled toward.
• Great, so we have the main conceptual point down,
• but we can deepen our understanding
• by calculating what that equilibrium fraction should be.
• The population will be an equilibrium
• if doves and hawks have the same
• expected average score in a contest.
• Right?
• Equilibrium is when, on average,
• we don't expect a change one way or the other,
• so we can't have one strategy doing better.
• They're equal.
• Our goal is to find the fraction of doves
• that makes this condition true.
• On our way there, let's first calculate
• the expected average score for a dove
• in a hypothetical example.
• Say, where the rest of the population is 90% doves.
• So let's see, a dove will have a 90% chance
• of facing another dove,
• in which case it gets the dove
• versus dove payoff of one food.
• And a dove also has a 10% chance of facing a hawk, right?
• That's just the rest of the creatures.
• In which case it only gets a half a food.
• So overall, when a dove runs into another creature,
• when the rest of the population is 90% doves,
• it'll come away with 0.95 food on average.
• This number is pretty meaningless on its own.
• But, once we calculate the expected hawk score,
• we can compare the two to see
• whether the equilibrium condition is met.
• So let's do that; let's find the expected hawk score.
• It could be good to pause and try to do this yourself
• to make sure it all makes sense.
• Maybe even rewinding to watch the dove part again.
• Okay, just like before,
• the rest of the population is 90% doves,
• and against a dove, a hawk gets one-and-a-half
• or three-halves pieces of food.
• And again, there's a 10% chance
• of running into another hawk,
• in which case our hawk goes home with zero food.
• And this comes out to 1.35 food on average.
• Now, notice that 1.35 is more than 0.95.
• So at 90% doves, hawks will do better,
• and we'd expect the fraction of hawks to increase
• in the next generation.
• So, it's not equilibrium.
• Not 90%.
• Now to find out what fraction of doves
• does meet the equilibrium condition,
• we can write the fractions of doves and hawks
• as variables instead of just guessing at specific numbers.
• And you might be saying right now,
• "Wow, that's a lot of letters,"
• which is a fair point, but we're almost there,
• and our next step is actually to get rid
• of one of those letters.
• So, there's a nice treat already.
• Doves and hawks make up all the creatures,
• so their fractions have to add up to one.
• And, this means we can replace the small h
• with one minus small d.
• And now, the expected dove and hawk scores
• are both written as functions of one variable.
• And the same variable.
• So, we can graph them on top of each other.
• The expected scores are equal when the graphed lines cross.
• And, indeed, the equilibrium condition is met at 50% doves.
• And, if we run a simulation
• with way more creatures than before,
• unfortunately too many to animate,
• the randomness smooths out a bit,
• and we can see that the prediction is true.
• Okay, so, it might feel like that was kind of a lot of work
• just to verify what we already thought.
• But, the fraction of doves
• isn't always going to be one half.
• It depends on the numbers in our payoff grid.
• The most interesting number to play with here
• is the hawk-versus-hawk payoff.
• So far, we've been saying that the hawks
• each get one piece of food,
• but waste all the energy of the food on fighting.
• But, what if instead, they only waste
• most of the energy, not all of it,
• and go home with a score of 1/4th?
• Plugging that in, we see the population
• move toward 1/3rd doves.
• And again, we can see this borne out in the simulation.
• At this point, congratulations,
• we have a pretty detailed understanding
• of how populations of hawks and doves work.
• And as basic as this model is,
• with only two simple strategies,
• it's a powerful starting point
• for analyzing behavior in the real world.
• And, before we go, I want to give you some teasers
• for how we'll build on this
• to get closer to reality in future videos.
• First, creatures in the real world
• can play more than one strategy.
• So instead of having their behavior
• completely determined by a single gene,
• our creatures could have several genes
• affecting their behavior,
• causing them to have different chances
• of playing hawk or dove.
• And the Game Theory term for this is mixed strategies.
• There can also be more complex, conditional strategies
• that act differently depending who they're facing.
• For example, there could be a strategy
• that fights with hawks, but is nice to doves.
• And, there could also be a strategy
• that tries to threaten a fight,
• but runs away if things get serious.
• And, seeing what happens with these kinds of strategies
• can help us understand why some animals
• put on threatening displays while rarely actually fighting,
• or have somewhat ritualistic fights
• that usually don't harm anyone.
• Next, most conflicts are actually asymmetric.
• So far, we've been assuming that everyone has
• the same amount to gain and lose,
• and that all the creatures are on equal footing.
• But when this changes, we can start to understand things
• like territorial behavior and dominance hierarchies.
• And last, let's go back to our equations
• and see what happens as the hawk payout
• gets less and less bad.
• Say, getting to three fourths.
• Now the graphed lines don't cross at all.
• There's no equilibrium.
• At this point, even if you know you're facing a hawk,
• the three-fourths food you get from fighting
• is better than the one-half you get from being nice.
• So these arrows should actually flip,
• and, it only ever makes sense to play hawk.
• We end up in this tragic situation
• where everyone's fighting all the time,
• even though they would do better
• if they could just cooperate.
• This kind of situation has a special name.
• It's called the prisoner's dilemma.
• It can feel kind of grim, but there are ways out of it,
• which we'll talk about in future videos.
• And, I'll see you then.
• Okay, so now I have some people to thank.
• First, thanks to you for watching to the end.
• Second, thanks to everyone who's become a patron on Patreon.
• Your support is what makes me feel
• like people actually get value from these videos,
• and gives me the confidence that they'll be funded
• into the future.
• Third, I want to thank the channel 3Blue1Brown,
• who shared the last video
• and really gave this channel a kick.
• If you like this channel,
• you really should go check out 3Blue1Brown.
• And finally, this video was supported in part by Brilliant.
• If you like how I treat biology as a quantitative subject
• and want more like it,
• then I really think you might like
• Brilliant's computational biology course.
• In it, you learn things like how to analyze
• genetic information, map ancestry,
• and predict the structure of proteins.
• Videos are a great way to get excited about a topic,
• but to really learn deeply,
• you have to engage in active problem solving.
• And, that's what's so great about Brilliant.
• Their courses are built around answering questions.
• And some of the exercises even have you run code,
• like this script that analyzes protein folds.
• Super cool.
• If you'd like to give Brilliant a try,
• you can go to brilliant.org/Primer,
• to let them know you came from here.
• And the first 200 people to use that link
• get 20% off the annual premium subscription.
• Check it out.

### Description

Try Brilliant's Computational Biology course: https://www.brilliant.org/primer
Support Primer on Patreon: https://www.patreon.com/primerlearning

- The Selfish Gene, Richard Dawkins, https://amzn.to/2LpffQl
- An Introduction to Behavioral Ecology, https://amzn.to/2YspPQz
(If you decide to buy one of these books, doing so through one of these links helps support the channel)

Thanks to supporters on Patreon, especially:
Vladimir Duchenchuk, Victor Anne, Noah Healy, Zachariah Richard Fournier, Patrick Gorrell, Jordan Scales, Jacob Maes, Kairui Wang, Josh Levent, StackAbuse.com, Marcial Abrahantes, Feimeng Zheng, Eric Helps, Sean Barker, Leonardo Kluppel, Tamas Gombkoto, Ben Kamens, Ben Komalo, Victor Moisescu, Alexander Mahone, Bjarke, Aurélien Géron, Daniel Giavedoni, Jeff, Jason Prado, Ryan Mahuron, Laura Picard, Anselm Eickhoff, Christy Serbus, 3blue1brown, Paul Straw, Roy Steves, Max Kaye, Elliot Press, ThePotatoGuy, Kevin Holesh, Talon Howitt, Mitchell Douglass, Sam Van Cise, Rikard Eide, Garrett F, Brian, Daniel Schramm, Wyatt Nelson, Mr_Chimick

- Reddit: r/primerlearning

- Github: https://github.com/Helpsypoo/primer

The music is "A Song of Doves and Hawks" donated by Mathieu Keith. For business inquiries: mathieu.keith@gmail.com

Several other inputs into the graphics are from public domain contributions to blendswap.com

### Related videos

00:00
15M+ views | May 19, 2018
00:00
4M+ views | Nov 14, 2018
12:16
5M+ views | Mar 15, 2018
00:00
995K+ views | Apr 27, 2019
11:12
5M+ views | Nov 23, 2015
00:00
27M+ views | Jan 01, 2019
00:00
2M+ views | Mar 07, 2019

### Suggested videos

24:13
22M+ views | Jul 31, 2015
00:00
4M+ views | Jun 24, 2015
00:00
289K+ views | Apr 09, 2019
00:00
42M+ views | Feb 01, 2016
09:49
18M+ views | Jul 28, 2013
00:00
747K+ views | Sep 12, 2019
00:00
15M+ views | Aug 15, 2012
00:00
2M+ views | Apr 29, 2019
00:00
3M+ views | Apr 25, 2019

### Trending videos

00:00
3M+ views | May 03, 2019
00:00
Jan 20, 2020 at 11:27
00:00
53M+ views | Sep 25, 2017
00:00
yesterday at 18:03
00:00
Jan 16, 2020 at 01:28
00:00
Dec 23, 2019
00:00
yesterday at 10:09