|
Previous Entry: “Why I won’t update Orbit Classic for Firefox 4”
Next Entry: “The girl version of the “On the population dynamics of “Puella Magi Madoka Magica”” essay” 2011-10-16On the population dynamics of “Puella Magi Madoka Magica”This sketch is devoted to the population dynamics of the fictional world depicted by the Japanese animated TV series “Puella Magi Madoka Magica”. As such, it is inevitable going to reveal at least one major plot point. So if you are planning to watch this show, I suggest that you postpone reading this sketch until you are done watching it. You have been warned: there will be spoilers.
Basic setting In the world of “Puella Magi Madoka Magica”, there are magical girls fighting against witches. Human girls can become magical girls (although it is debatable whether magical girls are still human, for the purpose of this sketch I will treat “humans” and “magical girls” as non-overlapping categories, to facilitate talking about the respective populations; I could call the non-magical-humans “muggles”, but that starts with the same letter as “magical girls”), they can kill witches and they can be killed by witches. Witches can spawn familiars, those familiars can also fight with magical girls, and they can mature into witches themselves. And magical girls become witches too (and Tyler Durden is just a figment of the narrator’s imagination, and Doctor Malcolm Crowe was dead all along, and Dumbledore dies, and Rosebud was his sled, and Rimmer complained about the soup being too cold while dining with the officers). The show is slightly ambiguous on how magical girls become witches: we will have to return to this point. On the other hand, it is clear how human girls become magical girls: they are tricked into a contract by aliens with ulterior motives. Anyway, we have four populations: the humans
I model these relations as an iteration with discrete time steps A word on the notation: if “ This system is subject to some dramaturgical restraints: the production of familiars can result in an exponential growth of witches which could quickly wipe out humanity; but since the show tells us that witches existed since the dawn of time, this can’t happen quickly or with a high probability, that is, the population dynamics of our system should be mostly stable. On the other hand, for dramaturgical reasons, it is desirable that a magical girl, on average, has to fight several witches, has a real chance of dying in such an encounter, and has a high probability of becoming a witch herself (otherwise, being a magical girl would lack suspense, drama and angst). The question arises whether these constraints can be satisfied simultaneously. Especially, on the Puella Magi Wiki, population models have been proposed which are either highly unstable or lack drama. To tackle this question, I propose two simplifications of the basic model. First, since I’m searching a stable solution, I will treat humanity as an infinite pool where magical girls can be recruited. If the population of witches grows out of control, the number of humans will decline, and with all humans gone, it will be impossible to recruit new magical girls. But with stable (and comparatively small) populations of magical beings, this should be irrelevant. The second simplification is less obvious: I’ll get rid of the population of familiars. From the standpoint of magical girls, witches and familiars are different: fighting them costs magical energy which can be replenished using “grief seeds”, but only witches have grief seeds. A magical girl exclusively fighting familiars will loose her magical energy and turn into a witch. Therefore, the ratio of witches to familiars might matter for the rate of magical girls turning into witches. There are two reasons I’ll ignore familiars nevertheless: first, I expect the ratio of witches to familiars to be more or less constant. And second, I’ll model the transition of magical girls into witches as largely independent of witches anyway (see below). So instead of witches spawning familiars and the familiars maturing into witches, I simply have witches spawning more witches. Accordingly, my model reduces to this:
A simple mostly linear model for the equilibrium case The model above has 5 functions we need to specify. For four of these functions, I will propose simple linear relations. How do witches spawn familiars, and how do familiars mature into witches? The show doesn’t explain this in detail, so several possibilities spring to mind. It might be that the familiars need to spend some time being undisturbed, so the presence of many magical girls could slow down the production and maturing of familiars. Or perhaps a familiar killing a magical girl gets a boost and matures quicker or a witch needs to kill a magical girl to produce a familiar. Although I can’t rule out these possibilities, I’ll ignore them for a simpler model: the number of witches produced via familiars is simply proportional (with some constant factor How do magical girls become witches? They can loose all their magic energy fighting witches and familiars. The series shows (in episode 10) an instance of this happening: Madoka defeats Walpurgisnacht, but in the process looses so much energy that she instantly turns into a witch herself. But I think that this is an exceptional case. I assume that usually, a magical girl can avoid this situation by collecting grief seeds or avoiding fights with familiars if her magical energy runs low. Instead, I assume that the main factor turning magical girls into witches is them becoming overwhelmed by grief and loosing their will to continue fighting. Therefore, I model the transition of magical girls as being proportional to the number of magical girls: How often do magical girls and witches meet each other and engage in a fight? Different assumptions are possible: it could be that a magical girls searches exactly one witch during one iteration, and, provided that there are enough witches present, always finds one. But I assume that a magical girl engages in more fights if there are more witches present. The number of fights should be proportional to And correspondingly the number of witches dying is The last remaining function we need to model is and we also know that for a stable equilibrium, And knowing both For illustrative purposes, I’ll provide a model scenario with explicit numerical values: I assume that the aliens want to settle for an equilibrium with 2,000 witches, so Furthermore, I assume that during each iteration step, a magical girl has a 4 % chance of becoming a witch, and a 20 % chance of meeting a witch. During a fight, she has a 10 % chance of dying. With these numbers, a magical girl lives long enough to experience some angst and drama and suffering, and she will most likely end up as a witch in the end: ending up as a witch is twice as likely as ending up being killed. To achieve this, I set For the setting I have chosen, this means a value of Now we have this situation: there are 2,000 witches and 1,000 magical girls. In each iteration step, 40 girls become witches, and 20 girls are getting killed. Accordingly, the aliens recruit 60 new girls. Furthermore, 180 witches are killed, and 140 new witches are produced via familiars. A magical girl, on average, lives for almost 17 iterations, while a witch lives for slightly more than 11 iterations. On average, a magical girl kills one and a half witch. This average kill rate is rather low. It depends on how much witches come into being starting as magical girls, and how many started as familiars. The more witches start as familiars, the more witches a magical girl will kill on average before dying or becoming a witch herself, but the less likely it becomes for her to loose a fight. An important difference between different model scenarios is whether We can partially lessen this problem if we assume that the number of witches a magical girl kills is distributed rather unevenly. Then we would have lots of inexperienced girls killing few or none witches at all, and a few experienced girls regularly engaged in fights with witches. Nevertheless, at this point it seems doubtful whether it is possible to have a stable equilibrium with drama and angst and lots of fights. For example: is the equilibrium I just described stable? The success of rather dumb aliens To answer this question, we need to know the behavior of our model outside the equilibrium case. So far, we have defined the function I think the most simplest and brain-dead answer to this question would be: simply just do the same. I re-name the value The complete model then looks like this: For a specific scenario, I keep the values for the other constants as above, that is and set Now what happens if we set
If we start with too few witches, that is,
We can also start with an initial population of one magical girl and zero witches. Although our aliens behave in a really dumb manner, the system settles for an equilibrium, although not the desired equilibrium:
It turns out that our system has two equilibrium points. It is easy to see why: let Using these equations, we can use the second equation to express This is a second-degree polynomial with two solutions for Slightly less braindead aliens The aliens are in no way obliged to behave in such a blind-sighted way as depicted by the model above. Instead, they can adopt the number of girls they recruit according to the current population situation. A simple model would work like this: the aliens desire a witch population of Now the aliens attempt to choose For the actual function It should be noted that this model still has rather simple-minded and mechanical aliens. Nevertheless, it is surprisingly successful. For a concrete example, I pick the same parameters as above, with the only difference being the new definition of the function
Since in this scenario the magical girls are rather efficient witch killers and the production of familiars is slow, a population of 1,000 magical girls and 9,115 witches still moves back to the desired equilibrium:
Adding random noise So far, both models have been strictly deterministic. It is to be expected that there are random variations in the number of magical girls and witches, and a feasible alien strategy should be able to cope with such random deviations from a strictly deterministic model. A realistic model would be to add some normal distributed Gaussian noise to each function. But I decided against such a model, since, as mentioned above, I wanted to be able to compute models with simple spreadsheet functions to make it easier for others to compare and enhance my results. Instead, I have chosen a rather simplistic method of adding some noise. Let Let’s look again at our two models from above with extremely dumb and slightly less dumb aliens. For
To make matters worse for the model with dumb aliens, it takes on average about 1,200 iteration steps until the model becomes unstable and the witch population grows out of bounds. The “smart” aliens fare considerably better, their model stays stable for long amounts of time. Even if we reduce
The movement of the point
For comparison, with
On the other hand, with A possible criticism against the proposed scenario could be that magical girls fight against too few witches. We can rectify this by increasing the numbers of witches produced by familiars and also increasing the numbers of witches killed in a fight: we can set
Likewise, if we want to drag out the misery of the average magical girl, we can set
If, on the other hand, we want to make life miserable for the magical girls and accept that they die like flies, we can also set the probability for each iteration step that they become a witch to 10 % and likewise set the probability that they get killed by a witch to 10 %. Furthermore, a fight with a witch should be really dangerous, with a magical girl loosing every third fight. We can achieve this by the following setting: Once again, this scenario is mostly stable:
Conclusion There are restraints which prevent certain scenarios. It is impossible that almost all witches are the result of magical girls becoming witches and that simultaneously witches produce huge numbers of familiars which mature into witches, or that almost all magical girls end up as witches while being a magical girls means fighting lots of witches and that fighting a witch is very dangerous, all of this while at the same time this systems remains stable over long periods of times and was in place since the dawn of time (like the TV series implies). But if we are willing to sacrifice or relax at least some of these restraints, feasible models are possible. It is possible to have stable systems with significant random perturbations, it is possible to have more witches than magical girls, it is possible for magical girls to fight many witches on average, it is possible for many girls to end as witches, or it is possible for fights with witches to be dangerous. Whatever world we want to create, and whatever flavor of angst and drama we prefer, it is possible to construct scenarios which come close to these worlds, even with a rather simple model that doesn’t account for a more sophisticated behavior on the side of the aliens.
Appendix A: Excel spreadsheet As promised above, you can download an Excel spreadsheet to fiddle with the different parameters of the two proposed models for yourself. The spreadsheet contains two tables. The table labeled “DumbFixpoint” is only relevant if you choose the model with dumb aliens. In this case, this table computes the two fixpoints. Furthermore, this table also computes the Jacobian matrix for these fixpoints, the corresponding two eigenvalues and the spectral radius. A spectral radius greater than 1 means that the fixpoint is repelling, the greater the value, the faster points in the neighborhood of the fixpoint are driven away. A spectral radius smaller than 1 means that the fixpoint is attractive, the smaller the value, the faster points in the neighborhood of the fixpoints are converging towards the fixpoints. For the mathematical details, see also Appendix B. The table labeled “Main” contains everything else. Parameters you can set are shown in light green. I wired the calculation in such a way that you don’t set the model constants directly, but some (hopefully more meaningful) precursors. If you set “Random Noise” to 0, you get a deterministic model. You can choose between the model with dumb and less dumb aliens by setting “SmartAliens” to “False” or “True”. When you change a value, the spreadsheet immediately starts to calculate the new model for 10,000 iterations. If your model has random noise and you want to start a new model run with different random values, simply change an empty cell. It may happen that the parameters you have chosen lead to an unbounded growth of the witch population, leading to population numbers exceeding the maximum numerical value Excel (or OpenOffice) can handle (in older versions of OpenOffice, you can actually crash the application this way). To prevent this, the model stops when a population grows larger than a large threshold value, and restarts again with the initial population values. The value “MeltdownCount” tells you how often this has happened, which is a measure of how unstable your model is. For example, if there is just one meltdown within the full 10,000 iterations, your model is almost stable, and only rare and unfortunate combinations of random noise make it become unstable. On the other hand, if you encounter several hundred meltdowns, your model seems to be rather hopeless. If you encounter no meltdown at all, this field is displayed with a green background, otherwise, it is red. There are also two diagrams with the populations of the magical girls and the witches, one for all 10,000 iteration steps and one just for the first 1,000 iteration steps. Another two diagrams show the movement of the model in the phase space: the x-axis is the number of magical girls, and the y-axis is the number of witches. In a typical growth-towards-an-attractive-fixpoint scenario with random noise, the model will start in the lower left corner, move towards the fixpoint and then start to randomly wander in the vicinity of this fixpoint. Once again, the upper diagram shows all 10,000 iteration steps, while the lower diagram is limited to the first 1,000 iteration steps. Appendix B: Fixpoints in a two-dimensional phase space The following section describes a well-known piece of math, which might nevertheless be of some interest for someone trying to reconstruct one the models I developed above. Before we consider the two-dimensional case, let’s start with one dimension: we have a function But for small With this result in mind, we turn to the two-dimensional case. Suppose we have two functions How do we compute the derivation of such a function pair? There are four different ways: we have two partial functions, and we can compute the derivation for two different variables. The Jacobi matrix We are, of course, interested in the fate of our point How do we know whether such a derivation matrix is large or small, whether it stretches or shrinks things, whether an iteration pushes neighboring points far away or attracts them? Such a matrix can be characterized calculating the eigenvectors of the matrix, vectors which keep their direction under the application of the matrix. Although the direction of an eigenvector remains unchanged under the application of the matrix, its length might change about a factor called an eigenvalue of the matrix. The eigenvalues describe how much such a matrix shrinks or stretches different directions. In the general case, computing eigenvalues of a matrix is difficult, but in the case of a 2×2 matrix, it is simple enough. For a matrix of the form the eigenvalues are If the absolute values of both eigenvalues are smaller than 1, then a point is drawn nearer. If one eigenvalue is greater 1, a neighboring point is driven away in at least one direction, and the fixpoint is not attractive. We can express this using the spectral radius A fixpoint is attractive if the spectral radius is smaller than 1. In the dumb model above, we have the following functions: Accordingly, we have these partial derivates:
Add Comment
| QuicksearchRecent Entries
ArchivesLatest Skizzenblog Entry |