Tables and regression
Reading position saved on this browser; this is not a completion record.
Start here
Organize inputs and outputs without confusing a fitted model with a fact.
By the end of this section
Create data and function tables, test candidates efficiently, fit justified models, interpret coefficients and residuals, compute selected statistics correctly, and recognize when the supplied data do not determine a unique rule.
3.1 Build a table that answers a question
In the graphing calculator, use Add Item and select Table. A first table commonly uses column names x1 and y1. Enter each observed pair on the same row. For a function table, replace a dependent column’s heading with an expression such as f(x1); the values then compute from the inputs.[8]
Observed values belong in an editable data column. Calculated values belong in a computed column. Do not overwrite data with a formula when you still need to compare actual and predicted outcomes.
Goal | Useful setup |
|---|---|
Evaluate a rule repeatedly | Define f(x), then use columns x1 and f(x1). |
Compare two expressions | Use x1, f(x1), and g(x1) at informative allowed inputs. |
Check answer choices | Put candidate inputs in x1 and evaluate the original expression. |
Fit measured pairs | Put the measured independent and dependent values in x1, y1. |
Audit a model | Keep y1 and add a calculated prediction or residual column. |
Choose inputs that reveal structure
A table of two expressions at x
To identify a linear pattern, compare Δy/Δx, not just Δy. Equal output differences signal a constant rate only when the input gaps are equal. To identify exponential growth from a table, compare output ratios across equal input intervals.
Finite evidence has a finite reach
One failed allowed input disproves an identity. Several successful inputs do not normally prove it. A finite table determines a global rule only when the problem supplies a suitable model family and enough independent information. See Example 3.14.
3.2 Regression: choose the model, then fit its parameters
Regression estimates parameters within a model you choose. It does not decide the scientific meaning of the variables or prove a causal relationship.
After entering data, build a custom regression with a tilde rather than an equals sign. Use the actual table-column names. Desmos stores fitted parameters for reuse in later expressions.[9] The manual tilde method below avoids depending on a newer regression-menu layout.
Model family | Regression recipe |
|---|---|
Linear, y |
|
Quadratic, y |
|
Exponential, y |
|
Known vertex, y | Substitute known h, k; fit only unknown a. |
Protect the setup
Check the rows and headings before fitting. A missing negative sign or a value in the wrong row changes the model. Remove old definitions of parameter letters so the calculator can estimate them. Do not type y where the model needs the entire observed column y1.
After fitting, define the model as a function using its fitted parameters and evaluate the requested input. Prefer that evaluation to retyping a coefficient rounded from its display. Label the result as a prediction when the data are noisy.
Exact interpolation is a different claim
Two distinct points determine a line when linearity is given. Three points at distinct inputs determine a polynomial of degree at most 2. But not every group of three observed points justifies a quadratic real-world model. Matching known data and explaining a process are different tasks.
Read the units before naming the coefficient
If x is hours and y is liters, a linear slope has units liters per hour. If x is the number of two-hour intervals, the same coefficient refers to two hours. In abx, b is a multiplier per one unit of the actual input variable, not necessarily per day or per year.
Do not overfit a simple question
When the given equation already supplies a model, use that model. Do not refit a few rounded values and replace the stated rule with a slightly different regression equation. When one point determines one unknown coefficient, direct substitution may be faster and exact.
3.3 Residuals and the limits of a fitted line
A residual compares an observed output with its predicted output at the same input:
residual
Positive means the point is above the fitted graph; negative means it is below. A residual is a vertical difference in output units, not a horizontal distance and not automatically a percentage.
For the data (0, 2), (1, 3), (2, 7), (3, 7), (4, 11), least-squares linear regression gives
Interpolation and extrapolation
A prediction inside the observed input range is interpolation. A prediction outside is extrapolation. Both depend on the model; extrapolation adds the assumption that its pattern continues beyond the data. A convincing-looking line does not guarantee an accurate distant prediction.
Fit quality is not permission to overclaim
A model can fit a small data set well yet fail on new data. A strong numerical fit does not establish causation, remove selection bias, or identify a population to which the result applies. If a question asks what a study justifies, its sampling and experimental design matter more than the calculator display.
Three outputs, three meanings
Coefficient: a number in the model. Prediction: the model’s output at a selected input. Residual: the observed output minus that prediction. Label which one the question requests before using the fitted values.
3.4 Lists, statistics, and trustworthy table work
Desmos provides list-based statistics including mean and median. Its stdev and stdevp functions use sample and population conventions, respectively.[10][11] For SAT questions comparing spread, mathematical reasoning about transformations is often faster than calculating either value.
Task | Example recipe or method |
|---|---|
Mean |
|
Median |
|
Sum |
|
Population spread |
|
Frequency-weighted mean | Multiply each value by its count; divide the combined total by the combined count. |
A frequency is a count, not another measurement
If 2 occurs three times, 5 occurs four times, and 9 occurs once, the mean is
Taking mean([2,5,9]) instead would give equal weight to three distinct values, not to the eight observations. For a short set, expanding the list is safe. For a long set, a weighted calculation avoids tedious duplication.
Distinguish transformation from inference
Adding the same constant to every value moves the mean and median by that constant but leaves standard deviation unchanged. Multiplying every value by c multiplies standard deviation by |c|. These facts follow from how distances from the mean transform; they do not require a statistical test.
The sample/population function choice matters when a numerical standard deviation is requested. Do not infer the required convention merely because a story says “survey.” Follow the quantity defined by the problem. When comparing two same-size lists using the same convention, the ordering of their standard deviations is unchanged by the common sample-versus-population scale factor.
A four-part data audit
Pairs: Does each input remain with its output? Counts: Are repeated observations represented?
Units: What does one input unit mean? Model: Does the question justify this family and enough independent information to identify its parameters?
15 worked examples
3.01. Create a computed function table
For f(x) = 2x2 − 3x − 2, find f(−1), f(0), and f(2).
Show worked solutionHide worked solution for example 3.01
Recognize. The same rule is evaluated at several inputs. A computed column avoids rewriting the rule three times.
Enter: f(x)=2*x^2-3*x-2
Work. Create a table with first heading x1 and second heading f(x1). Put −1, 0, 2 in the input column. The outputs are 3, −2, 0, in that order. The second column is computed, so do not try to type observed values into its cells.
Answer: f(−1)
Check. Direct substitution gives 2 + 3 − 2
Avoid the trap. Use f(x1), not f(x), as the table's computed heading. The subscript links the column to the actual input list.
3.02. Choose a test input that distinguishes expressions
A student claims (x + 2)2 = x2 + 4 for every real x because both expressions equal 4 at x = 0. Use a table to test the claim.
Show worked solutionHide worked solution for example 3.02
Recognize. One matching input is insufficient. Choose another allowed input where the omitted cross term would matter.
Enter: f(x)=(x+2)^2
Enter: g(x)=x^2+4
Work. Use table headings x1, f(x1), and g(x1). At x
Answer: The claim is false; at x
Check. Expanding gives (x + 2)2
Avoid the trap. A convenient input can hide exactly the term being tested. Use the table to find a counterexample, then explain the structural reason.
3.03. Test answer choices in the original equation
Which of 2, 4, 7, 8 satisfies (x − 1)(x − 7) = 0 and x > 3?
Show worked solutionHide worked solution for example 3.03
Recognize. Candidate inputs can be tested together. The equation and the additional restriction must both hold.
Enter: f(x)=(x-1)*(x-7)
Work. Enter the four candidates in a table with computed heading f(x1). The outputs are −5, −9, 0, 7. Only input 7 gives zero, and 7 > 3. Factoring also reveals the other algebraic root 1, which the restriction excludes.
Answer: 7.
Check. (7 − 1)(7 − 7) = 6(0) = 0. The candidate satisfies both conditions.
Avoid the trap. Do not choose the input with the smallest nonzero output. Solving the equation means an output of zero, not merely an output close to zero.
3.04. Compare rates when the input gaps differ
A linear function has table entries (0, 3), (2, 7), (5, 13), (9, 21). Find its slope.
Show worked solutionHide worked solution for example 3.04
Recognize. The input steps are 2, 3, and 4. Output differences alone are not rates.
Enter: (7-3)/(2-0)
Enter: (13-7)/(5-2)
Enter: (21-13)/(9-5)
Work. The three rates are 4/2
Answer: 2.
Check. f(9) = 2(9) + 3 = 21 and the intercept matches f(0)
Avoid the trap. Nonconstant output differences do not rule out a line when input intervals differ. Likewise, exponential ratios must be compared over equal input intervals.
3.05. Fit a line to noisy data
Use a least-squares linear model for the data (0, 2), (1, 3), (2, 7), (3, 7), (4, 11). What output does the model predict at x = 3?
Show worked solutionHide worked solution for example 3.05
Recognize. The points are not exactly collinear. The request explicitly calls for a fitted linear model, not a line through two selected points.
Enter: y_1~m*x_1+b
Enter: f(x)=m*x+b
Enter: f(3)
Work. Enter the five pairs in a table first. The fitted parameters are m
Answer: 8.2.
Check. The mean point is (2, 6), and the fitted line passes through it: 2.2(2) + 1.6
Avoid the trap. An equals sign does not request a regression. Use the tilde with the actual table columns, and label 8.2 as predicted rather than observed.
3.06. Read a residual with the correct sign
A fitted model is = 2.2x + 1.6. An observed point is (3, 7). Find its residual.
Show worked solutionHide worked solution for example 3.06
Recognize. A residual is observed minus predicted at the same input.
Enter: 7-(2.2*3+1.6)
Work. The model predicts 8.2 at input 3. The observed value is 7, so the residual is 7 − 8.2
Answer: −1.2 output units.
Check. The point lies 1.2 vertical units below the fitted line, which agrees with the negative sign.
Avoid the trap. Subtracting in the reverse order reports the prediction error with the opposite convention. Also do not subtract the input 3 from the observed output 7.
3.07. Fit an exact quadratic from enough information
A quadratic function passes through (0, 5), (1, 4), (2, 7). Find its value at x = 3.
Show worked solutionHide worked solution for example 3.07
Recognize. Three distinct input values provide enough independent equations for the three coefficients of a quadratic.
Enter: y_1~a*x_1^2+b*x_1+c
Enter: f(x)=a*x^2+b*x+c
Enter: f(3)
Work. The fitted coefficients are a
Answer: 14.
Check. From x
Avoid the trap. A quadratic can fit three points exactly without being the right model for an unspecified process. Here the problem supplies the quadratic assumption.
3.08. Fit an exponential with the correct time interval
An exponential model has values 160, 100, and 62.5 at times 0, 2, and 4 hours. Predict its value at 6 hours.
Show worked solutionHide worked solution for example 3.08
Recognize. The common multiplier 100/160
Enter: y_1~a*b^(x_1/2)
Enter: f(x)=a*b^(x/2)
Enter: f(6)
Work. With the actual hours in x1, this form gives a
Answer: 39.0625.
Check. Multiply the 4-hour value by one more two-hour factor: 62.5(0.625)
Avoid the trap. Using 160(0.625)x with x measured in hours would apply the decay twice as often. Match the exponent to the stated time unit.
3.09. Choose a model family before fitting
At inputs 0, 1, 2, 3, an exact exponential function has outputs 9, 18, 36, 72. Find its output at input 4.
Show worked solutionHide worked solution for example 3.09
Recognize. Equal input steps produce a constant output ratio of 2.
Enter: 9*2^4
Work. The initial output is 9 and the per-unit growth factor is 2, so f(x)
Answer: 144.
Check. The next value is one more doubling: 72(2)
Avoid the trap. A straight line through the first and last points would match those endpoints but miss the intermediate values. The regression button cannot replace selecting a justified family.
3.10. Compute mean and median from the actual observations
Find the mean and median of 4, 7, 7, 9, 13.
Show worked solutionHide worked solution for example 3.10
Recognize. All five observations, including the repeated 7, must be represented.
Enter: mean([4,7,7,9,13])
Enter: median([4,7,7,9,13])
Work. The mean is (4 + 7 + 7 + 9 + 13)/5 = 40/5 = 8. The list is already ordered, so the third observation is the median, 7. The two summaries measure different features and need not agree.
Answer: Mean
Check. Five observations times the mean gives the total: 5(8)
Avoid the trap. Deleting a duplicate changes the data set. The mean of the four distinct values is not the mean of these five observations.
3.11. Weight the values by their frequencies
A frequency table shows value 2 with frequency 3, value 5 with frequency 4, and value 9 with frequency 1. Find the mean.
Show worked solutionHide worked solution for example 3.11
Recognize. Frequencies count how often each measurement occurs. There are eight observations, not three.
Enter: (2*3+5*4+9*1)/(3+4+1)
Work. The total of all observations is 6 + 20 + 9
Answer: 4.375.
Check. 8(4.375)
Avoid the trap. Neither the mean of [2, 5, 9] nor the mean of [3, 4, 1] answers the question. One list contains distinct measurements; the other contains counts.
3.12. Compare spread without overcomputing
List A is [4, 6, 8] and list B is [14, 16, 18]. Compare their population standard deviations.
Show worked solutionHide worked solution for example 3.12
Recognize. Every value in B is 10 greater than its partner in A. The shift changes location, not spread.
Enter: stdevp([4,6,8])
Enter: stdevp([14,16,18])
Work. The means are 6 and 16. Both lists have deviations −2, 0, 2 from their respective means. Thus both population standard deviations are
Answer: They are equal.
Check. Using the sample convention consistently would give 2 for each list. It changes the numerical scale here, not the equality.
Avoid the trap. Calling stdev on one list and stdevp on the other creates an artificial difference. Use the convention specified and apply it consistently.
3.13. Fit only the parameter that is actually unknown
The parabola y = a(x − 2)2 + 5 passes through (6, 37). Find a.
Show worked solutionHide worked solution for example 3.13
Recognize. The vertex is already specified. There is only one unknown coefficient, so one nonvertex point supplies enough information.
Enter: y_1~a*(x_1-2)^2+5
Work. A one-row table with x1
Answer: 2.
Check. 2(6 − 2)2 + 5 = 2(16) + 5 = 37. The supplied point is not the vertex, so its squared factor is nonzero.
Avoid the trap. Fitting an unrestricted ax2 + bx + c to one point is underdetermined. The known vertex information must remain built into the model.
3.14. Recognize an underdetermined regression
A quadratic passes through (0, 2) and (1, 5). Does this determine its value at x = 2?
Show worked solutionHide worked solution for example 3.14
Recognize. Two points do not generally determine all three quadratic coefficients.
Work. Writing f(x)
Answer: No. The value at x
Check. Both examples give output 2 at input 0 and output 5 at input 1. Their different outputs at 2 prove nonuniqueness.
Avoid the trap. Running regression on too few independent conditions may fail or return one of multiple fits. “The calculator gave coefficients” is not a uniqueness argument.
3.15. Center the time variable before interpreting the intercept
A linear model gives outputs 50, 58, and 66 in years 2018, 2020, and 2022. Using t = years since 2018, predict the output in 2025.
Show worked solutionHide worked solution for example 3.15
Recognize. Changing the input origin changes the intercept, not the underlying rate.
Enter: y_1~m*x_1+b
Enter: f(x)=m*x+b
Enter: f(7)
Work. Enter 0, 2, 4 as the first-column inputs, not the calendar years. The fit is f(t)
Answer: 78.
Check. From 2022 to 2025 there are three years, adding 3(4)
Avoid the trap. Putting 2025 into a model whose input means years since 2018 gives an absurd result. Coefficients only make sense alongside the variable definitions.
Audit the input origin before evaluating
Calendar year | Years after 2018 | Model output |
|---|---|---|
2018 | 0 | 50 |
2020 | 2 | 58 |
2022 | 4 | 66 |
2025 | 7 | 78 (prediction) |
Transfer habit
Write the definition of the input beside the model. A formula using years after 2018 and a formula using the calendar year can describe the same line, but their intercepts differ. Do not mix the input of one formula with the intercept of the other.
Section synthesis: a model is a claim with conditions
Keep observations separate from predictions. State the input unit, model family, and unknown parameters before fitting. After fitting, use the model only for the quantity requested and retain its precision. If the data do not identify a unique model, report that limitation rather than invent a coefficient.
3.6 Section exit check
Work without the lesson open. Choose a method, show enough reasoning to check the result, and record any tool or interpretation error. These questions include tool-decision drills as well as mathematical problems.
Before checking the solutions
Name one question where a manual method was shorter, one place where calculator setup needed care, and one check that would catch a plausible wrong answer. If you cannot name an independent check, return to the relevant worked example.