MATH 3900, Spring 2009 Homework 9 Due 04/03/09 1. A box has 4 balls: 2 blue and 2 white. You pick two at random. What is the probability that both will be blue? Solve this in two ways: a) Compute probability analytically, similar to what we did in class using “n choose k”. Compare the result to what we found in class making a list of all possible outcomes. b) (computing) Do a ”’Monte-Carlo”’ simulation of this experiment, namely, pretend the balls are numbered from 1 to 4 (with blues being, say 1 and 2), and ask the Matlab to draw 2 of them at random, say, 10 times, and each time record whether you got the desired result (blue-blue) or not. From this, make an estimate of the probability that both drawn balls are blue. Do this with 10, 100 and 1000 trials and compare results with your theoretical result from a). There is a code on the homework page that you can use as a part of your code. 2. Consider the Awake-Sleep Markov chain model that we discussed in class. Consider the following transition probabilities: PAA = 0.9, PAS = 0.1, PSA = 0.4,PSS = 0.6. a) Starting with p0A = 1, and p0S = 0, find the fraction of awake and sleeping students at several subsequent time steps. Repeat iteration until the distribution stabilizes. What are the resulting awake and asleep fractions? Does it match the theoretical steady state we found in class? b) (computing) Do a Monte-Carlo (random) simulation of one student. Start in awake state. Then ask matlab to toss the appropriate coin and decide which state the student will be in at the next time step. Record the sequence of states for 20 time steps. What proportion of time was the student awake? Compare it with the steady state you estimated from a). 3. The model for random genetic drift in a population of bacteria that I described in class has the following ingredients: The states of the markov chain are marked by the number of A-type plasmids in the cell. There are N+1 states (the number of A plasmids can vary from 0 to N). In the n-th generation a fraction of cells in each state is p[n] = (pn0 , . . . , pnN ). In the next generation p[n+1] = p[n] P where P is the transition matrix given by 2i 2N −2i Pi,j = j 1 N −j 2N N , where n 0 = 1 and n k = 0 for k > n, and i and j vary from 0 to N . a) Consider the case when each cell has 4 plasmids. In the original cells we introduce half of the plasmids of type A and half of the plasmid of type B, so p02 = 1. Iterate to find what will be the distribution of plasmids A and B in the population after 50 generations. This phenomenon was first observed experimentally and it was hypothesized that the plasmids interact so that they cannot be picked up into the same cell. Your result shows that the separation of plasmid types can happen simply as a result of random plasmid transfer. b) Based on your previous result, if plasmid type A carries resistance to an antibiotic gene, and plasmid type B does not, and you need a population of 10,000 antibiotic resistant cells, how many cells total do you need to grow? (extra credit) c) Do a monte-Carlo simulation of 100 cells, starting them with 2 plasmids of type A and 2 of type B and watch how the distribution of plasmid types evolves in the population. Come up with a way to visulaize it in ine picture. 2