Your sample's mean came out at 5.08 and the target was 5.00. Is that a real difference, or just the wobble you'd expect from a handful of measurements?
The t-statistic answers it by measuring the gap in units of "how much wobble this sample size gives you":
n - 1.n values. More values means less wobble, which is why the same gap gets more convincing as n grows.Task: write one_sample_t(values, mu0) returning [t, dof] — the statistic rounded to 4 decimal places, and the degrees of freedom n - 1 as a plain integer.
values holds at least two numbers and is never all-identical, so the standard error is never zero.t is perfectly normal — it just means the sample mean came in below mu0. Don't take an absolute value.Roughly: |t| above about 2 starts to look like a real difference rather than noise, though the exact cutoff depends on the degrees of freedom.