Skip to content
Linear Relationships and Functions
Slope, Intercept, and Equations · LF10 · Grade 8

Construct a linear function from two input-output pairs

I can construct a linear function from two input-output pairs.

Standards:
8.F.B.4
Useful foundations

Seshvi AI · Your lesson tutor

A different explanation, a smaller step, or help making sense of your work.

Sign in to ask Seshvi AI

Two clues unlock the whole line

A mystery machine gives 7 when you put in 2, and 16 when you put in 5. You are told its rule is linear. Can you rebuild the machine?

Two different inputs give us enough information for one nonvertical straight line. We will find the change first, then rewind to the start.

Two clue points (2,7) and (5,16) lie on a line with slope3 and intercept1.

Try it first

Explore·Interactive model

Try it

Unlock a two-clue machine

Use two pairs to rebuild a linear rule. Check both clues before moving on.

This machine follows a linear rule. Use both clues to unlock it.

Clue 1: input 2 → output 7

Clue 2: input 5 → output 16

Two cluesClue points (2, 7) and (5, 16).01234560246810121416InputOutput12

The idea, in plain words

For two points with different x-values, calculate m=(y2−y1)/(x2−x1)m=(y_2-y_1)/(x_2-x_1). Next, substitute either point into y=mx+by=mx+b to find bb. Finally, test both points.

Two points alone do not prove that a real-world relationship is linear. This method works when linearity is given or is an explicit modelling assumption. If the inputs are equal, you cannot use this method to find a unique rule y=mx+by=mx+b.

Let's work it out

1. Unlock the machine

From (2,7)(2,7) to (5,16)(5,16), the slope is 9/3=39/3=3. Use (2,7)(2,7): 7=3×2+b7=3×2+b, so b=1b=1. The rule is y=3x+1y=3x+1.

2. Start away from the origin

A line passes through (−1,5)(-1,5) and (3,13)(3,13). Its slope is 8/4=28/4=2. Since 5=2×(−1)+b5=2×(-1)+b, b=7b=7. Check: 2×3+7=132×3+7=13.

3. A rule that falls

For (1,10)(1,10) and (4,4)(4,4), the slope is −6/3=−2-6/3=-2. Then 10=−2×1+b10=-2×1+b, so b=12b=12. The rule is y=−2x+12y=-2x+12.

4. A fraction in the rule

For (2,4)(2,4) and (6,6)(6,6), the slope is 2/4=1/22/4=1/2. Since 4=(1/2)×2+b4=(1/2)×2+b, b=3b=3. Thus y=(1/2)x+3y=(1/2)x+3.

5. Check the special cases

Points (1,6)(1,6) and (5,6)(5,6) give slope 0 and rule y=6y=6. Points (2,3)(2,3) and (2,8)(2,8) instead lie on a vertical line, x=2x=2. That is not a rule with one y-output for each x-input.

Your next challenge

Explore·Interactive model

Try it

Can these clues unlock one line?

Decide whether two clues determine one nonvertical linear function.

Clue 1: input 2 → output 7

Clue 2: input 5 → output 16

Can these clues unlock one line?Clue points (2, 7) and (5, 16).01234560246810121416InputOutput12
What do these two clues allow?

Pause and try

  1. A line goes through (0,4) and (3,10). What are m and b?

  2. Why is 16÷5 not the slope of the opening machine?

  3. Can (2,3) and (2,8) define y=mx+b?

Compare your thinking
  1. m=2 and b=4, so y=2x+4.

  2. Slope compares changes between points. A nonzero starting value makes output÷input different from the slope.

  3. No. The input 2 would have two outputs, and the slope calculation has zero run.

Another view

The line y=2x−3 has a negative initial value.

Input zero gives −3. A negative intercept is valid in a mathematical rule; a real story still needs suitable units and a sensible domain.

Take it somewhere new

A linear delivery charge is £11 for 2 km and £23 for 6 km. Find the charge rule.

After your try

The rate is (23−11)/(6−2)=3 pounds per km. The fixed fee is 11−3×2=5 pounds. C=3d+5.

Keep this idea

Change, divide, rewind, check. Two distinct inputs determine one line when a linear rule is intended.

Why y = mx + b gives a straight line

In y = mx + b, the output is b when x = 0, and every increase of 1 in x adds m to the output. The change is the same everywhere, so the graph is a straight line.

See it in outputs. For y = 4x + 1, inputs 0, 1, 2, 3 give 1, 5, 9, 13. Each step adds 4. Every step of 1 to the right goes up 4, so the points line up. The slope is 4 and the line meets the vertical axis at (0, 1).

Order does not matter. y = 1 + 4x and y = 4x + 1 are the same rule. To find m, look for the number multiplying x; b is the number added on its own. In y = 6 − x, m = −1 and b = 6, so the line falls 1 for every step right.

Spot a rule that is not linear. For y = 2^x (2 multiplied by itself x times, with 2^0 = 1), inputs 0, 1, 2, 3 give 1, 2, 4, 8. The changes are 1, 2, 4: they grow, so the graph curves upward. If the output changes over equal input steps are not all equal, the rule cannot be written as y = mx + b.

The test. Equal input steps with equal output changes: linear, with a straight graph. Output changes that vary: nonlinear, with a curved graph.

Lines where one coordinate stays fixed

Some lines are perfectly flat or perfectly upright. For these lines, one coordinate never changes.

Horizontal lines. The points (−2, 7), (1, 7) and (5, 7) all have y-coordinate 7. Their x-coordinates are different, and any x is allowed: (100, 7) is on the same line. Because the height never changes, the line is horizontal, and its equation is y = 7. The equation says nothing about x, so x is free to take any value.

Vertical lines. The points (−5, 0), (−5, 2) and (−5, 8) all have x-coordinate −5. Now y changes and x stays fixed, so the points stack up one above another. The line is vertical, and its equation is x = −5.

The general rule. Every point of the form (x, b) satisfies y = b, whatever x is, because its y-coordinate is b. Every point of the form (a, y) satisfies x = a. So y = b is a horizontal line through (0, b), and x = a is a vertical line through (a, 0).

A common slip. The line x = −5 crosses the x-axis at (−5, 0), but that does not make it horizontal. Ask which coordinate is fixed: if x is fixed, the line is vertical; if y is fixed, it is horizontal.

To write the equation, find the coordinate that is the same in every point, and set it equal to that number.

Practice this lesson

Sign in and choose a learner profile to practise. Answers are checked and saved to the learner's profile.

Sign in to practise

How was this lesson?

Sign in to leave feedback.