Is the Error O(1/n) in Linear Interpolation Correct?

  • Thread starter Thread starter AxiomOfChoice
  • Start date Start date
  • Tags Tags
    Error
AxiomOfChoice
Messages
531
Reaction score
1
Consider the following situation. You know, for a given function f and i,k \in \mathbb N \cup \{ 0 \}, n\in \mathbb N, that

<br /> f \left( \frac kn \right) = \frac{i}{\sqrt n}.<br />

In addition, you know that either

<br /> f \left( \frac{k+1}{n} \right) = \frac{i-1}{\sqrt n}<br />

-OR-

<br /> f \left( \frac{k+1}{n} \right) = \frac{i+1}{\sqrt n}.<br />

And suppose that you linearly interpolate between k/n and (k+1)/n. The book I'm reading claims that, for any t between k/n and (k+1)/n, we have

<br /> f(t) - f \left( \frac{\lfloor tn \rfloor}{n} \right) = O(1/n).<br />

where of course I have referred to the floor function. (Incidentally, if \frac kn \leq t \leq \frac{k+1}{n} as assumed, doesn't it follow that \lfloor nt \rfloor = k?) Question: IS THIS (the part about O(1/n)) RIGHT? I don't think it is.
 
Last edited:
Physics news on Phys.org
I've calculated, and it seems to me that if the FIRST option obtains, we have

<br /> f(t) - f \left( \frac{\lfloor tn \rfloor}{n} \right) = \frac{k - tn}{\sqrt n},<br />

whereas if the SECOND option obtains, we have

<br /> f(t) - f \left( \frac{\lfloor tn \rfloor}{n} \right) = \frac{tn - k}{\sqrt n}.<br />

So I know EXACTLY what the errors are as a function of t, and in either case they are bounded by 1/\sqrt n, simply because |tn - k| \leq 1. Have I done something wrong?
 
Back
Top