3.13. Lab 12: Evolution

Due Date: 11:59pm March 17, 2024

Labs should be submitted as a single Jupyter notebook to CourseLink Dropbox

This lab counts for 4% of the final grade

To do in advance of this lab:

  • Make sure you have run the code in Allen Downey’s Chapter 11 notebook.

3.13.1. Exercises

Complete the exercises corresponding to Exercise 11.1 – 11.2 in Chapter 11 of Think Complexity (version 2):

  1. The notebook shows the effects of differential reproductions and survival separately. What if you have both? Write a class called SimWithBoth that uses the version of choose_dead from SimWithDiffSurvival and the version of choose_replacements from SimWithDiffReproduction. Does mean fitness increase more quickly?

    As a Python challenge, can you write this class without copying code?

  2. What effect do differential survival and reproduction have on the number of occupied locations?

  3. When we change the landscape, the number of occupied locations and the mean distance usually increase, but the effect is not always big enough to be obvious. You might want to try out some different random seeds to see how general the effect is.

3.13.2. Submission

Please submit a single Jupyter notebook which completes the above exercises, filling in Allen Downey’s Chapter 11 notebook. There are already placeholders in the notebook for your work.