Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

NOTE:  This HW maybe more challenging.  Start early and come to office hours if you need help! 

(0) Completion of Labs and Reading

  • If you have not yet completed the in-class work or the weekly reading, then you may want to finish that first. Recent lecture notes on Collab may also be useful... 

(1)  Checkout the repository:


Use this link to accept the assignment and create your repository on GitHub:   https://classroom.github.com/a/CpoGKYP3??? 

After you accept the assignment and the repository and it exists in your GitHub, clone the repository into your working area on Rivanna. 

(2) BITE!!! - A simple simulation using probability distributions and random numbers (

...

5 Points)

For this exercise, you will perform a simulation of a real-world situation. Consider the following, it is a hot and damp August on Grounds and the mosquitoes are very hungry. For any given meter you walk, there are 100 mosquitoes that may draw blood. Fortunately, mosquitoes aren't very well organized, so the probability of a given mosquito biting is only 0.0001. But another 100 mosquitoes await you in the next meter, et cetera…

...

Submit the histograms with your code, where you should have one for the two discrete simulations: bite_200.png and bite_2500.png

(2) Want to be an A student?  (1 pt)

Make a new version of the plots above and draw the relevant probability distribution on the figure.  We don't know how to fit yet, so do it by hand (play with the parameters of the functions until it looks good), or use Google and online documentation to figure out how to fit the data.  When you get the function to look reasonable, print the value of μ (the mean) on the figure with the probability distribution name and save the files bite_200_mu.png and bite_2500_mu.png.   For example if you used a Gaussian:  "Gaussian mean=X.XX".


(3)   Simulated Falling - 10,000 times (5 Points)

Main Idea: Create pseudo-experiments to simulate an object falling, then fit the simulations to extract values for acceleration due to gravity (g) with the uncertainty (part d).

In the last several classes, we used the simple example of an object falling under the force of gravity to discuss using the chi-squared value to compare levels of agreement between the data and different models. We also used it as a simple example for learning about fitting.

In science, we often call it a pseudo-experiment when we simulate data for a fake experiment. In class, we made one pseudo-experiment for the falling object. Now I want you to write a program (falling.py or falling.ipynb) that:

a) Generates 10,000 pseudo-experiments for the falling object. In each simulated experiment, you will generate the data for the first 10 seconds using the equation v=9.8*t, but you will randomly 'smear' the calculated velocities. Using a random number from a uniform distribution you should add a +/- variation of 20% for each velocity generated (we did this in the class work Notebook, so look there to get started). 

b) Each pseudo-experiment will have 10 data points, so fit those data points using the model v=atto extract the parameter 'a'. 

c) Make a histogram of all of the resulting 'a' values obtained from your 10,000 fake experiments (save as falling_a.png)What are the features of this plot? Is it uniform? Why or why not? Try to fit this distribution to a Gaussian and extract the mean and sigma.  Draw the best-fit line on the histogram. 

d)  Want to be an A student?  Try this part for 1 point:

  Make a histogram of all of the resulting fit uncertainties on the 'a' values obtained from your fake experiments (save as falling_a_error.png). What are the features of this plot? Is it uniform? Why or why not?  Try to fit this distribution to a Gaussian and extract the mean and sigma.  Draw the best-fit line on the histogram.  


For problem 2 (this part), you will turn in:

Done? Make sure you answered any questions, then clean up your code and include some useful comments, then post bite.py, bite_200.png, bite_2500.png,  falling.py(or .ipynb), falling_a.png, and falling_a_error.png to GitHub.