Introduction to Computer Science and Programming
Problem Set 12: Simulating Virus Population
: Thursday, November 20, 2008
Friday, December 5, 2008
In this problem set, you will design and implement a stochastic simulation of virus population dynamics.
There are medications for the treatment of infection by viruses; however, viruses may become resistant to one drug, sometimes to
multiple drugs due to mutations. Despite not having gone to medical school (or maybe because of this), you can still decide on a
good drug treatment regimen by observing how the virus population responds to the introduction of different drugs. We have been
unable to reserve a bio lab for 6.00, so you will have to simulate the virus population dynamics with Python and reach conclusions
based on the simulation results.
For this problem set, you should submit both your code,
, and a writeup in pdf format,
(you may find this
Please let us know how long you spend on each problem. We want to be careful not to overload you by giving out problems that
take longer than we anticipated.
You may work with other students. However, each student should write up and hand in his or her assignment separately. Be sure to
indicate with whom you have worked. For further details, please review the collaboration policy as stated in the syllabus.
Download and save this file.
ps12.py: The code template for the simulation
Background: Viruses, Drug Treatments, and Computational
Viruses such as HIV and Influenza represent a significant challenge to modern medicine. One of the reasons that they are so difficult
to treat is because of their ability to evolve.
As you may know from introductory biology classes, the traits of an organism are determined by its genetic code. When organisms
reproduce, their offspring will inherit genetic information from their parent. This genetic information will be modified, either due to
mixing of the two parents’ genetic information, or through errors in the genome replication process, thus introducing diversity into a
Viruses are no exception and carry and propogate their own genetic information. Two characteristics of viruses make them
particularly difficult to treat. The first is that their replication mechanism often lacks the error checking mechanisms that is present in
more complex organisms. Secondly, viruses replicate extremely quickly, orders of magnitude faster than humans. Thus, while we
may be used to thinking of evolution as a process which occurs over long time scales, populations of viruses can undergo substantial