Skip to content
tryhardprep
All lessons

Desmos for data and regression

6 minute read · 6 sections

Read first: Math: how the section works, Desmos basics for the test

0 of 6 sectionsSections

When to reach for a table

A Having Desmos find the equation that best fits a set of points once you tell it the shape, such as a line or a parabola. means typing points into a Desmos table and letting Desmos find the equation through them. You tell it the shape, such as a line or a parabola, and it works out the numbers.

The points don't always come as a table. A A rule that takes in one number and gives back one number, like f(x) = 5x - 7.Read the lesson value like f(2)=11 f(2)=11 is the point (2,11) (2,11) , and "after 3 minutes the tank holds 210 liters" is the point (3,210) (3,210) .

A line needs two points and a parabola three. With exactly that many, the equation Desmos finds goes through every point, so its numbers are exact. An A relationship where each step multiplies by the same number, like doubling every year.Read the lesson through two points needs no table: divide the outputs and take a root, as the nonlinear functions lesson shows.

Leave Desmos closed when there's nothing exact to type. On a scatterplot you can only guess where each dot sits, and the question is about the The straight line that best follows the trend of the dots in a scatterplot.Read the lesson already drawn, so read the line. The two-variable data lesson shows how. Read a box plot or a A bar chart that shows how many values fall in each range.Read the lesson the same way. And when a question asks what a number means in the story, no fit can tell you.

Fitting a line through two points

A water tank drains at a steady rate. Three minutes after a valve opens, the tank holds 210 liters. Eight minutes after it opens, the tank holds 110 liters. Which equation gives the number of liters y y in the tank x x minutes after the valve opens?

  • A. y=−20x+270 y=-20x+270
  • B. y=−0.05x+210.15 y=-0.05x+210.15
  • C. y=−20x+210 y=-20x+210
  • D. y=20x+150 y=20x+150

The two readings are the points (3,210) (3,210) and (8,110) (8,110) .

Fit a line

  1. Open the + menu at the top of the rows and choose table.
  2. Type 3 under x1 x_1 and 210 under y1 y_1 . Put 8 and 110 in the next row.
  3. On the next empty row below the table, type y1~mx1+b. Desmos lowers each 1 by itself, and the ~ needs Shift.
  4. A Regression Parameters box appears under that row, showing m=−20 m=-20 and b=270 b=270 . You can ignore the other numbers in it.

The line is y=−20x+270 y=-20x+270 , so the answer is A. To check it, put in the second reading: −20(8)+270=110 -20(8)+270=110 .

You could work out the How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson by hand and then solve for b b , but the table gets both at once. Don't type an underscore for the small 1. Desmos basics shows what it does to the row.

Trap: The first reading as the starting value

Choice C, y=−20x+210 y=-20x+210 , has the right slope but starts the tank at 210 liters. That's the amount at minute 3.

What to do: The starting value is the amount at minute 0. Take it from b in the box.

Choice B divides the wrong way: 5 minutes over a drop of 100 liters gives −0.05 -0.05 . Choice D has a positive slope, but the tank is losing water.

Filling in a missing value

The table gives values of the linear function f f . What is the value of k k ?

x x f(x) f(x)
17
317
8k k

Type only the two complete rows into the table and fit y1~mx1+b. The box shows m=5 m=5 and b=2 b=2 , so f(x)=5x+2 f(x)=5x+2 .

Find the missing value

  1. On a new row, type f(x)=5x+2.
  2. On the row under it, type f(8). It prints = 42.

So k=42 k=42 . For more than one gap, give each The number you put into a function, like the 4 in f(4).Read the lesson its own row, like f(2) and f(5).

Leave the row with the empty cell out of the table. If you type a 0 there to fill it, Desmos treats the 0 as a real value, and the line it fits comes out wrong.

Finding a parabola's vertex

A parabola passes through (1,0) (1,0) , (2,6) (2,6) and (6,−10) (6,-10) . What is the x x -coordinate of its vertex?

Type the three points into a table. On the row below it, type y1~ax1^2+bx1+c straight through. Desmos lowers each 1, and the + after the 2 drops you back out of the The small raised number that says how many times to multiply, like the 3 in x cubed.Read the lesson.

The box shows a=−2 a=-2 , b=12 b=12 and c=−10 c=-10 , and Desmos draws the curve through the three points. Click the curve, then click the gray dot at its highest point. It reads (3,8) (3,8) , so the answer is 3.

Trap: The biggest given output

Of the three points, (2,6) (2,6) has the biggest output, so 2 looks like the answer. The curve keeps climbing past it and turns at x=3 x=3 .

What to do: Read the vertex off the fitted curve. None of the given points has to be the vertex.

If the question wants A quadratic written as a number times (x minus h) squared, plus k, so you can read the vertex (h, k) right off it.Read the lesson, keep the same a a and use the vertex: y=−2(x−3)2+8 y=-2(x-3)^2+8 . The nonlinear functions lesson shows how to find a vertex by hand.

Statistics from a short list

For a short list of numbers, skip the table and put the numbers in square brackets. mean([3,5,10]) prints 6, and median([3,5,10]) prints 5. stdev works the same way for the How spread out a set of numbers is around its average.Read the lesson. If the numbers are already in a table column, mean(y1) uses them as they are.

A frequency table says how many times each value appears:

ValueFrequency
23
52
102
121

Type each value that many times. mean([2,2,2,5,5,10,10,12]) prints 6, and median of the same list prints 5. If you type each value once, mean([2,5,10,12]) prints 7.25, because the 2, which appears three times, now counts only once.

To compare spread, put each set's stdev on its own row. The sets 1,5,9 1,5,9 and 1,1,9 1,1,9 have the same smallest and largest values, but stdev([1,1,9]) prints the bigger number, so that set is more spread out.

Skip the list when the question only describes the numbers, as in "40 whole numbers, all between 10 and 50." There's nothing to type. Skip it too when a frequency table adds up to more than about 20 values. The one-variable data lesson covers what these numbers mean.

Practice

Work through the three examples, then try five more questions. Before you open Desmos on each one, decide whether there's anything exact to type.

Worked example

At Xiomara’s woodworking shop, the linear function ff gives the number of board feet used for xx cabinet frames.

xx | f(x)f(x) 7 | 87.5 12 | 125 16 | 155 21 | 192.5

Which equation defines ff?

  1. A

    f(x)=7.5x+35f(x) = 7.5x + 35

  2. B

    f(x)=37.5x+35f(x) = 37.5x + 35

  3. C

    f(x)=7.5x−35f(x) = 7.5x - 35

  4. D

    f(x)=35x+7.5f(x) = 35x + 7.5

Show the answer
  • A

    f(x)=7.5x+35f(x) = 7.5x + 35

    Correct answer

    Using the points (7,87.5)(7,87.5) and (12,125)(12,125), the How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson is 125−87.512−7=7.5\frac{125-87.5}{12-7}=7.5. Substituting (7,87.5)(7,87.5) into f(x)=7.5x+bf(x)=7.5x+b gives b=35b=35, so f(x)=7.5x+35f(x)=7.5x+35.

  • B

    f(x)=37.5x+35f(x) = 37.5x + 35

    This uses the The number a function gives back, like the 13 when f(4) = 13.Read the lesson increase, 125−87.5=37.5125-87.5=37.5, as the How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson without dividing by the The number you put into a function, like the 4 in f(4).Read the lesson increase, 12−7=512-7=5. The slope is 37.5/5=7.537.5/5=7.5.

  • C

    f(x)=7.5x−35f(x) = 7.5x - 35

    This subtracts the Where a graph crosses an axis.Read the lesson 3535 instead of adding it. Substitution gives 87.5=7.5(7)+3587.5=7.5(7)+35, so the intercept is positive.

  • D

    f(x)=35x+7.5f(x) = 35x + 7.5

    This swaps the How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson and Where a graph crosses an axis.Read the lesson, placing 3535 as the The number multiplying a letter, like the 5 in 5x.Read the lesson of xx and 7.57.5 as the A number that doesn’t change, like the 7 in 5x + 7, or a letter such as p that stands for one fixed value.Read the lesson. The calculated slope is 7.57.5, and the intercept is 3535.

Solution

Use two points from the table to find the How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson:

m=125−87.512−7=37.55=7.5m=\frac{125-87.5}{12-7}=\frac{37.5}{5}=7.5.

Write the A rule that takes in one number and gives back one number, like f(x) = 5x - 7.Read the lesson as f(x)=7.5x+bf(x)=7.5x+b. Substitute (7,87.5)(7,87.5):

87.5=7.5(7)+b87.5=7.5(7)+b

87.5=52.5+b87.5=52.5+b

b=35b=35.

Therefore, the Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson is f(x)=7.5x+35f(x)=7.5x+35. It also gives f(21)=7.5(21)+35=192.5f(21)=7.5(21)+35=192.5, matching the table.

Worked example

In the xyxy-plane, a line passes through the points (84,95)(84, 95) and (98,89)(98, 89).

Which equation defines this line?

  1. A

    y=−73x+291y = -\frac{7}{3}x + 291

  2. B

    y=−37x+95y = -\frac{3}{7}x + 95

  3. C

    y=−37x+131y = -\frac{3}{7}x + 131

  4. D

    y=37x+59y = \frac{3}{7}x + 59

Show the answer
  • A

    y=−73x+291y = -\frac{7}{3}x + 291

    This Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson divides the horizontal change, 1414, by the vertical change, −6-6, giving −73-\frac{7}{3}. How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson is vertical change divided by horizontal change.

  • B

    y=−37x+95y = -\frac{3}{7}x + 95

    This Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson uses the first point's yy-coordinate, 9595, as the yy-intercept. The point (84,95)(84,95) is not on the yy-axis because its xx-coordinate is not 00.

  • C

    y=−37x+131y = -\frac{3}{7}x + 131

    Correct answer

    The How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson is 89−9598−84=−614=−37\frac{89-95}{98-84}=-\frac{6}{14}=-\frac{3}{7}. Substituting (84,95)(84,95) into y=−37x+by=-\frac{3}{7}x+b gives 95=−36+b95=-36+b, so b=131b=131.

  • D

    y=37x+59y = \frac{3}{7}x + 59

    This Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson treats the decrease from 9595 to 8989 as a positive vertical change. Since yy decreases as xx increases, the How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson must be negative.

Solution

Calculate the How steep a line is, measured by how much it goes up for each unit it moves to the right.Read the lesson using vertical change divided by horizontal change:

m=89−9598−84=−614=−37m=\frac{89-95}{98-84}=\frac{-6}{14}=-\frac{3}{7}. Use y=mx+by=mx+b and substitute (84,95)(84,95):

95=−37(84)+b95=-\frac{3}{7}(84)+b

95=−36+b95=-36+b

b=131b=131. Therefore, the line is y=−37x+131y=-\frac{3}{7}x+131.

Worked example

The mass of silt in each load from a dredger, L(d)L(d), measured in metric tons, is a quadratic function of the dredging depth dd, in meters, for 2≤d≤62\leq d\leq 6. Measurements give L(2)=136L(2)=136, L(4)=156L(4)=156, and L(6)=160L(6)=160.

Which equation defines LL in a form that displays the maximum silt mass per load as a constant?

  1. A

    L(d)=−2(d+5.5)2+160.5L(d) = -2(d + 5.5)^2 + 160.5

  2. B

    L(d)=−2(d+22)2+100L(d) = -2(d + 22)^2 + 100

  3. C

    L(d)=−2(d−6)2+160L(d) = -2(d - 6)^2 + 160

  4. D

    L(d)=−2(d−5.5)2+160.5L(d) = -2(d - 5.5)^2 + 160.5

Show the answer
  • A

    L(d)=−2(d+5.5)2+160.5L(d) = -2(d + 5.5)^2 + 160.5

    Using b/(2a)b/(2a) instead of −b/(2a)-b/(2a) gives a The point where a parabola turns, which is its lowest point if it opens up and its highest if it opens down.Read the lesson depth of −5.5-5.5 meters. This sign error produces (d+5.5)2(d+5.5)^2.

  • B

    L(d)=−2(d+22)2+100L(d) = -2(d + 22)^2 + 100

    This Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson transfers the The number multiplying a letter, like the 5 in 5x.Read the lesson from −2d2+22d+100-2d^2+22d+100 directly into −2(d+22)2+100-2(d+22)^2+100. Completing the square requires factoring out −2-2 from the A letter that stands for a number you don’t know yet, like the x in 5x + 7.Read the lesson terms and adjusting the A number that doesn’t change, like the 7 in 5x + 7, or a letter such as p that stands for one fixed value.Read the lesson to preserve the A rule that takes in one number and gives back one number, like f(x) = 5x - 7.Read the lesson.

  • C

    L(d)=−2(d−6)2+160L(d) = -2(d - 6)^2 + 160

    This Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson treats (6,160)(6,160), the measurement with the largest recorded mass, as the The point where a parabola turns, which is its lowest point if it opens up and its highest if it opens down.Read the lesson. The largest of the three measured values does not establish the An expression whose biggest power is a square, like x squared plus 3x minus 4.Read the lesson's maximum.

  • D

    L(d)=−2(d−5.5)2+160.5L(d) = -2(d - 5.5)^2 + 160.5

    Correct answer

    The measurements give L(d)=−2d2+22d+100=−2(d−5.5)2+160.5L(d)=-2d^2+22d+100=-2(d-5.5)^2+160.5. Since −2(d−5.5)2≤0-2(d-5.5)^2\leq 0, the maximum silt mass is the displayed A number that doesn’t change, like the 7 in 5x + 7, or a letter such as p that stands for one fixed value.Read the lesson 160.5160.5 metric tons, attained at d=5.5d=5.5 meters.

Solution

Write L(d)=ad2+bd+cL(d)=ad^2+bd+c. Substituting the measurements gives 4a+2b+c=1364a+2b+c=136, 16a+4b+c=15616a+4b+c=156, and 36a+6b+c=16036a+6b+c=160.

Subtract consecutive Two expressions set equal to each other, like 5x + 7 = 22.Read the lesson to get 12a+2b=2012a+2b=20 and 20a+2b=420a+2b=4. Subtracting these gives 8a=−168a=-16, so a=−2a=-2. Then −24+2b=20-24+2b=20 gives b=22b=22, and −8+44+c=136-8+44+c=136 gives c=100c=100.

Complete the square: L(d)=−2(d2−11d)+100=−2[(d−5.5)2−30.25]+100=−2(d−5.5)2+160.5L(d)=-2(d^2-11d)+100=-2[(d-5.5)^2-30.25]+100=-2(d-5.5)^2+160.5.

The squared term is smallest at d=5.5d=5.5, where it equals zero. Multiplying it by −2-2 makes every other The number a function gives back, like the 13 when f(4) = 13.Read the lesson smaller, so the displayed A number that doesn’t change, like the 7 in 5x + 7, or a letter such as p that stands for one fixed value.Read the lesson 160.5160.5 is the maximum silt mass per load in metric tons.

Try it

5 questions on this skill, with every choice explained.

Start the drill

Next steps