You will write three functions about the expansion of the universe. Speeds are in km/s, distances in Mpc.
The idea. For small redshifts , with . Hubble's law is . The Hubble time is , which is billion years for in km/s per Mpc.
Your tasks.
distance, return the distance in Mpc of a galaxy of redshift z, for a given H0.fit_H0, return the slope of the best line through the origin: the sum of divided by the sum of .hubble_time, return in billions of years.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…