As a result, a total of six new worms are present whose length may differ from that
of their six parents. Will the length of the new generations of worms be similar to
that of their parents, or will over generations worms get longer or shorter?
Because of the randomness that determines the choice of mating partners and the
randomness that determines the length of the offspring we do not know in advance
how long each of the next-generation worms will be. What we do know, however, is
that of the pairs that mate, only the longer one survives. So, a mechanism is built in
to the dynamics of this artificial, evolutionary process that favors longer worms, and
we would therefore expect that as time passes, later-born worms are on average
longer than their predecessors.
In order to model the evolution of our worms, note that we need to solve three
interrelated problems. First, we need to randomly pair the worms. Then we need to
decide who in each pair is longer, and “kill” the shorter ones off. Third, we need to
toss a coin to determine the length of the offspring and add these new worms to our
system while we remove the information about their parents, i.e. let the remaining
three parents die.
The first of these three modeling problems can be solved by assuming that we
cast six dice such that at the end all six dice show a different number. Then we
always pair the same dice—the first die with the second, the third with the fourth,
and the fifth with the sixth. For example, if the dice give the numbers 2, 4, 1, 6, 3, 5,
then we take this to mean that we should mate WORM 2 with WORM 4, WORM
1 with WORM 6, and WORM 3 with WORM 5. To make things easier, we may
actually fix one die—say the first one—and cast only the other five die. That little
trick still leaves the process perfectly random, because any time five die are cast
such that their numbers are different from each other, the number for the sixth is
automatically determined anyway. We may as well start with that one. Here, we
arbitrarily set it to 1.
Once all dice have been cast such that they each show a different number, their
sum is 21 (1 + 2 + 3 + 4 + 5 + 6 ¼ 21). At that time, the worms are officially paired
and can begin their fight to the death (with the winner reproducing). Then the
system is re-set and the stocks, which contain the results of the round of casting the
dice, are emptied, and the dice are cast anew.
The dice of this model are represented as stocks named STOCK 1, STOCK
2, etc., whose contents are held constant until all dice show random numbers
between 2 and 6, and all are different from each other. The exception is the first
die, STOCK 1, whose value is fixed at 1.
Take, for example, the second die. The converter DIE 2 in Fig. 13.1 generates a
random number between 1 and 7:
DIE 2 ¼ INT RANDOM 1; 7
ð Þ
ð
Þ
ð 13:1Þ
By only taking the integer of the random number we generate a string of
numbers between 1 and 6. The odds that exactly a 7 is generated are minuscule.
Next, we need to make sure that we only accept a number that has not already been
cast by another die—we want to avoid mating one worm with itself. We do this, for
106
13 Artificial Worms
of their six parents. Will the length of the new generations of worms be similar to
that of their parents, or will over generations worms get longer or shorter?
Because of the randomness that determines the choice of mating partners and the
randomness that determines the length of the offspring we do not know in advance
how long each of the next-generation worms will be. What we do know, however, is
that of the pairs that mate, only the longer one survives. So, a mechanism is built in
to the dynamics of this artificial, evolutionary process that favors longer worms, and
we would therefore expect that as time passes, later-born worms are on average
longer than their predecessors.
In order to model the evolution of our worms, note that we need to solve three
interrelated problems. First, we need to randomly pair the worms. Then we need to
decide who in each pair is longer, and “kill” the shorter ones off. Third, we need to
toss a coin to determine the length of the offspring and add these new worms to our
system while we remove the information about their parents, i.e. let the remaining
three parents die.
The first of these three modeling problems can be solved by assuming that we
cast six dice such that at the end all six dice show a different number. Then we
always pair the same dice—the first die with the second, the third with the fourth,
and the fifth with the sixth. For example, if the dice give the numbers 2, 4, 1, 6, 3, 5,
then we take this to mean that we should mate WORM 2 with WORM 4, WORM
1 with WORM 6, and WORM 3 with WORM 5. To make things easier, we may
actually fix one die—say the first one—and cast only the other five die. That little
trick still leaves the process perfectly random, because any time five die are cast
such that their numbers are different from each other, the number for the sixth is
automatically determined anyway. We may as well start with that one. Here, we
arbitrarily set it to 1.
Once all dice have been cast such that they each show a different number, their
sum is 21 (1 + 2 + 3 + 4 + 5 + 6 ¼ 21). At that time, the worms are officially paired
and can begin their fight to the death (with the winner reproducing). Then the
system is re-set and the stocks, which contain the results of the round of casting the
dice, are emptied, and the dice are cast anew.
The dice of this model are represented as stocks named STOCK 1, STOCK
2, etc., whose contents are held constant until all dice show random numbers
between 2 and 6, and all are different from each other. The exception is the first
die, STOCK 1, whose value is fixed at 1.
Take, for example, the second die. The converter DIE 2 in Fig. 13.1 generates a
random number between 1 and 7:
DIE 2 ¼ INT RANDOM 1; 7
ð Þ
ð
Þ
ð 13:1Þ
By only taking the integer of the random number we generate a string of
numbers between 1 and 6. The odds that exactly a 7 is generated are minuscule.
Next, we need to make sure that we only accept a number that has not already been
cast by another die—we want to avoid mating one worm with itself. We do this, for
106
13 Artificial Worms
