Midterm Exam

Goal: Just a check-in with a little of the material we've covered so far, including basic probability and statistics, along with python....

Procedural notesw: submit as for homework, "submit midterm file1 file2 ...". For this exam, work on your own. You may use the resources of the internet or any notes, but your submitted work must be your own. Cite whatever sources you use to put together your answers, as appropriate.

There are five peroblems listed below. "Problem 0" is mandatory, only three of the other four need to be submitted for full credit. Also an asterisk (*) by part of a problem indicates a more challenging optional part.

If helpful, feel free to start with the example codes in ~bromley/courses/ap7730/examples.


Problem 0.

Write and submit a text file, quickquestion.txt, with answers to one of following questions:

Briefly describe qualititatively what Fisher information is and how it is useful in designing an experiment.

Describe a project you have done, are doing, or anticipate doing that makes use of some ot the tools presented thus far. What statistical tools have we not covered that might be helpful to you in your research? [N/A is ok here, w/an explanation.]

Problem 1.

A function of coordinates x,y,z has a value (in python lingo!) of

      f(x,y,z) = (1+z**2/r**2)*(1+0.5*y**2)*np.exp(-(x*x+y*y+z*z)/2.0)
    
inside the unit sphere (r*r = x*x+y*y+z*z<1) and zero outside of it.

Find the integral of f over all space. Submit your answer as "int2d.py" (if you use python) or as "int2d.[whatever]" otherwise.

Problem 2.

Your instructor claims to be able to flip a coin and get significantly more heads than tails. In a trial of 30 flips, the instructor gets 19 heads. Quantitatively evaluate the instructor's claim in light of this trial.

What is the highest "propensity" P that the instructor can claim? (Here a propensity P means that the instructor can toss heads a fraction P of the time, on average.)

Submit your answer as "faircoin.txt" and any related code as "faircoin.py".

Problem 3.

In a code called "pspec.py", construct time series y(t)=sin(2*pi*f*t)+eps, where f is 4 Hz and t is uniformly sampled 1024 times over an interval of 32 seconds. The eps term is Gaussian noise, zero mean and standard dev of sigma=1.0.

Have your code generate a plot the power spectral density of this function in a pdf file "pspec.pdf".

Have your code print out your best guess as to how big you can make the standard deviation of the random noise and still be able to measure the presence of the sinusoidal signal.

Problem 4.

A data pair (x,y) is measured with obesrved values of (0.0,1.0) and are known to have correlated errors such that the std. dev. for both is 1.0, and the correlation coefficient is -0.5.

In a code xyanticorr.py, generate 10,000 Monte Carlo samples of x and y, plotting them in a file xyanticorr.pdf. Have your code estimate the mean and uncertainty of r = sqrt(x*x+y*y).

* Suppose you have some information suggesting that x is greater than zero, favoring larger values, as in a prior p(x)=x (x>0). (this is an "improper prior" because it is not normalizable....) What are the mean and uncertainty of r in this case?