HelpContactFor teachers and institutes
>_StemPy Lab
Mock TestsClasses

>_StemPy Lab

Learn. Solve. Code the solutions. Test yourself.

Live examsFree mock exams, timed and rankedEveryone starts together, and your score and rank come the moment it ends.See the exams →
Live examsInternational live exams are comingTell us which exam you want first. Timed practice papers are open now.See what is coming →

Learn

  • Physics
  • Chemistry
  • Mathematics
  • Biology
  • Python Programming
  • Statistics & Data Science
  • Computer Science
  • Space Science and Astronomy
  • Earth and Environmental Science
  • Classes
  • Groups

Practice

  • Problems
  • Quizzes
  • Mock Tests
  • Prepare for an Exam
  • Question Sets
  • Exams
  • Certificates
  • Python Labs
  • AI Practice Generator
  • Student-Created Tests

Community

  • Discussions
  • Resources
  • Notes
  • Glossary
  • Blog

Account

  • Log in
© 2026 senLearn. All rights reserved.HelpFor SchoolsAboutContactPrivacy PolicyTerms of UseRefund Policy
Galaxies, Distances and Redshift
  1. 1The kinds of galaxy and our neighbours
  2. 2Measuring the distance to galaxies
  3. 3Redshift and Hubble's law
  1. Space Science and Astronomy
  2. /Galaxies, Distances and Redshift
  3. /Redshift and Hubble's law

Course 9.2·Lesson 3 of 3

Redshift and Hubble's law

Light from a galaxy that is moving away has its wavelengths stretched. We call this redshift, z=(λseen−λlab)/λlabz = (\lambda_{\text{seen}} - \lambda_{\text{lab}})/\lambda_{\text{lab}}z=(λseen​−λlab​)/λlab​

Lesson 3 of 3Show all lessonsHide
Galaxies, Distances and Redshift
  1. 1The kinds of galaxy and our neighbours
  2. 2Measuring the distance to galaxies
  3. 3Redshift and Hubble's law

Try the code and the simulations beside the lesson.

The siren that drops in pitch

An ambulance comes towards you with its siren on. The pitch is high. It passes, and the pitch drops. The sound waves are squeezed in front of the ambulance and stretched behind it. This is the Doppler effect.

Light behaves in the same way. If a source moves away, its light waves are stretched, and the wavelength becomes longer. Longer waves of visible light are redder, so the light is redshifted. If a source moves towards us, the wavelength becomes shorter, and the light is blueshifted.

Reading a spectrum

Hydrogen atoms give out light at certain wavelengths only. In the laboratory the red line of hydrogen is at 656.3656.3656.3 nm, and a line of calcium is at 393.4393.4393.4 nm. In the light of a moving galaxy, the whole pattern of lines is at slightly different wavelengths. The shift tells us the speed.

The redshift zzz is the fractional change of wavelength:

z=λseen−λlabλlab\displaystyle z = \dfrac{\lambda_{\text{seen}} - \lambda_{\text{lab}}}{\lambda_{\text{lab}}}z=λlab​λseen​−λlab​​

For a speed that is small compared with the speed of light c=3.00×105c = 3.00 \times 10^{5}c=3.00×105 km/s, the speed of the source is

v=cz\displaystyle v = czv=cz

We use this for zzz below about 0.10.10.1. A negative zzz is a blueshift.

Worked example. The red hydrogen line is seen at 660.0660.0660.0 nm in a galaxy.

  1. The change. 660.0−656.3=3.7660.0 - 656.3 = 3.7660.0−656.3=3.7 nm.
  2. The redshift. z=3.7/656.3=0.00564z = 3.7/656.3 = 0.00564z=3.7/656.3=0.00564.
  3. The speed. v=3.00×105×0.00564=1690v = 3.00 \times 10^{5} \times 0.00564 = 1690v=3.00×105×0.00564=1690 km/s, moving away.

Hubble's law

From 1912 Vesto Slipher measured the spectra of spiral nebulae. Almost all were redshifted, and some moved away at up to about 180018001800 km/s. The Andromeda Galaxy is blueshifted, because it is moving towards us. In 1929 Edwin Hubble compared the speeds of galaxies with their distances, found with Cepheids. He found a pattern:

The further away a galaxy is, the faster it moves away from us.

The speed is in proportion to the distance. This is Hubble's law:

v=H0d\displaystyle v = H_0 dv=H0​d

The number H0H_0H0​ is the Hubble constant. Its value is about 707070 km/s per megaparsec (Mpc). One megaparsec is 3.263.263.26 million light-years, or 3.086×10193.086 \times 10^{19}3.086×1019 km. A galaxy 111 Mpc away moves at about 707070 km/s, and a galaxy 100100100 Mpc away moves at about 700070007000 km/s. The values range from about 676767 to 737373. The gap is about 8 %8\ \%8 %, but it is larger than the errors, so it is called the Hubble tension and it is still unsolved. In this chapter we use 707070 for round numbers.

A graph of the speed at which galaxies move away from us, in kilometres per second from 0 to 30 000, against their distance in megaparsecs, from 0 to 400. A straight line through the origin has a slope of 70 kilometres per second per megaparsec. Eight dots lie close to the line, and the dots at greater distances have greater speeds.

Worked example. A galaxy is 100100100 Mpc away.

  1. The speed. v=70×100=7000v = 70 \times 100 = 7000v=70×100=7000 km/s.
  2. The redshift. z=7000/3.00×105=0.0233z = 7000/3.00 \times 10^{5} = 0.0233z=7000/3.00×105=0.0233.
  3. The hydrogen line. It is seen at 656.3×(1+0.0233)=671.6656.3 \times (1 + 0.0233) = 671.6656.3×(1+0.0233)=671.6 nm.

Using the law backwards

Hubble's law is a way to find distances. Measure the redshift, find the speed with v=czv = czv=cz, and divide by the Hubble constant:

d=vH0\displaystyle d = \dfrac{v}{H_0}d=H0​v​

This is how we find the distances of galaxies that are too far for Cepheids.

Going back in time

Every galaxy is moving away from us. Let us run the film backwards. A galaxy at distance ddd moves at v=H0dv = H_0 dv=H0​d, so it needed a time d/v=1/H0d/v = 1/H_0d/v=1/H0​ to get there, whatever its distance. All the galaxies were close together at one time, about 1/H01/H_01/H0​ ago. With H0=70H_0 = 70H0​=70 km/s per Mpc this is about 141414 billion years. The next course follows this idea to the Big Bang.

Two limits

  • Near galaxies. In the Local Group, gravity is strong, and Andromeda is coming closer. Hubble's law works for galaxies far enough away that the expansion beats the pull of gravity.
  • Large redshift. For zzz above about 0.10.10.1, the rule v=czv = czv=cz gives nonsense: z=1z = 1z=1 would give v=cv = cv=c. Astronomers then treat the stretching of space itself, as in the next course.

Practise with new numbers

Try it in Python

The program uses Hubble's law to find the speed, the redshift and the position of the hydrogen line for four distances.

Predict first. When the distance grows by 555 times, from 101010 Mpc to 505050 Mpc, by how many times does the shift of the line grow? Then run it. Check with Show the answer.

1. Change H0 = 70 to H0 = 50. What happens to the speeds, and to 1/H01/H_01/H0​?

2. Add 300 to the list of distances. Is v=czv = czv=cz still a good rule there?

Common mistakes

  • Dividing instead of multiplying. Speed is H0H_0H0​ times distance, not distance over H0H_0H0​.
  • Forgetting that zzz is a fraction. It is λseen/λlab−1\lambda_{\text{seen}}/\lambda_{\text{lab}} - 1λseen​/λlab​−1, not the ratio itself.
  • Using the law for nearby galaxies. Gravity controls their motion.
  • Thinking that galaxies move away from us because we are at a special place. Every observer sees the same thing. The next course explains why.

Remember these

  • Light from a receding source is redshifted. Light from an approaching source is blueshifted.
  • z=(λseen−λlab)/λlabz = (\lambda_{\text{seen}} - \lambda_{\text{lab}})/\lambda_{\text{lab}}z=(λseen​−λlab​)/λlab​, and v=czv = czv=cz for small zzz.
  • Hubble's law: v=H0dv = H_0 dv=H0​d, with H0H_0H0​ about 707070 km/s per Mpc.
  • Distance from the speed: d=v/H0d = v/H_0d=v/H0​.
  • The time 1/H01/H_01/H0​ is about 141414 billion years.

Check yourself

Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.

  1. A galaxy A is twice as far from us as a galaxy B. How do their speeds of recession compare?
  1. What does a blueshift tell us about a galaxy?
  1. The calcium line at 393.4393.4393.4 nm is seen at 397.3397.3397.3 nm in a galaxy. What is zzz?
  1. A galaxy moves away at 700070007000 km/s. With H0=70H_0 = 70H0​=70 km/s per Mpc, how far away is it?

References

  • OpenStax Astronomy 2e, Chapter 26 Galaxies, section 26.5 The Expanding Universe.
  • OpenStax Astronomy 2e, Chapter 5 Radiation and Spectra, section 5.6 The Doppler Effect.

Enroll free in Galaxies, Distances and Redshift

Every lesson is open to read. Enrolling also lets you:

  • Mark lessons done and carry on where you stopped.
  • Take the tests of this lesson and its course.
  • Count the course towards the certificate for its chapter.
No payment. You can leave at any time.

Problems (3)

Galaxy A is 60 Mpc from us, and galaxy B is 250 Mpc away…Easy · High School (9–10) · by StemPy Lab
The red hydrogen line of 656.3 nm in the laboratory is seen at 664.8 nm in the light of a galaxy…Medium · High School (9–10) · by StemPy Lab
In 1929 Hubble found a value of about 500 km/s per Mpc for H₀…Hard · High School (9–10) · by StemPy Lab
That was the last lessonBack to the course: take the test
← Galaxies, Distances and Redshift
← Measuring the distance to galaxiesNext →

Discussion (0)

Log in to join the discussion.

Loading…

, and for small
zzz
the speed is
v=czv = czv=cz
. Hubble found that galaxies move away faster the further they are:
v=H0dv = H_0 dv=H0​d
, with
H0H_0H0​
about
707070
km/s per Mpc.
about 35 min1 simulation3 practice questions1 Python program5 questions to check yourself

This lesson is free to read. Enroll free to keep your place and take the tests.

Python Labs (1)

Redshift and Hubble's law in codePython Lab · by StemPy Lab

Question Sets (1)

Galaxies and Redshift: Concept Check10 questions · by StemPy Lab

Notes (1)

Galaxies and Redshift: Quick RevisionNote · by StemPy Lab