Four synchronised clock timestamps

PHYSICS · Multi-part · Fermi University Physics · Mathematical Methods for Physics · Numerical and computational mathematics · Numerical and computational mathematics

Error, Chance and the Machine, Ch Rounding, backward error and the sensitivity of a computation

Problem

Four synchronised clock timestamps, in seconds, are recorded as ti=1.6×109+{3,11,8,18}t_i = 1.6\times10^{9} + \{3, 11, 8, 18\} (that is, a large common offset of 1.6×109 s1.6\times10^9\ \mathrm{s} plus small readings). A technician computes the variance in binary64 (u=1.11×10−16u = 1.11\times10^{-16}) using the one-pass shortcut var=⟨t2⟩−⟨t⟩2\mathrm{var} = \langle t^2\rangle - \langle t\rangle^2 (division by N=4N=4 throughout) and obtains a nonsensical result. The technician concludes: "The formula is algebraically correct, so there must be a bug in the code." ((a)) Compute the true variance using the two-pass method (subtract the mean first, then average the squared deviations). ((b)) Using the estimate that the one-pass formula's relative error is of order u⟨t⟩2/varu\langle t\rangle^2/\mathrm{var}, estimate that relative error here and say whether the technician's diagnosis is correct. ((c)) Rewrite the computation stably by subtracting the first timestamp from every reading before applying the shortcut. Using the estimate u [1+(⟨t⟩−t1)2/var]u\,[1+(\langle t\rangle-t_1)^2/\mathrm{var}] for the shifted data, estimate the new relative error.

Browse the problem library