Simulating the Evolution of Rock, Paper, Scissors

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
These blobs compete for food by playing rock, paper, scissors. If you're not familiar with rock, paper, scissors, rock beats scissors, scissors beats paper, and paper beats rock, for some reason. The blobs live for just one day, but the food they win from the game will be used to reproduce, creating offspring that will play the same strategy as their parent. You might be thinking this is a bit unrealistic because creatures don't actually compete for food by playing rock, paper, scissors, and that's true, but there are cyclical relationships like this in nature. One example is the common side-blotched lizard. There are three main throat colorings for males that relate to how territorial they are. The orange throats are very aggressive and control large territories. This makes them out-compete the blue throats, whose territories are smaller. Blue throats out-compete the yellow throats, which don't control a territory at all, but the yellow throats do well against the orange throats by sneaking into those larger territories, which are harder to defend. In this video, we're gonna use simulations to explore the possibilities in situations like this. Okay. Before we can run a simulation, we have to lay out the rules in a bit more detail. We'll start with a winner take all system, where the winner of the rock, paper, scissors game gets both mangoes and will asexually produce two offspring and the loser gets no mangoes and no offspring. And if both blobs play the same strategy, they tie and they'll each get one mango, each producing one offspring. There are nine possible situations a blob can find itself in and we can specify all the rewards by putting them in a table, or a matrix if you want to use fancy words, which I do. The numbers in the matrix are the rewards for the blobs on the left side of the matrix. For example, a rock blob facing a scissors blob gets a reward of two, and in the reverse case, a scissors blob facing a rock blob gets a reward of zero. All right, let's put 80 of these trees into a world and start the population with 1/3 of each strategy. Before we hit go, what do you think will happen to the population over time? Will it tend to stay balanced? Or maybe one of the strategies will take over or perhaps the population will cycle through rock, paper, and scissors, taking turns dominating, or maybe something else. All right. Turns out scissors took over. That does seem a bit weird since it doesn't have any particular advantage. So let's check by running another one. Okay, this time paper took over, so I guess it's just random. The changes in the population are a bit chaotic, so it's tough to see what's going on just using this bar graph since it only shows us what's going on at one point in time. It turns out there's a better kind of graph for a situation like this, which will let us see the full history of the population. We're gonna use this triangular graph, where any point inside the triangle specifies the fractions of rock, paper, and scissors. A common name for this kind of graph is ternary plot. For me, this graph didn't make sense right away. It seemed like it had to be cheating or fake or something. I think the easiest way to explain it is to start with a normal Cartesian graph. On this graph, the horizontal axis is the fraction of paper players in the population and the vertical axis is the fraction of scissors players. So this point is 100% paper and 0% scissors. Rock isn't on the graph, but it's whatever's left over, which for now is zero. This point here is 100% scissors and zero of the other two. And this point down here is zero of paper and scissors, so 100% has to go to rock. So these three points form a triangle and the corners are states where one of the strategies has completely taken over the population. Now, this point here is 50% paper and 50% scissors. With any point on this line, the population is a mix of paper and scissors with no rock. And similarly, points on the other edges of the triangle are also a mixture of two strategies with none of the third. And any point on the interior is some mixture of all three. And finally, any point outside of the triangle is nonsensical since there would somehow have to be a negative number of one of the strategies. Then if we rotate the Y axis by 30 degrees, it's still the same graph, just shaped like an equilateral triangle. So the strategies are treated more equally. All right, let's have another go at the simulation setup, but this time using the ternary plot. Okay, pausing here. Rock has come out to an early lead. What do you think will happen next? With rock in the lead, paper blobs did well and now they're in the lead, and actually rock is almost extinct. Next with paper in the lead, the scissors blobs do well and nearly take over the population completely. And then paper goes extinct, and from there rock is able to drive scissors to extinction as well. Next, let's run a bigger simulation to smooth out the randomness a bit. Instead of 80 trees, we'll have 800 trees and to make room on the screen for more simulations and also to make my computer not explode, let's actually skip drawing the blobs. Okay, still some blobs. All right, so the same thing keeps happening. The populations spiral outward until all but one strategy is extinct and then there's no more change. In real life, though, there are mutations. So in these next simulations, every time a blob reproduces, there will be a one in 10,000 probability that it mutates into one of the other strategies. What do you think will happen this time? With a small mutation chance, the results look pretty much the same, except for one key difference. Once one strategy takes over, there's eventually a mutation into the next strategy in the rock, paper, scissors cycle, and then that one takes over and that keeps happening. We could have seen this just by looking at the reward matrix. Whenever two of the same strategy face each other, a player could benefit by switching strategies. Since the strategies are genetically determined, a player can't just decide to play a different strategy. But whether a blob decides to play a different strategy or just does so by mutation, the benefit is the same. So when the right mutation shows up, it does very well and invades the existing population. In game theory, there's a name for a situation where neither player benefits from switching. It's called a Nash equilibrium. With these strategies, there isn't a Nash equilibrium, so there's always a change that's beneficial. So none of the strategies can keep their hold on the population. The fancy terminology isn't really necessary here, but I wanted to at least mention it in case you hear it somewhere else. But if you do want a bit more detail, the last video on simulating the evolution of teamwork got a bit more into the nitty gritty. Okay, so the simulations we've created so far are interesting and a real biological system might behave this way, but we haven't yet found a setup where all three strategies can exist together, at least not for very long the way it does with our lizard friends. So from here, there are two directions we could go. The first one is to mess with the values in the reward matrix, and the second is to allow for mixed strategies where blobs have a chance to play rock, paper, or scissors instead of being destined to play just one. All right, first, we'll mess with the reward matrix. One thing we can try is to make the outcome of the contests less extreme. Instead of the winner getting both mangoes and the loser getting none, let's see what happens when the winner gets one and a half and the loser gets the remaining half. Now, the blobs can't produce half an offspring, but fractional mangoes get converted into a probability of producing an offspring. So there's a bit of luck involved, but on average, blobs that eat one and a half mangoes will produce one and a half offspring. So what do you think will happen here? Will the populations be stable now? If so, why? And if not, why not? Okay, the results are about the same. It did take longer for the populations to spiral outward, but in the end we still find ourselves in a situation where the strategies are taking turns dominating. Looking back at the reward matrix, even though the numbers are less extreme, it still has basically the same structure. So we see basically the same thing. All right, so another thing we could do is to add a cost to the ties. And the reason for this could be that when there's no clear winner, the blobs spend extra time and energy fighting. So even though they still each get one mango, they're extra tired or injured when they go home and it hurts their reproduction chances. So what do you think will happen this time? I know by this time in the video, it's easy to just sit back and let it wash over you, but if you continue making predictions, you will learn a bit more. So what do you think? All right, it is a bit different this time around. The population actually spirals inward. We could do a calculation here to see why, but I think an intuitive way is to notice that if the population is mostly rock players, rock players actually have a below average reward. This is similar to what researchers found in a population of common side-blotched lizards in a study from 1990 to 1995. The loop doesn't appear to be centered around an even mixture, but rather around a mixture where blue is the most common, then yellow, then orange. So the reward matrix for the lizards isn't as symmetrical as our artificial rock, paper, scissors matrix, but the cyclical relationship still seems to exist. Last, let's see what it looks like when we add mixed strategies. So far, blobs have had a single allele that tells them to play rock, paper, or scissors. Instead, we'll give them each three alleles. The alleles could be the same or different, leading to 10 possible combinations. When it comes time to choose a strategy, they'll follow one of their alleles at random. And when it comes time to reproduce, since the reproduction is asexual, the offspring will have the same three alleles as its parent, except that each allele has a chance to mutate. For example, this brown blob has one allele for each strategy, and when it reproduces, the child's scissors allele mutates into a paper allele, making it an orange blob with one rock allele and two paper alleles. To keep track of how many blobs of each mixture are in the population, we'll make a bar for each one. Again, let's run four simulations at once and we'll also go back to the original reward matrix and start out with an even amount of every mixture. What do you think will happen this time? Obviously we're looking at mixed strategies for a reason, so maybe something interesting will happen, but what? All right, so a few things here. First, we can see the same sort of cyclical behavior going from rock to paper to scissors and back. And just like before, the imbalances start out small and they get more and more extreme as time goes on. The other interesting thing here is the brown bar. By playing an even mixture of the three strategies, these blobs are aggressively neutral. It's impossible to come up with a strategy that beats them on average, but it's also impossible to come up with a strategy that loses to them on average. The fancy game theory term for this situation is weak Nash equilibrium. Like we said before, a Nash equilibrium is when neither player can benefit by switching strategies. A weak Nash equilibrium is when a player won't be helped or hurt by switching. But even though it's a boring weak Nash equilibrium, it's still a Nash equilibrium, the only one we've seen this video. Next, let's add the tie penalty back to the reward matrix. What do you think will happen now? Before I actually ran the sim, I thought that the brown blobs would take over. I was actually streaming myself working on this on Twitch and was confused in front of all 20 people who were watching. In the simulation with pure strategies, penalizing the ties caused to the population to balance in the middle. And if we look closely, we can see the sims still tend to balance around the middle. It's just that the whole population is balanced rather than having one balanced strategy dominate. All right, one more set of simulations. This time we'll keep the same reward matrix and mutation chance, but we'll have a different initial condition for each population. One, we'll start with 100% pure rock, one with 100% pure paper, one with 100% pure scissors, and one with 100% of the evenly mixed brown strategy. And one last time, what do you think will happen for each of these? Okay, so the pure strategies can't stand up to mutations and we see the same cycling we've been seeing this whole time, but the browns can resist mutations. Whenever a new mutation shows up, it can't get an advantage over the browns, but some of the members of the new mixture face each other and get hit by that tie penalty more often than the browns do. Every mixture other than the browns does poorly against itself, so they can never take over. So this brown evenly-mixed strategy is what we call an evolutionarily stable strategy. If you liked this video and want to see more, please consider supporting on Patreon. Patreon is my main steady source of income, so supporting there gives the confidence that I can keep creating these for free without needing to bring in a sponsor. In any case, thanks very much for watching all the way to the end and I'll see you next time.
Info
Channel: Primer
Views: 179,695
Rating: undefined out of 5
Keywords:
Id: tCoEYFbDVoI
Channel Id: undefined
Length: 15min 0sec (900 seconds)
Published: Sat Jul 13 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.