Does a fitted correction generalize?

Mark Yourself Question

  1. Grab a piece of paper and try this problem yourself.
  2. When you're done, check the "I have answered this question" box below.
  3. View the solution and report whether you got it right or wrong.

An AI-generated energy function accepts n≥2n\geq2 finite, nonnegative power readings in watts and a finite positive spacing Δt\Delta t in seconds. It returns


Eraw=Δt1000∑i=0n−1PiE_{\text{raw}}=\frac{\Delta t}{1000}\sum_{i=0}^{n-1}P_i


in kilojoules. The required model is


Eref=Δt1000(P02+∑i=1n−2Pi+Pn−12).E_{\text{ref}}=\frac{\Delta t}{1000}\left(\frac{P_0}{2}+\sum_{i=1}^{n-2}P_i+\frac{P_{n-1}}{2}\right).


On a calibration trace of four readings, all 200 W200\ \text{W}, spaced 2 s2\ \text{s} apart, the raw function returns 1.60 kJ1.60\ \text{kJ} and the reference gives 1.20 kJ1.20\ \text{kJ}. The AI assistant proposes multiplying every raw result by 0.750.75 and claims the function is now verified for all valid inputs.


a) Evaluate that correction for readings [100,500,100] W[100,500,100]\ \text{W} spaced 3 s3\ \text{s} apart. Calculate the reference energy, corrected energy, and absolute relative error in percent.


b) For a trace whose sum of readings is positive, derive the factor Eref/ErawE_{\text{ref}}/E_{\text{raw}}. Explain whether the calibration establishes a universal factor.


c) State a replacement calculation and propose two independently calculated acceptance tests that challenge different features of it. Explain what passing those tests would establish.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Use of AI in Programming Questions: