The Azimuth Project
delete 75 (Rev #4)

This page is a blog article in progress, written by David Tanzer.
Please remember that blog articles need HTML, not Markdown.

guest post by David Tanzer</i>

Lake Petri Net

Hi this is Rick from the Portland Gear Works, checking back in with you. It’s now time to brew that pot of coffee I mentioned last time (link). I’ve thumbed through the catalog of their articles, and chosen one. I don’t really want to state the title here, because what’s the point of starting out with some tall words, when I can tell you right now that it has to do with counting the number of balls in those Pachinko machines I mentioned called Petri nets. Well, now since you’re curious, the paper is The Large-Number Limit for Reaction Networks (part 1), by John Baez. But we won’t get to it in this post, because there are some basics that we need to know about first.

Now I didn’t get get it quite right when I called those Petri networks “Pachinko machines.” Instead of balls, they call the things that move around the network “tokens.” Also, more to the point, it’s not one big machine, but a network built up by connecting together lots of little machines. And the tokens aren’t necessarily part of a game. Each token represents something in the world. Imagine they have different colors, with each color for a different kind of thing. Suppose we have snakes, frogs and butterflies, and these are represented by tokens that are white, green and yellow, respectively.

Now the machines represent “processes” in the world, which eat up some tokens at their input, and then cough out some kind of tokens at their output. Suppose for example there was a volcano named George with arms and legs, which had a very specific kind of appetite. For every meal it needs to eat one snake and one frog. So it walks around the bottom of the lake, catches these food items, and stuffs them into the opening at the top. Then after cooking and digesting, this food is transformed into seven butterflies, which fly out of the volcano. To summarize:

George: 1 Snake + 1 Frog –> 7 Butterfly

Now what would happen if our lake started out with 507 snakes, 379 frogs, and 27 butterflies. After each meal, the volcano will have depleted the snake and frog population some more, and the butterfly population will be soaring. Sadly, a population imbalance would develop. To make things more fair, let’s suppose that the George had a brother and a sister, each of which had a different eating habit.

Sister: 5 Butterfly –> 1 Frog

Brother: 5 Butterfly –> 1 Snake

Now George will be in cooperation with both the brother and the sister, because he will supply them with butterflies and they will supply him with frogs and snakes. On the other hand, the brother and the sister will be competing for butterflies.

Now we can ask how the three populations will change over time, with all of the volcanoes working at the same time. This is a matter of “population dynamics.”

Well the answer depends on the feeding rates of each of the volcanoes. Suppose the brother takes ten years between meals, whereas the sister and George only take ten seconds. Then George will quickly deplete all of the snakes, and then run out of food, and so he will grind to a halt. Whatever butterflies are there will quickly be eaten by the sister, who will also grind to a halt. There will only be frogs. When the brother is ready to eat again, all the food will be gone, and so the system will be stuck in the state of Eternal Frogs.

To make it more realistic, we should consider that the speed with which the volcanoes move from one meal to the next will depend upon how much of their specific nutrients are present in the lake. After all, if there are hardly any frogs present, then George will have to spend a lot of time wading around in search of them, and so there will be long search times between the meals.

So the feeding rate of a volcano is a function of the input food supplies. And it is an increasing function – the more food present, the faster it eats. Depending on what function you choose for the feeding rate, you will get different results for how the populations evolve. But there is one standard one, which we can explain by analyzing the process by which George searches for food in the lake.

Suppose that the lake is big and square, and the frogs and snakes are relatively few and far between. Suppose that he can reach any creatures that are within a square that is 50 feet across, centered at the spout. He breaks the whole lake into grid of many squares cells that are 50 feet across, and he moves by jumping from one cell to another. Upon entering a cell, if that cell contains both a snake and a frog, then the meal takes place and the butterflies are generated, otherwise no meal takes place.

Suppose he makes 20 hops per hour, that half the cells contains snakes, and that half the cells contain frogs. Then, assuming that the snakes and the frogs are independently distributed across the lake, how many meals per hour would take place? Well, of the 20 cells that are visited per hour, on the average, only one quarter of them will have both a frog and a snake, and so there will be an average feeding rate of 5 meals per hour.

So the feeding rate of a volcano is proportional to the product of the numbers of its input species that are present.

What if George were to change his diet from Snake + Frog to Snake + Snake? Then he could only have a meal if there were two snakes found in a cell. Well if the odds of finding one snake in a cell are 50%, then the odds of finding two snakes will be 25%. So the feeding rate would still be 5 meals per hour. This example shows us that if a volcano eats two instances of a species, then its feeding rate will be proportional to the square of the number of tokens that are present for that species. You can generalize this to the case where it eats more than two instances of a species.

In closing, I’d like to point out that the terminology we have used here, which makes things pretty clear, is unfortunately not standard. Let’s see how to connect it with the terms that are used by “professionals” – which by the way are much less emotional and vivid.

First, the volcanoes are called processes, reactions, or transitions. Second, each meal of a volcano is called a firing event of the transition. The feeding rate of a volcano is referred to as the firing rate of the transition. The transitions could actually represent processes that have nothing to do with our beloved lake, like the splitting apart of a molecule into atoms. There the tokens would represent different types of chemical entities, and the transitions correspond to different kinds of chemical reactions. So a Petri net is really closely related to the idea of a reaction network.

One closing comment on the name “Petri net.” The name actually comes from the inventor of it, but in case you have trouble remembering it, here is a useful mnemonic: just picture Lake Petri Net growing, like a microcosm, inside of a Petri dish.


  • describe rate coefficient
  • clarify 50% odds versus 50% of the cells have a frog

category: blog