Episode 407 - “Primacy” airdate: 11/9/07
Charlie talks in this episode about modeling species in an ecosystem. “Think of a pond. A pond is a healthy ecosystem where predator and prey are in balance. However, if an outside predator is introduced then the ecosystem changes. An evolutionary algorithm highlights abnormal alterations…and locates the source of a problem.” The FBI is responding to an apparent murder of someone playing a Massively Multi-player Online Role Playing Game. Charlie likens the behavior of game players to animals in the ecosystem. “We could develop an evolutionary algorithm that searches the games history for abnormally aggressive activity.” Amita adds “That’s true. People aggress in video games in similar ways.”
Evolutionary Algorithm/Predator-Prey Model
One way to analyze ecosystems is to use a predator-prey model. As luck would have it, one of my students is working on a science project investigating predator-prey relationships. He recently asked me for help understanding the Lotka-Volterra model (thank you, Sam, for giving me the idea for this entry).
According to Wikipedia, the equations below model the population of prey (x) and predator (y). They are actually differential equations, but I am altering them slightly for simplicity.
Cx = change in population of prey per time period = ax – bxy
Cy = change in population of predator per time period = fxy - ey
The students will record population changes and determine values for the constants a, b, f and e. The students are interested in the Dendrobates azureus, or blue poison dart frog, which preys on Heliconius, or Passion Flower Caterpillar. Both of these species are brightly colored (making them easy to find) and highly individualized (making a census easier). But since contact with the skin of the frog can cause paralysis or death, they will focus on paramecium and didinium in a lab setting.
For the purposes of analysis, let’s assume the following equations for caterpillars(x) and frogs(y):
Cx = .2x - .025xy
Cy = .005xy - .1y
A simplistic interpretation of the equations follows.
Cx = .2x - .025xy indicates that the population of prey increases by a growth factor (.2x) and decreases by a factor of the populations of prey and predator, a sort of hunting factor (.025xy).
Cy = .005xy - .1y indicates that the population of prey increases by some population factor (.005xy) and decreases by some decay factor (.1y).
If we start with 40 caterpillars and 20 frogs, Cx = -12 and Cy = 2, which means after one time period, the number of caterpillars has decreased by 12 and the number of frogs has increased by 2. Now x = 28 and y = 22 and we can repeat the calculations. Numbers are rounded to integral values (because otherwise, ick!).
The recursive equations can be entered on the TI-84 using SEQ mode. The equations, table and time graph are shown below.

By choosing a uv plot, each time interval plots a point of the form (# of caterpillars, # of frogs). Several graphs are shown below, but I encourage you to graph them yourself, because watching the development is as enlightening as seeing the final graph. The graphs appear to spiral around and diverge, but changing the parameters can result in a cyclic situation or one that converges on a stable population.

The equations can be modeled with a spreadsheet, also, and some results are shown below. The graphs show the first 40 and then the first 100 time periods.
| time period | x | y | Cx | Cy |
| 0 | 40 | 20 | -12 | 2 |
| 1 | 28 | 22 | -10 | 1 |
| 2 | 18 | 23 | -7 | 0 |
| 3 | 11 | 23 | -4 | -1 |
| 4 | 7 | 22 | -2 | -1 |
| 5 | 5 | 20 | -1 | -2 |


In this model, the caterpillars are extinct after 62 time periods, and the frogs are extinct soon after. Setting up the work in a spreadsheet makes it easy to experiment with other starting values and see the results. Below is a graph with initial values x=25 and y=10.

Using either the calculator or a spreadsheet, keep the initial number of frogs constant at 10, but vary the initial number of caterpillars. How do those graphs compare? Change the initial number of frogs to 8 and repeat the exercise. If you have not already, try 20 caterpillars initially. The change in population of both species is 0. That is the equilibrium point for the species, the values at which they both have a steady population. That equilibrium point did not occur in any other examples that I tried, but you may have had different results.
Algebraic analysis confirms the equilibrium point. To determine the values algebraically, solve the system below:
0 = .2x - .025xy = x(.2 - .025y)
0 = .005xy - .1y = y(.005x - .1)
One solution is (20, 8), which we saw above, and the other is (0,0). The second solution indicates extinction for both species, which puts a bit of a damper on the investigation.
Codes
Near the beginning of the episode, Charlie sees the number sequence 208525138 and recognizes it as “a simple hexadecimal alphabet code”. The decoded message is “the beach”, where 20=T, 8=H, 5=E and so on, though I am unsure of the reference to the hexadecimal system. Two activities on codes from previous episodes are listed below.
- Code Crackers, from episode 201, “Assassin” about simple codes
- Breaking the Code, from episode 106, “Sabotage”, on cryptography


March 2nd, 2008 at 11:37 pm
Can you tell me the make, manufacturer or source of that (Stirling?) engine Alan built? Looks like fun…
March 5th, 2008 at 12:16 am
The device is a Stirling engine made by a German company named Boehm. A search for “Boehm Stirling HB9-AS2″ will locate these devices. The company makes several other Stirling engines. I am considering the purchase of an HB7-AL2 Kit which is about half as expensive and features the same engine, sans connecting rods and rockers.
My hat is off to this blog. I got an e-mail back within hours of my inquiry.