We’re going to compute a quadratic function from 3 representative points in the curve-table we’ve been working with. While our model would be most accurate if we kept track of all of the decimal values, for today we are going to simplify our calculations by doing some rounding.

a tight cluster of points around an invisible parabola

1 Identify three whole-number coordinate pairs we can use to summarize a curve that would model the point cloud:

  • a best guess for where the curve crosses the y-axis

  • a point from the middle of the curve

  • a point from the right side of the curve

2 Fill in the x and y-values in the standard form models below using the three points you found:

y (mpg) = a(x (speed))2 + b(x (speed)) + c

y (mpg) = a(x (speed))2 + b(x (speed)) + c

y (mpg) = a(x (speed))2 + b(x (speed)) + c

3 In the space below - or on another sheet of paper - solve this series of equations for a, b, and c.
As we solve the series, we’ll likely get some very long decimal values. You can round these values to the thousandths place as we work.

4 Write your finished model in function and Pyret notation below.

Function Notation

Pyret Notation

f(x) = a x2  + b x + c

fun f​(​x​): (​(​  ​* sqr​(​x​)​) + (​  ​* x​)​) +   end

5 Update the function definition for f on line 57 of the Aaron Judge Starter File and test it out using fit-model!

These materials were developed partly through support of the National Science Foundation, (awards 1042210, 1535276, 1648684, 1738598, 2031479, and 1501927). CCbadge Bootstrap by the Bootstrap Community is licensed under a Creative Commons 4.0 Unported License. This license does not grant permission to run training or professional development. Offering training or professional development with materials substantially derived from Bootstrap must be approved in writing by a Bootstrap Director. Permissions beyond the scope of this license, such as to run training, may be available by contacting contact@BootstrapWorld.org.