The cicada and the fsck
The Magicicada are a genus of cicadas, known for the clockwork periodicity of their life cycles. Depending on the species, every 13 or 17 years the cicada nymphs emerge from the ground, molt into their adult form, and spend the next few weeks pretty much focused solely on reproduction. During this period the adults are extremely vulnerable to predation, and indeed quite a large number of animals (from birds to reptiles and from cats to small rodents) will feed on them. Nevertheless, even when not preyed upon, the adult cicadas will die naturally after this short period of reproduction. As to the next generation, it burrows into the ground, ready to restart the cycle.
Now think of those period lengths; 13 and 17 years — is there anything peculiar about these numbers? If you guessed "prime numbers", then you're on the right path. Indeed, by having a life cycle based on a prime number, these cicadas minimise the chances of being synchronous with the cycles of their predators. It's all about choosing a cycle length which has no common divisors with any other numbers (other that the number itself, of course)— the very definition of a prime number.
Obviously the cicadas did not have a general assembly a long time ago where they asked the hemipteran Euclides to come up with this idea. They have no clue about prime numbers and neither must they. The beautiful thing about natural selection is that seemingly complex solutions such as this one can be found incrementally by trial and error. Consider a population of cicadas whose life cycle was 16 years. They would be vulnerable to predators with 1, 2, 4, 8 and 16-year cycles. Now imagine that a small mutation in a gene which affected the cycle length would increase the cycle to 17 years. The cicadas with this mutation would find themselves vulnerable solely to 1 and 17-year cycle predators, and would thus be more likely to survive and pass on the gene. Soon the mutant gene would become dominant in the population, as indeed it happened.
Linux distributions could learn a lesson from these cicadas. If you have multiple ext3 partitions (which is the case in the majority of GNU/Linux installations), there is nothing more annoying than facing a long boot because all the filesystems have to be checked. Granted, this is not a problem that happens often, but still there's an easy way to minimise the chances of it occurring: use tune2fs to set the maximum mount count of each partition to a different prime number. It's simple and elegant — just ask the magicicadas.

Comments