Homework 3: Fitting and modeling¶
Instructions: Please answer the following questions and submit your work by editing this jupyter notebook and submitting it on Canvas. Questions may involve math, programming, or neither, but you should make sure to explain your work: i.e., you should usually have a cell with at least a few sentences explaining what you are doing.
Also, please be sure to always specify units of any quantities that have units, and label axes of plots (again, with units when appropriate).
import numpy as np
import matplotlib.pyplot as plt
rng = np.random.default_rng()
1. Poisson, no limits¶
Suppose that $X_1, X_2, \ldots$ are independent draws from the Poisson(1) distribution. Let $p_n$ be the probability that the sum of $n$ of these is more than $n + \sqrt{n}/2$: $$p_n = \mathbb{P}\{ X_1 + \cdot + X_n > n + \sqrt{n}/2 \}.$$ In class we learned that for large $n$, that $p_n$ would be close to some value (and, closer the larger $n$ is). What is that value? Justify your answer and check by simulation.
2. Fly-by flies¶
At harvest time, orchards can have a lot of fruit flies. Suppose that I sit down to eat lunch in an orchard while flies go zipping by at an average rate of 5 per second. Most of them manage to avoid my sandwich, but a small proportion hit the sandwich (and get stuck): about 0.5%. (Below when I ask you to "justify", you can refer to material from class for the justification, I don't mean you need to provide a mathematical proof.)
(a) About how often does a fly hit my sandwich? Propose, and justify a distribution for $T$, the amount of time that passes between subsequent flies who hit my sandwich. (Assume I don't do anything to avoid the flies or change the proportion who hit it.)
(b) Suppose it takes me 5 minutes to eat the sandwich. How many flies have hit the sandwich during that time (again assuming the proportion who hit it does not change as I eat). Propose, and justify, a distribution for this number (let's call it $X$). What's the probability that $X=0$?
(c) My friend prefers to eat their sandwich with a few flies in it. How long will it be before their sandwich has been hit by at least five flies? (Assume their sandwich is otherwise just like mine.) Using simulation, find the mean and describe the distribution using a histogram or other summary. (hint: use your answer to (a) to simulate)
3. Orogeny¶
Converging tectonic plates are pushing a mountain range upwards. Suppose that each year, a given mountain peak grows by a random amount whose average is 2cm and whose SD is 2cm.
(a) If the amount grown each year is independent of every other year, what's the distribution, approximately, of the amount grown over 100 years (relative to the starting height)? What about over 10,000 years?
(b) Suppose many mountains in this mountain range grow like this (independently). What proportion of them grow more than 220cm over 100 years? And, what proportion grow more than 220m over 10,000 years?
(c) In fact, the orogeny is accellerating. Suppose that in fact over the next 100 years, the mean amount grown is in year $y$ is $y/40$cm, with a SD of $y/50$cm. What is the mean height change after those 100 years? Explain your answer. Also compute the standard deviation assuming that the amount grown each year is independent.
np.sum(np.arange(101)) / 40, np.sum(np.arange(101)**2) / 50**2
(np.float64(126.25), np.float64(135.34))
np.sqrt(np.sum(np.arange(101)**2) / 50**2)
np.float64(11.633572108342305)