Section 1.2 Problem 21

Here is how you input a list of data:

pop = {{1900, 1650}, {1910, 1750}, {1920, 1860}, {1930, 2070}, {1940, 
          2300}, {1950, 2520}, {1960, 3020}, {1970, 3700}, {1980, 
          4450}, {1990, 5300}, {1996, 5770}}

Here is how you can show the list as a table:

TableForm[pop]

Here is how you can plot the list of data:

listplot  =  
      ListPlot[pop, PlotStyle -> {PointSize[0.02]}]

Here is an advanced command, Fit, used to fit a function to the data. We won't be using this type of command in this class, but it shows some of the power of Mathematica.

f[x_]  = Fit[pop, {1, x, x^2, x^3}, x]

Here is a plot of the fit function:

modplot  = 
      Plot[f[x], {x, 1900, 2000}, 
        PlotStyle -> RGBColor[1, 0, 0]]

Here is how we show two plots together:

Show[listplot, modplot]

Here is how we can evaluate the fit function at a specific value:

f[1925]