PHYS 27/193: Homework 4

This assignment is due on Monday, June 11 by 5pm.

Type your answers in a text file, save it as LASTNAMEhw4.txt, and drop it in the dropbox or email it to me.

  1. Using your "CalPop.dat" file, fit the US Population data to a cubic function: f(x) = a3*x**3 + a2*x**2 + a1*x + a0.
    Find a3, a2, a1 and a0.

  2. What is your prediction for the US population in 2050?

  3. Do the same for the California population.

    Note that you can put a "using" after the "filename" in a fit command, the same way you do when using "u..." (using) in a plot command.

  4. Plot the ratio of CA population to US population.

  5. Fit this ratio to a line. What is the slope of this line?

  6. What year will the CA/US fraction of US population be 15%?

  7. Save a GIF image of your plot, including your linear fit function.
    Name this file "LASTNAMEpopratio.gif" and digital-drop or email it to me.