delete 75 (Rev #6, changes)

Showing changes from revision #5 to #6:
Added | ~~Removed~~ | ~~Chan~~ged

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>

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~~ take~~ up~~ in some tokens at their~~ input,~~ inputs, and~~ then~~ send~~ cough~~ out some~~ kind~~~~ of~~ tokens at their~~ output.~~ outputs.~~ Suppose~~ You could imagine, for~~ example~~ example,~~ there~~~~ was~~ a~~ volcano~~ magic~~ called~~ saucer~~ Thor~~ that~~ with~~ floats~~ arms~~ around~~ and~~ the~~ legs,~~ lake, which~~ had~~ tries~~ a~~~~ very~~~~ specific~~~~ kind~~~~ of~~~~ appetite.~~~~ For~~~~ every~~~~ meal~~~~ it~~~~ needs~~ to~~ eat~~ attract exactly one snake and one frog.~~ So~~ When it~~ walks~~~~ around~~~~ the~~~~ bottom~~~~ of~~~~ the~~~~ lake,~~ catches~~ these~~ one~~ food~~ of~~ items,~~ each, then presto, a transformation occurs: they shake hands, and~~ stuffs~~ are~~ them~~ immediately converted into~~ the~~~~ opening~~~~ at~~~~ the~~~~ top.~~~~ Then~~~~ after~~~~ cooking~~~~ and~~~~ digesting,~~~~ this~~~~ food~~~~ is~~~~ transformed~~~~ into~~ seven~~ butterflies,~~ butterflies.~~ which~~ As~~ fly~~ a~~ out~~ mnemonic~~ of~~ for all this, let’s call the~~ volcano.~~ saucer~~ To~~ Preston.~~ summarize:~~

~~ Thor:~~ Each~~ 1~~ one~~ Snake~~ of~~ +~~ these~~ 1~~ “meals”~~ Frog~~ is~~ –>~~ represented~~ 7~~ by~~ Butterfly~~ the following formula:

~~ Now~~ Preston:~~ what~~ 1~~ would~~ Snake~~ happen~~ +~~ if~~ 1~~ our~~ Frog~~ lake~~ –>~~ started~~ 7~~ out~~ Butterfly~~ 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~~~~ Thor~~~~ had~~~~ a~~~~ brother~~~~ and~~~~ a~~~~ sister,~~~~ each~~~~ of~~~~ which~~~~ had~~~~ a~~~~ different~~~~ eating~~~~ habit.~~

Now what would happen if our lake started out with 507 snakes, 379 frogs, and 27 butterflies. After each meal, Preston will deplete 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 he had a brother and a sister saucer, each of which had a different eating habit:

Minerva: 5 Butterfly –> 1 Frog

Evan: 5 Butterfly –> 1 Snake

Now~~ Thor~~ Preston will be in cooperation with both Evan and Minerva, because he will supply them with butterflies and they will supply him with frogs and snakes. On the other hand,~~ the~~ Minerva~~ brother~~ and~~ the~~ Evan~~ 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.~~ saucers. Suppose that Evan takes ten years between meals, whereas Minerva and~~ Thor~~ Preston take only ten seconds. Then~~ Thor~~ Preston 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~~ used up by~~ the~~ Minerva,~~ sister,~~ who will also grind to a halt. There will only be frogs.~~ When~~ Then, when Evan 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~~ saucers~~ move~~ go 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~~ Thor~~ Preston will have to spend a lot of time~~ wading~~ floating around~~ in~~ looking~~ search~~ for~~ of~~ them, and so there will be long search times between the meals. So the reaction rate of a saucer is a function of the input supplies. And it is an increasing function – the more inputs present, the faster it goes.

~~ So~~ Now I will explain the standard model for how the feeding rate~~ of~~ depends~~ 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~~ amount~~ rate,~~ of~~ you~~ food.~~ will~~ Suppose~~ get~~ that~~ different~~~~ results~~~~ for~~~~ how~~ the~~ populations~~ lake~~ evolve.~~~~ But~~~~ there~~ is~~ one~~ big~~ standard~~ and~~ one,~~ square,~~ which~~ and~~ we~~ the frogs and snakes are relatively few and far between. Suppose that Preston can~~ explain~~ attract any creatures that are within 50 feet. He moves by~~ analyzing~~ making~~ the~~ hops~~ process~~ of~~ by~~ 500~~ which~~ feet,~~ Thor~~~~ searches~~~~ for~~~~ food~~ in a random direction each time. After each hop, if there is both a frog and a snake within 50 feet, then the~~ lake.~~ magic reaction takes place.

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 Thor 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 a useful mnemonic is to visualize Lake Petri Net growing, like a microcosm, inside of a Petri dish.

TODO:

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

category: blog