Calculus for Biologists Lab Math 1180-002 Spring 2012 Assignment #5 - Simulating Populations and Computing Probabilities Report due date: Tuesday, February 21, 2012 at 9 a.m. ? Please number your responses to each problem in your write-up. 1. List the new R commands you used in the lab and describe, in general, what they do. Use your own words, not mine! 2. Answer the ? bold ? question in Lab 5. 3. (a) Include Plot 5.1, and list the values you recorded from sim.P in lab 5. i. What aspects of your plot correspond to your sim.P values? ii. Refer to your notes from lecture and write the true (mathematical) probabilities for the number of purple offspring. Describe the similarities and differences between these and sim.P. Are the corresponding pairs of numbers close to each other? Why or why not? (b) Write the values you obtained for prob.explosive.P and prob.explosive.W. i. What conditional probabilities do these correspond to, and what should the true values be? ii. How do your results compare to the exact mathematical probabilities? iii. Is it more likely that a plant with explosive seeds has white flowers or purple flowers? Explain. (c) Write your simulation estimates for Pr(P |D) and Pr(W |D). i. Use Bayes’ Theorem to find the true probabilities Pr(P |D) and Pr(W |D). ii. Compare and contrast your simulated and mathematical results. 4. Suppose a disease infects a population of 250 people with probability 0.05. (a) Let 0 denote those without the disease, and 1 denote those with it. Using methods in lab 5 (for defective plants), simulate this population. You will need to create names for any variables you use. Plot the disease status of the 250 individuals, with the appropriate axes labels and title. (b) Use R to count the number of individuals with the disease, and write the result here. Assume they all test positive. (c) For each of the remaining healthy people, assume that the probability of a false positive is 0.1. Simulate them, assuming 0 is a negative and 1 is a positive test. Include a plot of the healthy population and their test results, with the appropriate axes labels and title. (d) Use R to count the number of false positives, and write the result here. (e) Determine, by hand, the conditional probability that a positive test will identify a sick person. (f) Now use your simulation results to calculate the fraction of positive tests that identify people who are sick. How does this compare with the mathematical expectation in 4e? (g) Based on your responses to 4e and 4f, do you think this test is a good diagnostic tool to assess disease prevalence in the population? Explain. ? Save your report as a .pdf file and upload it to Blackboard. 1 of 1 L5