AstroSpeedrunSearch
D3

Slope, intercept and their uncertainties

Builds on
Section D2
Reading time
50 min
Exercises
6
Olympiad problems
1

The Hubble constant tells us how fast the Universe is expanding today. In 2022 a team that measures the distances of galaxies with Cepheids and supernovae found 73.0 ± 1.0 kilometres per second per megaparsec, while the Planck satellite, working from the faint glow left over from the Big Bang, had found 67.4 ± 0.5. The two values differ by 5.6, about five times the uncertainty of their difference, and so astronomers now argue about whether something is missing from our picture of the Universe. Without its uncertainty a value says little, because we cannot tell whether two measurements agree. In the data-analysis round almost every result is asked for with its uncertainty, and for a graph that means the uncertainty of the slope and intercept of the line. In this section we find both from the line drawn in Section D2, and we learn to write a result with the right number of figures.

D3.1The intercept

Before you readMake a guess first

The best line through the five Cepheids crosses log⁡(P/day)=0 at MV=−1.44. What does this number describe?

The intercept of a straight line y=mx+c is c, the value of y where the line crosses x=0. When the horizontal axis starts at zero we can read it straight off the graph, where the line meets the vertical axis. The Cepheid graph starts at log⁡(P/day)=0.5, so its vertical axis is not at x=0, and reading the line where it meets the left edge of the sheet would give a wrong value. Instead we take any point (x1,y1) on the line and its slope m and work out

c=y1−mx1.

For the line through (0.60, −2.93) with slope −2.48 this gives c=−2.93−(−2.48)(0.60)=−2.93+1.49=−1.44, the absolute magnitude of a Cepheid with a period of one day. The intercept has the units of the vertical axis, here magnitudes. Few Cepheids have periods as short as a day, so this value lies beyond the data, and it is a step in the arithmetic more than a measurement of a real star.

D3.2The steepest and shallowest lines

Before you readMake a guess first

Every line through the centre of five points that also passes through all their error bars has a slope between −2.8 and −2.1. Roughly how uncertain is the slope?

The error bars show how far each point could be from its true place, so they also show how far the line could tilt. We put a ruler along the best line, hold it at the centre of the points, which we called C in Section D2, and turn it. As it turns, the line moves through the error bars until, at some angle, it touches the end of one of them. The line at that angle is the steepest line that the data allow, and turning the other way gives the shallowest. The uncertainty of the slope is half the difference between the two, and the uncertainty of the intercept comes from the intercepts of the same two lines. On paper the two lines are drawn dashed and labelled, and the slope of each is read from its own large triangle, as in Section D2.

ResultUncertainties from the extreme lines(D.2)
σm=|mmax−mmin|2,σc=|cmax−cmin|2
mmax,mminthe slopes of the steepest and shallowest lines through C that still pass through every error bar
cmax,cminthe intercepts of the same two lines
σm,σcthe uncertainties of the slope and of the intercept
The slope and intercept themselves come from the best line, while the steepest and shallowest lines give their uncertainties. Some books let the two extreme lines run through the error bars without passing through C, which gives a slightly wider range, and markers accept either. When the points have no error bars, the method of least squares in Section D6 gives the uncertainties from the scatter of the points instead.

For the five Cepheids the steepest line through C that still passes through every error bar has a slope of −2.80, and the shallowest a slope of −2.10. By (D.2) the uncertainty of the slope is (2.80−2.10)/2=0.35. Lines turned about C all pass through C, so their intercepts differ more the further C lies from x=0. Here C is at x¯=0.925, so the intercept is uncertain by 0.925×0.35=0.32, about as much as the slope. This leaves out the uncertainty in the height of C itself, which is about the typical error bar divided by the square root of the number of points, here 0.07. Combined in quadrature it hardly changes the 0.32, but it is the whole uncertainty of the intercept when C lies at x=0.

Figure D.2The steepest and shallowest linesinteractive
StarP (day)log PMV (mag)σ (mag)
RT Aur3.7280.571−2.830.17
FF Aql4.4710.650−3.020.14
X Sgr7.0130.846−3.640.13
ζ Gem10.1511.007−3.930.14
l Car35.5511.551−5.270.22
  1. 1 Line
  2. 2 Extreme lines
  3. 3 Result
The figure shows the graph of Section D2 with the points and error bars already plotted. The three steps above the sheet ask for the best line, then for the steepest and shallowest lines, which turn about the centre of the points C, and finally for the slope written with its uncertainty. Each line is checked against the error bars as a marker would check it.
Example D.6The slope and intercept with their uncertainties

The best line through the Cepheids has a slope of −2.48 and an intercept of −1.44. The steepest line through C has a slope of −2.80 and an intercept of −1.15, and the shallowest a slope of −2.10 and an intercept of −1.79. Find the slope and intercept with their uncertainties.

Solution

By (D.2),

σm=|−2.80−(−2.10)|2=0.35,σc=|−1.15−(−1.79)|2=0.32.

Both uncertainties round to 0.3, so the slope and intercept are given to one decimal place.

AnswerThe slope is −2.5 ± 0.3 magnitudes for each unit of log⁡(P/day), and the intercept is −1.4 ± 0.3 magnitudes.

D3.3Writing a result

Before you readMake a guess first

A slope is worked out as −2.4774 with an uncertainty of 0.3453. How should it be written?

An uncertainty is itself only an estimate, good to about one figure, so we quote it to one significant figure. When that figure would be a 1, rounding loses too much, since rounding 0.14 to 0.1 changes it by nearly a third, and we keep two. The value is then rounded to the same decimal place as its uncertainty, and the unit is written once after both, as in (−1.4 ± 0.3) mag. In the working before the end we keep a figure or two more than this, so that rounding errors do not pile up, and only the final answer is rounded.

Quick checkRounding a result

A result comes out as 0.015732 with an uncertainty of 0.00148. To what value should 0.015732 be rounded?

D3.4How far the points stray

Before you readMake a guess first

The points of a graph lie much closer to the best line than the length of their error bars. What does this suggest?

The residual of a point is how far it lies above or below the line, its value minus the value of the line at the same x. If the error bars give the true uncertainties, about two thirds of the points lie within their error bar of the line and about a third lie outside it. Points that all lie far inside their bars suggest that the uncertainties were overestimated, and points that stray well outside them suggest that the uncertainties were underestimated or that the model does not fit. A pattern in the residuals, such as points above the line at both ends and below it in the middle, is the clearest sign that a straight line is the wrong model, and Section D5 shows how to choose a better one.

For the five Cepheids the largest residual is 0.10 magnitudes, and the typical one, the square root of the mean of their squares, is 0.05, while the error bars are 0.13 to 0.22 magnitudes long. The points lie closer to the line than their bars suggest. With only five points, error bars of the right size would leave the points this close to the line about one time in eight, so we would keep the uncertainties as they are. A data-analysis answer still earns marks for a sentence that points out the difference.

Example D.7The intercept with its uncertaintyfinish it

The steepest Cepheid line has an intercept of −1.15 and the shallowest an intercept of −1.79. What is the uncertainty of the intercept?

The start

By (D.2) the uncertainty is half the difference between the two intercepts, which differ by −1.15−(−1.79)=0.64.

Your stepNow find σc.
mag
Common errorsSection D3
  1. The best slope comes from the best line. The average of the steepest and shallowest slopes is close to it when the points are evenly spread, but it is not the same, and the extreme lines are there only to give the uncertainty.
  2. An extreme line that misses one of the error bars is steeper or shallower than the data allow, and it makes the uncertainty too large.
  3. The intercept is the value of y at x=0. Reading it where the line meets the left edge of the sheet is wrong whenever the horizontal axis does not start at zero.
  4. A result written as −2.4774 ± 0.3453 shows more figures than its uncertainty allows. The uncertainty takes one significant figure, or two when the first is a 1, and the value is rounded to match.
  5. A slope or intercept without its unit cannot be used. The slope has the units of the vertical axis divided by those of the horizontal axis, and the intercept those of the vertical axis.
ExercisesSection D36 questions
  1. D3.1

    The steepest line through a set of points has a slope of −1.84 and the shallowest a slope of −1.52. What is the uncertainty of the slope?

  2. D3.2

    The best line of the Cepheid relation in the K band passes through (0.60, −4.27) and has a slope of −3.39. What is its intercept?

    mag
  3. D3.3

    How should 12.3456 with an uncertainty of 0.0789 be written?

  4. D3.4

    The two values of the Hubble constant in the opening of this section are 73.0 ± 1.0 and 67.4 ± 0.5. Their uncertainties are independent. What is the uncertainty of their difference?

    km/s/Mpc
  5. D3.5

    On a graph the points lie above the best straight line at both ends and below it in the middle. What does this pattern show?

  6. D3.6

    Two lines turned about the centre of the points C, at x¯=1.2, have slopes that differ by 0.20, so the slope is uncertain by 0.10. How uncertain is the intercept?

Olympiad problemsPast IOAA problems, restated1 problem
2017A Cepheid relation free of dust14.5 points

Adapted from IOAA 2017 (Phuket), data-analysis problem 1, part 2. We have restated it in our own words and kept the original data. The solution was last checked on 20 October 2026.

Dust between us and a star makes it fainter and redder. Astronomers remove the dimming without measuring it by using the Wesenheit magnitude, which for the V and I bands is W=V−R(V−I), with R=2.45 for the dust in our Galaxy. The table gives the period P, the mean magnitudes ⟨V⟩ and ⟨I⟩, and the parallax ϖ with its uncertainty σ of the five Cepheids of Section D2. The magnitudes have negligible uncertainty.

StarP (day)⟨V⟩ (mag)⟨I⟩ (mag)ϖ (mas)σ (mas)
RT Aur3.7285.4644.7782.400.19
FF Aql4.4715.3724.5102.810.18
X Sgr7.0134.5563.6613.000.18
ζ Gem10.1513.9113.0852.780.18
l Car35.5513.7322.5572.010.20

Work out the absolute Wesenheit magnitude MW of each star, plot the relation between MW and the period with error bars, and estimate its slope and the uncertainty of the slope. In the original paper this part was worth 14.5 marks.

AnswerThe slope of the Wesenheit relation is −3.4 ± 0.3 magnitudes for each unit of log⁡(P/day). The official solution gives −3.4 ± 0.2 and accepted uncertainties from 0.1 to 0.3, so this answer falls within the range the official solution accepted.