Ask a better questionLesson 05 of 30 · 6 min
Let the explanation lose
Choose a follow-up test that separates a proposed mechanism from a rival.
A hypothesis is a proposed explanation you can examine with evidence. In practice, a test also depends on auxiliary assumptions: your code works, your instrument measures the intended event, and your starting conditions are what you think they are.
Suppose a model says saving depends only on repeated keys. It predicts no saving with unique keys. A reliable saving there would challenge that model. Before rejecting it, check whether keys really were unique and the measured boundary stayed the same.
The invented observations below disagree with a simple model at zero repetition. A residual is an observation minus its model prediction. A pattern in residuals can suggest something the model leaves out. Revising a model is useful when the revision produces a new prediction you can test on fresh evidence.
- Model prediction
- Invented observation
At zero repetition, how large should the residual be if the prediction is accurate and measurement noise is small?
Write a prediction (optional)
Run the prepared example
This page puts the example in the Python editor. Select Run Python with the code unchanged.
Invented data
A saved draft is open. To run the published example, open Editor tools and select Restore example. Recover draft brings your code back.
Execution error
Technical error details
What to compare
Find the first value in Observed minus predicted (ms), which belongs to zero repetition. If the model predicted that setting well, how close to zero would you expect this difference to be?
Your result
Result tools
The original differences are all positive. A fixed saving or a timer offset could explain a gap even when no keys repeat.
Published example output
The site ran the original code to produce this reference. Build environment ↗
Observed minus predicted (ms): [12. 11. 12. 11. 12.]
The original differences are all positive. A fixed saving or a timer offset could explain a gap even when no keys repeat.
Change and run again
In the Python editor, change prediction = 40 * repeat_fraction to prediction = 40 * repeat_fraction + 12. Select Run Python again. How do the values in Observed minus predicted (ms) change? Describe a new measurement that could separate a real fixed saving from a timer offset. Return to the Python editor
What this example supports. The observations were constructed to expose a missing term. A fitted revision needs fresh testing; fitting the same data is not independent confirmation.
Try a fresh case
One result contradicts a prediction. What should you do first?
Hints for this question
- List the assumptions that connect the hypothesis to the prediction.
- Choose a check whose result would differ between explanations.