The Expanding Universe

In 1929 Edwin Hubble published the paper A Relation Between Distance and Radial Velocity Among Extra-Galactic Nebula which showed exactly what it claims in the title. This has become recognized as a rather big deal, because such a relationship implies that the Universe is expanding.

The data from Table 1 of this paper can be found from this link. Download the file to your computer. You can read the data from the file using numpy’s loadtxt function. You can then plot the recession velocities versus distance for these galaxies using matplotlib.pyplot’s scatter function. Label the x and y axis of your plot and take a look at it. A clear trend can be seen, but the data is not at all close to a straight line.

Now use numpy’s polyfit function to fit a line to the data. Take the output and plot this line on your plot. If this line is the true relationship between recession velocity and distance then the y differences between these points and line are observational errors. We can measure these observational errors by subtracting the measured data from the corresponding linear fit, these are called the measured residuals. Plot them as a function of distance in the same figure as your Hubble plot using the subplots() function. Discuss what might be some of the sources of these observational errors.