from course_utils.example import proportional_response
inputs = [0, 1, 2, 3]
[(value, proportional_response(value, rate=2.5)) for value in inputs][(0, 0.0), (1, 2.5), (2, 5.0), (3, 7.5)]
Many scientific relationships can first be explored with a small model. The illustration below shows the three parts of the workflow used in this lesson.
Suppose a measured response is proportional to an input:
\[ y = kx. \]
The optional supporting package can keep reusable calculations in one tested place while the course page concentrates on interpretation.
from course_utils.example import proportional_response
inputs = [0, 1, 2, 3]
[(value, proportional_response(value, rate=2.5)) for value in inputs][(0, 0.0), (1, 2.5), (2, 5.0), (3, 7.5)]
Predict the response for an input of 4 when \(k=2.5\). Explain what the value of \(k\) means in this model.
# Replace the missing value, then run the cell.
proportional_response(4, rate=...)A useful computational example should support the scientific idea rather than hide it. Put reusable mechanics in a helper only when that makes the authored lesson clearer.