5.1 Modeling Linear Relationships with Algebra

5.1: Modeling Linear Relationships with Algebra

Learning Objectives

Upon completion of this section, you should be able to

  • Identify elements in a linear model of the form y=mx+b
  • Create a linear model with algebra between two quantitative variables
  • Graph a linear model
  • Solve application problems using a linear model created with algebra

Linear Models

Two variables are in linear relationship if we can describe how they change together by adding or subtracting a fixed constant for each unit increase in one variable. For example the cost for hiring a plumber may start with a $75 fee for coming to your house plus an hourly rate of $60. The two variable here are the total cost for the job and the number of hours needed to complete it. For each one hour increase to complete the job we would see an increase of $60 to the total cost.

What you will work on in this section is how to write an algebraic model to describe that relationship between two variables in applications. We will start with the general equation of a line in slope-intercept form.

Linear Model

A linear model (equation) has the form y=mx+b.

  • The yintercept is the point at which the graph crosses the yaxis. It is indicated by b in the linear model y=mx+b and shown on the graph as the point (0,b).
  • The slope is a measure of the the line’s steepness, also known as the rate of change. It is represented by m in the linear model y=mx+b. The slope represents the vertical displacement (rise) and horizontal displacement (run) between each successive pair of points. The formula for slope between two points (x1,y1) and (x2,y2) is:

    m=change in output (rise)change in input (run)=yx=y2y1x2x1

We call this form of a linear equation the slope-intercept form as it gives the information about the slope, m, and y-intercept, b.

Graph of y=2x+1 produced on Desmos. Go to Desmos to explore this model.

Graph showing a line y-intercept location as it crosses the y-axis and the change of y and change of x to illustrate the slope

Example 1

Which of the following represent a linear model. If it is a linear model identify the slope m and intercept b.

  1. y=10x+20
  2. y=x2+4
  3. y=5+2x
  4. y=5+2x
  5. y=10045x

Solution

  1. This is a linear model. Slope is 10 and the y-intercept is 20.
  2. This is not a linear model as we are squaring the x term in the equation.
  3. This is not a linear as the second term in the equation 2xhas x in the exponent.
  4. This is a linear model. We can rewrite it as y=2x+5. The slope is 2 and the y-intercept is 5.
  5. This is a linear model. We can rewrite it as y=45x+100. The slope is -45 and has a y-intercept of 100.

Before we look at applications lets review how to create a linear model for given sets of points and identify the key elements of slope and intercept.

Example 2

Find a linear model that goes through the points (4,1)and(5,3).


Solution

When given two points you start with the slope formula to find m:

m=(31)(54)m=21m=2

Now we were not given the y-intercept directly, so we will first update the linear model with our information about the slope: y=2x+b

Now to find b we can use either of the two given points to put into the equation and solve. We will use (4,1) in the work below.

y=2x+b1=2(4)+b, where y=1 and x=41=8+b18=b7=b

Putting our value in for b we get the linear model is: y=2x7

Try it Now 1

Find the equation of a line that goes through the points (4,5) and (2,3).

Hint 1 (click to Show/Hide)

Start with the slope of the line. The slope formula is below. After finding the slope you can use either point given and the slope in the equation to find the y-intercept value b.

m=change in output (rise)change in input (run)=yx=y2y1x2x1

Hint 2 (click to Show/Hide)

The slope is:

m=(35)2(4)=2(2+4)=26=13

Answer (click to Show/Hide)

First find the slope of the line: m=(35)2(4)=2(2+4)=26=13

Next we add the value of the slope to the equation of the line: y=13x+b

Use either point given in the equation to find b, in the work below (2,3) was used:

3=13(2)+b3=23+b3+23=b93+23=b113=b

The equaiton of the line through (4,5) and (2,3) is y=13x+113.

Graph a Linear Model by Plotting Points

Linear equations are fundamental in mathematics and have numerous real-world applications. Graphing these equations visually represents their solutions and helps us understand their behavior. One straightforward method to graph a linear equation is by plotting points.

To find points on a graph for any model, we can choose input values (typically represented by x) and evaluate the model at these input values to find the corresponding output values (typically represented by y). The input values and corresponding output values form coordinate pairs (typically represented by (x, y). We then plot the coordinate pairs on a grid.

In general, we should evaluate a linear model at a minimum of two inputs in order to find at least two points on the graph. For example, given the model, y=2x, we might use the input values 1 and 2. Evaluating the model for an input value of x=1 yields an output value of:

y=21y=2

This coordinate pair is represented by the point (1, 2). Evaluating the model for an input value of x=2 yields an output value of:
y=22y=4

This coordinate pair is represented by the point (2, 4). Now that we have two points we first plot the two points and draw a straighline between them as indicated in the graph below.
 

Graph of y=2x produced on Desmos. Go to Desmos to explore this model.

Choosing three points is often advisable because if all three points do not fall on the same line, we know we made an error with at least one of the calculations that was done.

Plot by Points Steps

  1. Choose a minimum of two input values.
  2. Calculate the corresponding output values.
  3. Write the input and output values as coordinate pairs.
  4. Plot the coordinate pairs on a coordinate plane.
  5. Connect the coordinate pairs with a straight line.

Example 3

Graph the linear model defined by: y=23x+5


Solution

Begin by choosing input values. This linear model includes a fraction with a denominator of 3, so let’s choose multiples of 3 as input values. We will choose 0, 3, and 6.

Evaluate the linear model at each input values, and use the output values to identify coordinate pairs.

x=0y=23(0)+5=5(0,5)x=3y=23(3)+5=3(3,3)x=6y=23(6)+5=1(6,1)

Plot the coordinate pairs and draw a line through the points. The graph below is for the model y=23x+5

Graph of y=23x+5 produced on Desmos. Go to Desmos to explore this model.

The graph has a downward slant when reading left to right over the horizontal axis, which indicates visually a negative slope.

Try it Now 2

Graph the linear model given by y=35x+1

Hint 1 (click to Show/Hide)

When picking points for the graph it is helpful to identify what may make things easier for you in evaluating the model. Removing the fraction would help. To do this we want to pick values that 5 would divide nicely into as we are multiplying the input value by the fraction 35. Try using the following: x=0,5, and 10

Answer (click to Show/Hide)

Begin by choosing input values. This model includes a fraction with a denominator of 5, so let’s choose multiples of 5 as input values. We will choose 0, 5, and 10.

Evaluate the function at each input value, and use the output value to identify coordinate pairs.

x=0y=35(0)+1=1(0,1)x=5y=35(5)+1=4(5,4)x=10y=35(10)+1=7(10,7)

Plot the coordinate pairs and draw a line through the points as shown below.

Graph of y=35x+1 produced on Desmos. Go to Desmos to explore this model.


Graphing a linear model by using slope and a point

Before we jump into graphing a linear model using the slope and a point let us first review the basic definition given at the beginning of this section.

Linear Model

A linear model (equation) has the form y=mx+b.

  • The yintercept is the point at which the graph crosses the yaxis. It is indicated by b in the linear model y=mx+b and shown on the graph as the point (0,b).
  • The slope is a measure of the the line’s steepness, also known as the rate of change. It is represented by m in the linear model y=mx+b. The slope represents the vertical displacement (rise) and horizontal displacement (run) between each successive pair of points. The formula for slope between two points (x1,y1) and (x2,y2) is:

    m=change in output (rise)change in input (run)=yx=y2y1x2x1

We call this form of a linear equation the slope-intercept form as it gives the information about the slope, m, and y-intercept, b.

Graph of y=2x+1 produced on Desmos. Go to Desmos to explore this model.

Graph showing a line y-intercept location as it crosses the y-axis and the change of y and change of x to illustrate the slope

The y-intercept is a handy point to use when graphing a linear model as it is typically relatively easy to find if it is not given directly. If the linear model is not in the form y=mx+b we can find the y-intercept by setting x=0 in the equation and solve for y. The other approach is to solve the linear model for y and then pull the y-intercept directly from that equation.

The other characteristic of the linear model is the slope m, which is a measure of its steepness. Recall that the slope is the rate of change of output to input from the definition. Another way to think about the slope is by dividing the vertical difference, or rise, by the horizontal difference, or run.

If we know the slope and either a point or the y-intercept it is possible to graph the linear model by placing the point on the coordinate system and using the property of the slope to find another point the line goes through. After identifying that next point we can draw the line between the two points or continue to find points on the line using the slope. Choosing at least two points from the slope is often advisable because if all three points do not fall on the same line, we know we made an error.

Graphing a linear model from slope and a point

  1. Identify a known point on the line. This could be:
    • The y-intercept (0,b) from the equation y=mx+b. This is also found by evaluationg the linear model at x=0.
    • Any other given point (x,y) that satisfies the equation.
  2. Plot the point on the coordinate plane.
  3. Use the slope (riserun) to determine a second point (if the slope is not in a fractional form you will treat it as a fraction by dividing that number by “1”):
    • From the plotted point, move vertically by the numerator of the slope (rise).
    • Then move horizontally by the denominator of the slope (run).
    • The resulting position gives the second point.
  4. Sketch the line that passes through the points.

Example 4

Graph the following using information about the slope and the y-intercept: y=12x+1


Solution

The equation of the line given is already in slope intercept form y=mx+b, so we directly identify both the slope and the y-intercept.

The slope is 12. Because the slope is positive, we know the graph will slant upward from left to right.

The y-intercept is 1 and is the point on the graph (0,1). This is the starting point we can add to the graph shown below.

Recall that the slope is the rise over run, m=riserun. With the slope being 12, this means that the rise is 1 and the run is 2. So starting from our y-intercept (0,1), we can rise 1 and then run 2, or run 2 and then rise 1. We repeat until we have a few points, and then we draw a line through the points as shown below.

graph of the line y = (1/2)x +1 showing the rise, or change in the y direction as 1 and the run, or change in x direction as 2, and the y-intercept at (0,1)

Do all linear models have a y-intercept? What about an x-intercept?

The general answer to this is no. Not all linear models have both a y-intercept and an x-intercept. Linear equations can take various forms:

  • y=mx+b (slope-intercept form) has both a y-intercept and an x-intercept when m0 and b0.
  • x=c (vertical line) has an x-intercept at c,0, but no y-intercept (except when c=0 where all points are y-intercepts).
  • y=c (horizontal line) has a y-intercept at 0,c, but no x-intercept (except when c=0 where all points are x-intercepts).
  • y=mx has both a y-intercept and an x-intercept at the orgin 0,0.

While all these are valid linear equations we will focus on linear models of the form y=mx+b , where m0. These models represent relationships between two variables and typically have both x and y-intercepts.

Graph of y=2x+3 produced on Desmos. Go to Desmos to explore this model.

Graph of y=2x+3 showing y-intercept at (0,3) and x-intercept at (-3/2,0)

Graph of y=2x produced on Desmos. Go to Desmos to explore this model.

Graph of line y=2x showing (0,0) as a x and y intercept

Horizontal Line: Graph of y=3 produced on Desmos. Go to Desmos to explore this model.

Graph of horizontal line y=3 showing y intercept at (0, 3)

Vertical Line: Graph of x=4 produced on Desmos. Go to Desmos to explore this model.

Graph of vertical line x=4 showing x intercept at (4,0)

Try it Now 3

Graph the linear model by using information about the slope and y-intercept: y=23x+5

Hint 1 (click to Show/Hide)

Start by identifying the slope and y-intercept. Recall for the form y=mx+b we know m represents the slope and b the y-intercept.

Hint 2 (click to Show/Hide)

The slope is m=23.

The y-intercept is 5, so we know the point (0,5) is on the line.

Answer (click to Show/Hide)

The slope is m=23 and y-intercept is 5 giving us a point on the graph as (0,5).

First thing to note is the slope is negative. This means as we look at the “rise” in the slope it will actually be a decrease (going down). The slope tells us that for each movement in the horizontal direction “run” to the right by 3 units the vertical direction “rise” will decrease (go down) by 2 units.

We can now graph the linear model by first plotting the y-intercept. From the initial value (0,5) we move down 2 units and to the right 3 units. We can extend the line to the left and right by repeating, and then draw a line through the points.

graph of the line y = (-2/3)x + 5 showing the change of -2 in y and change of 3 in x.

Solve applications problems involving a linear model

In many real-life situations, we often find that two things (call them variables) are related to each other in a way that can be described by a straight line or linear model. In some situations one variable may explain the value of the other variable in a meaningful way. For example, the number of hours you work would explain the amount you receive on your next paycheck. When we have this type of situation we call that first variable (number of hours) the independent variable and the second (amount on paycheck) the dependent variable.

💡 Tip: Think about cause and effect. The independent variable usually causes or explains a change in the dependent variable.

In most situations the independent variable goes on the x-axis and the dependent variables goes on the y-axis. We often will use different letters than x and y in the model to help relate the variable names to the applications. For example we may use h to represent the hours and w to represent the wages from a paycheck.

Find a linear model in applications: A step-by-step guide

  1. Identify and Name Variables
    • Identify the two main variables being compared
    • Assign meaningful letter names to each variable
  2. Determine Independent and Dependent Variables
    • Decide which variable influences the other.
    • The influencing variable is the independent (x) variable.
    • The affected variable is the dependent (y) variable.
    • If there is no direct independent or dependent variable you can randomly assign which to be treated as x and which as y.
  3. Organize Data as Ordered Pairs
    • Write the given information as x,y pairs.
    • Use the format: (independent variable, dependent variable)
  4. Calculate the Slope
    • Use the slope formula: m=y2y1x2x1
  5. Find the y-intercept
    • Use the slope intercept form for the equation of the line y=mx+b and plug in the value of the slope and pick one of the ordered pairs and enter the values in for x and y. Solve for the unkown value of b to find the y-intercept.
  6. Write the Linear Model
    • Plug in the value for the slope and y-intercept into the linear model in slope intercept form: y=mx+b

Example 5

Research shows that a child’s vocabulary growth is approximately linear between 12 and 18 months of age. (Note: After 18 months, vocabulary tends to grow at a faster rate.) A study tracked a particular child’s vocabulary development with the followng results:

  • At 12 months of age: 5 words
  • At 18 months of age: 31 words
  1. Create a linear model for the relationship between the child’s age in months () and their vocabulary size (y).
  2. Use your model to predict the child’s vocabulary size at 15 months of age.

Solution

First identify the variables. We are given the age of a child and the number of words in the vocabulary. We will use the letter “a” to represent the age of the child and the letter “v” to represent the number of words in the vocabulary.

The age of a child best explains the number of words in the vocabulary. We will treat “a” as the x variable and “v” as the y variable. This gives us our structure for the linear model as: v=ma+b

The information provide in the text gives us two data points in the form (a,v).

  • At 12 months the child has a vocabulary of 5 words: (12,5).
  • At 18 months the child has a vocabulary of 31 words: (18,31).

Calculate the slope: m=(315)1812=266=133

Using the information about the slope and the ordered pair (12,5) we can now find the y-intercept value:

v=133a+b5=133(12)+b5=13(4)+b5=52+b552=b47=bThe linear model that relates the age (in months), a, and the number of words in the vocabulary, v, is:

v=133a47

Now to use that model to predict the number of words at 15 months of age we evaluate the model at a=15:

v=133a47v=1331547v=13547v=6547v=18

Based on the model the child would be predicted to have a vocabulary of 18 words at the age of 15 months.

What does that y-intercept value from our previous example represent? In this case the y-intercept would not have any meaning in the application as it would represent the number of words in the childs vocabulary at 0 months age. With what was told in the setup of the question a value of 0 for the age would not be okay to use for the linear model.

What about the slope? In the above example we found a linear model that related the childs age in months to the number of words in their vocabulary. The slope was found to be 133. When the slope was calculated the values used represented:

slope=(change in number of words in vocabulary)(change in age)

Putting this together with the values we have the interpretation of 13 words per 3 months. In other words we expect to see a gain of 13 words in the childs vocabulary for every three months of age. The slope is describing the rate of change in the vocabulary for the child with respect to age (in months).

What are the units of slope?

The slope is a ratio of y values to x values, so the units for slope will be the units of y over the units of x:

slope units=Units of yUnits of x

Example 6

In the Fall of 2019 the PCC tuition for an in-state residents was $84.50 for 1 credit. In Fall of 2020 the tuition for an in-state resident was $87.00 for 1 credit. Construct a linear model for the cost of in-state resident tuition of 1 credit hour assuming the trend is linear and continues in that pattern.

  1. What does the slope represent in our model?
  2. What is the predicted tuition in 2024?
  3. When would the tuition be over $150?

Solution

With the year potentially explaining the tuition cost we have an independent variable of time (the years after 2019) and a dependent variable being the tuition cost. Let t be the time (in years), but we will let t=0 represent the year 2019. The dependent variable being tuition cost can be represented by c.

The data that was given to use can be written as a coordinate pair (t,c).

  • In 2019 the cost for tuition was $84.50, so the corresponding ordered pair is (0,84.50).
  • In 2020 the tuition was $87.00 and gives the ordered pair as (1,87.00).

Find the slope based on the data provided:

m=(8784.50)10=2.501=2.50

In this instance we are given the y-intercept as we are using t=0 to represent the tuition in 2019 with a value of $84.50. This means the value of b, the y-intercept, is 84.50 for the model.

Putting the slope and intercept into the model we have: c=2.50t+84.50

  1. Our interpretation for the slope is that the tuition will increase by adding $2.50 per year (after 2019) to the total tuition cost. The y-intercept value of 84.50 is the starting tuition amount in 2019.
  2. To find the tuition in 2024 we will evaluate the model at t=5 as 2024 is fives years after 2019.

    c=2.50(5)+84.50c=12.50+84.50c=$97

  3. To find when the tuition is greater than $150 we can set the tuition in the model to 150 and solve for t.

    150.00=2.50t+84.50150.0084.50=2.50t65.50=2.50t65.502.50=t26.20=t

    The tuition reaches $150 a little after 26 years. If we use the model for t=26 and t=27 we see that it is over $150 when t=27 or the year 2046.

You may be asking why we wanted the start of the linear model in 2019 to be represented with t=0. The reason for this is to help with reading the model after it is created and having a better understanding of where the tuition started from by looking at the y-intercept value.

When t=0 the y-intercept is going to be $84.50; the starting tuition amount in 2019. If we had not picked that starting time as 2019 we would have ended up with a y-intercept that was negative and had no relation to the application for what happens when you enter 0 for the time (year).

Try it Now 4

The population of a small city was in 2012 was 32,500. By 2018 the city has grown to a population of 37,000. If we assume the population is growing with a linear trend, then find a linear model for the city’s population and use the model to answer the following questions:

  1. What does the slope mean in the model?
  2. What would the predicted population be in 2021?
  3. In what year would the population reach 45,000?
Answer (click to Show/Hide)

The two variables are the population and time. The time (year) explains how the population would change, so we will use time as our independent variable and the population as the dependent variable. Like the previous example we will let the time be represented by t, but be the number of years since 2012 (otherwise that y-intercept value would be a value for the population 2000 years ago and would have no meaning to us). The population can be represented with the letter p.

The given information gives us two ordered pairs as (0,32500) and (6,37000).

Calculate the slope:

m=(3700032500)60m=45006m=750 people per year

By our choice for t being the time after 2012 we already know the value of the y-intercept as 32,500. Enter both the slope and y-intercept value to have the linear model: p=750t+32500.

Now that the linear model was found answer the given questions.

  1. The slope represents the rate of change in the population to years. We found the slope to be equal to 750 and means the model is showing the population growing by adding 750 people each year.
  2. To predict the population in 2021 we need to use t=9 as 2021 is 9 years after 2012.

    p=750(9)+32500p=6,750+32500p=39,250

    The population in 2021 would be 39,250 based on the model.

  3. To find the year the population reaches 45,000 we will set p=45000 and solve for t.

    45000=750t+325004500032500=750t12500=750t12500750=t16.67‰ˆt

    Our model predicts the population will reach 45,000 after 16.67 years from 2012. This would happen sometime in the year 2028.

Exercises


  1. Identify which are linear models. If it is a linear model state the slope and y-intercept.
    1. y=x+10
    2. y=2x5
    3. y=49x1
    4. y=4x3+2
    Answer (click to Show/Hide)
    1. Linear: Slope is -1, y-intercept is 10
    2. Not Linear
    3. Linear: Slope is 49, y-intercept is -1
    4. Not Linear
  2. Find the equation of a line through the points (2,1) and (3,5)
    Answer (click to Show/Hide)

    y=4x7

  3. Find the equation of a line through the points (1,3) and (5,2)
    Answer (click to Show/Hide)

    y=14x+134

  4. Find the equation of a line through (3,2) and (0,5)
    Answer (click to Show/Hide)

    y=73x+5

  5. Graph the linear model given by y=5x4
    Answer (click to Show/Hide)

    Points picked will vary.

    Graph of y=5x4 produced on Desmos. Go to Desmos to explore this model.

  6. Graph the linear model given by y=x+5
    Answer (click to Show/Hide)

    Points picked will vary.

    Graph of y=x+5 produced on Desmos. Go to Desmos to explore this model.

  7. Graph the linear model given by y=23x1
    Answer (click to Show/Hide)

    Points picked will vary.

    Graph of y=23x1 produced on Desmos. Go to Desmos to explore this model.

  8. The population of beetles is assumed to be growing according to a linear model. The initial population was 30 beetles and after 8 weeks the population reached 62.
    1. What is a linear model to represent the amount of beetles after t weeks?
    2. How many beetles would we expect to find after 10 weeks?
    3. In what week would we expect to see the population reach 150?
    Answer (click to Show/Hide)
    1. P=4t+30
    2. 70 beetles after 10 weeks.
      P=4(10)+30P=70
    3. In Week 30.
      150=4t+30120=4t30=t
  9. The population of a town was 120,000 in 2010. In 2020 the town population was 180,000.
    1. Write is a linear model to represent the population n years after 2010.
    2. What does the model predict the population to be in 2025?
    3. Based on the model when would the population reach 250,000?
    Answer (click to Show/Hide)
    1. y=6,000n+120,000
    2. 210,000 is the predicted population in 2025.
    3. Based on the model the population would reach 250,000 during the year 2031.
      250,000=6,000n+120,000130,000=6,000n130,0006,000=n21.67‰ˆn
  10. A student tutors to help pay for college expenses. If they charge a flat fee of $20 plus $15 an hour, then we can model the total cost of money charges by the following: y=20+15x

    Describe what the slope and intercept represent in the model.

    Answer (click to Show/Hide)

    The slope is 15 in the model. This represents the hourly rate of $15 per hour charged for tutoring.

    The y-intercept is 20. This represents the flat fee charged for tutoring.

  11. A Manufacturer believes there is a linear relationship between the number of widgets, n, they can sell and the price, p, it can charge for the widget. They have historical data that shows they can sell 7,000 widgets at a price of $10 per widget and 1,000 widgets at a price of $25 per widget. Find a linear model that relates the price and number of widgets that can be sold.
    Answer (click to Show/Hide)

    We will find the linear model in the form: p=wn+b

    p=mn+bm=(1025)70001000=156000=1400p=1400n+b25=1400(1000)+b25=52+b25+52=b552=bp=1400n+552

  12. An internet provider charges for service based on the model: C=10+.15n, where n is the number of GB of data used and C is the monthly charge in dollars. Interpret both the slope and y-intercept for the model in terms of the application.
    Answer (click to Show/Hide)

    The slope represents the rate of change. In the model there is a slope of 0.15 which would translated as $0.15 per GB of data used.

    The y-intercept is an initial value where n=0. In the model the y-intercept is $10 which would mean that there is a flat $10 charge just for service without using any data.

Attributions

This page contains modified content from David Lippman, “Math In Society, 2nd Edition.” Licensed under CC BY-SA 4.0.

This page contains modified content from "College Algebra," Abramson, Jay et al., OpenStax. Licensed under CC BY 4.0.

This page contains content by Robert Foth, Math Faculty, Pima Community College, 2021. Licensed under CC BY 4.0.

License

Icon for the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

Topics in Mathematics Copyright © by Robert Foth is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License, except where otherwise noted.

Share This Book