Prediction Examples: 46 Problems with Answers

Worked examples of Prediction to try before you open each solution, then practice problems with answers.

Worked Examples

Example 1

medium
A linear regression model gives y^=2.5x+10 where x = hours studied and y = test score. Predict the score for a student who studies 8 hours, and explain why this is a prediction, not a guarantee.
Show solution

Answer

y^=30 for x=8 hours. This is the average predicted score, not an individual guarantee.

First step

1.
Substitute x=8: y^=2.5(8)+10=20+10=30... wait, let's check context. More realistic: y^=2.5(8)+50=20+50=70 (assuming intercept 50 for a score scale)

See the full worked solution + why-it-works coaching

SetupKey insightWhy it worksCommon pitfallConnection

Free: full solutions on 3 topics a day. No card.

Every topic, every day: the Family plan

Example 2

hard
A model predicts house prices. In-sample R2=0.92, but out-of-sample R2=0.45. Explain what this means and identify the problem with the model.

Example 3

medium
A regression y^=3x+1 was fit on x∈[1,10]. (a) Predict y at x=6. (b) State whether x=6 and x=25 are interpolation or extrapolation.

Example 4

medium
A model gives prediction y^=50 with standard error 5. Give a rough 95% prediction interval using the ±2 SE rule.

Example 5

medium
A linear model fit to (1,3), (2,5), (3,7) gives y^=2x+1. Predict y at x=2.5 and identify whether the prediction is interpolation or extrapolation.

Example 6

hard
You average two independent unbiased predictions with variances 25 and 25. What is the variance of the averaged prediction, and what does the reduction tell you about combining models?

Example 7

hard
A model predicts sales: y^=15x+200. Actual values for x=10,20,30 are 360,510,660. Compute the predictions, residuals, and discuss whether the model fits well.

Example 8

challenge
A new model and an old model both make 100 predictions. New model: mean absolute error (MAE) =4, 95% interval coverage =88%. Old model: MAE =6, coverage =94%. Which is preferred and why?

Practice Problems

Try each one, then open the solution to compare your method.

Example 1

easy
Using the model y^=3x−5, predict y when x=4 and x=0. Then find x when y^=25.

Example 2

hard
Why is extrapolation (predicting outside the observed range) dangerous? Give an example where extrapolating from a linear model would give a clearly unreasonable prediction.

Example 3

easy
A good prediction reports an estimate together with a measure of its ___.

Example 4

easy
A model fit on ages 10-18 is used to predict height at age 50. What error is this?

Example 5

easy
A linear model predicts y=3x+2. What is the predicted y when x=4?

Example 6

easy
A model predicts sales of '500 units, 95% interval [450, 550].' What does the interval represent?

Example 7

easy
A model predicts well but cannot explain why X causes Y. Prediction does not require ___.

Example 8

easy
Every prediction uses patterns from the ___ to estimate the future.

Example 9

easy
Which is a more honest prediction: 'exactly 1,000 sales' or '1,000 sales, give or take 100'?

Example 10

easy
A weather model outputs '80% chance of rain.' Is this a prediction with uncertainty?

Example 11

medium
A line y=2x+5 fits data for x∈[0,10]. Predict y at x=8 and state whether it is interpolation or extrapolation.

Example 12

medium
The same line y=2x+5 is used to predict y at x=50. Compute it and flag the risk.

Example 13

medium
Two predictions for the same value: A says 100±5, B says 100±30. If both are unbiased, which is more useful and why?

Example 14

medium
A model predicts ice cream sales from temperature with high accuracy. Can we conclude temperature causes the sales pattern? Why or why not?

Example 15

medium
A trend grew linearly for 5 years. A naive model predicts the same growth for 50 more years. What is the main danger?

Example 16

medium
A regression gives prediction y^=20 with standard error 4. Give an approximate 95% prediction interval (use ±2 SE).

Example 17

medium
Why does prediction uncertainty typically grow as you predict further from the center of the data?

Example 18

medium
A model predicts house price =150x+50000 where x is square footage. Predict the price for a 1200 sq ft house.

Example 19

medium
A prediction says '20 units expected, 90% interval [12, 28].' If actual sales are 26, was the outcome within the predicted uncertainty?

Example 20

challenge
A model y^=1.5x+10 was trained on x∈[0,20]. Predict at x=12 and x=40; state which prediction you trust and why.

Example 21

challenge
Two unbiased models predict the same target: A has prediction variance 9, B has variance 16. If you average them (equal weight, independent), what is the variance of the averaged prediction?

Example 22

challenge
A linear model fit on years 1-5 (sales 10, 20, 30, 40, 50) is y^=10x. The real year-10 sales were 70, not 100. What does the gap reveal about extrapolation?

Example 23

easy
A model y^=4x−7 is trained on x∈[0,12]. Predict y^ when x=5.

Example 24

easy
A weather app says 'High 72°F, give or take 3°F.' What is the predicted high, and what is the uncertainty?

Example 25

easy
The model y^=0.5x+2 predicts test score from hours studied. Predict the score for 10 hours.

Example 26

easy
For the linear model y^=−2x+30, predict y at x=4.

Example 27

medium
A model predicts daily revenue: y^=200x+5000, where x is ads shown (thousands). Predict revenue when x=12.

Example 28

medium
A regression on plant height vs days gives y^=0.4x+2 cm for x∈[0,60] days. Predict the height at x=30 and at x=365 (one year). Which prediction would you trust?

Example 29

medium
Two unbiased predictions: A reports 80±2, B reports 80±10. Which is more useful for planning, and why?

Example 30

medium
A model trained on weekday traffic predicts weekend traffic and is wildly wrong. What kind of failure is this?

Example 31

medium
A model predicts y^=42 with 80% interval [38,46]. Customer requires 90% certainty. Will the 90% interval be narrower or wider, and why?

Example 32

medium
A model predicts test scores with a residual standard deviation of 6. About 95% of actual scores should fall within how many points of the predicted value?

Example 33

medium
In a weather model: P(rain)=0.7 today, but it does not rain. Does this prove the model wrong?

Example 34

hard
A regression on years 2000-2020 gives global average temperature y^=0.02x+14. Predict the temperature in year 2100 and discuss two reasons to distrust the result.

Example 35

hard
A doctor's model predicts a patient has an 85% probability of recovery. The patient does not recover. Does this single case mean the model is broken?

Example 36

hard
You have two unbiased models for the same quantity, with variances 9 and 4. Combining them with weights inversely proportional to variance gives optimal weights w1=4/13 and w2=9/13. Find the combined variance.

Example 37

hard
A model says y^=100 with 95% interval [80,120]. The next observation is 135. Is this evidence the model is wrong?

Example 38

challenge
A nonlinear model fit on x∈[0,10] gives y^=x2. The relationship beyond x=10 is actually y^=10x (linear). At x=20 the model predicts 400, but reality is 200. Compute the relative error.

What to focus on

Core idea: A prediction is an estimate of an unknown value that always carries how sure you are about it.

Common stuck point: The procedure for prediction is the easy part; the trap is reporting a prediction as an exact number with no range. Asking "Am I stating a value I have not observed, with a sense of how uncertain it is?" first is what keeps a correct-looking calculation from being attached to the wrong concept.

Ask yourself: Am I stating a value I have not observed, with a sense of how uncertain it is?

Concept recap

A prediction is a model-based estimate of an unknown or future value, accompanied by a measure of confidence or uncertainty.

Making a prediction is like throwing a ball to a friend who is running. You aim not where they are but where their speed says they will be. A short throw usually lands close; a long throw gives them time to slow down or turn, so you are less sure where they will be. A good prediction comes with that sense of how sure you are.

Read the full lesson on Prediction

Background knowledge

These ideas may be useful before you work through the harder examples.

data abstractcorrelation