next up previous

4.2.6 Exercises

  1. Develop an estimate of the size of the arrays that will hold the current and next generation. Using the mutation rate and the population size you can determine the expected number of new mutations per generation, and from there, using an estimate of the number of generations to extinction [see the table in the following exercise], you can derive an upper bound for the length of the genome.

  2. Modify your asexual simulator to account for sexual reproduction, using the techniques outlined in this section. Compare the output of the new simulator with selected results from the following table:

  3. Modify the sexual simulator so it models a dioecious mating system, i.e. classify all individuals as either males or females, and draw one parent from each class. As a further variation, you might want to simulate monogamy: at the beginning of the build_next_generation procedure, form pairs of males and females, and draw pairs at random to create new individuals.

  4. For the procedure that performs recombination based on choosing randomly from a parent's two genes, implement and test the random bit generator described in Numerical Recipes [3]. See the CSEP chapter on random number generators for tests of independence and other metrics for measuring the quality of random number generators. How does a random bit generator compare to the sequence of bits taken from a random integer generator? Is there a hidden bias in the random integer generator that would make it choose non-random segments from one strand or the other in the parent?