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

  • Context: Graduate 
  • Thread starter Thread starter AxiomOfChoice
  • Start date Start date
  • Tags Tags
    Error
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 2K views
AxiomOfChoice
Messages
531
Reaction score
1
Consider the following situation. You know, for a given function [itex]f[/itex] and [itex]i,k \in \mathbb N \cup \{ 0 \}[/itex], [itex]n\in \mathbb N[/itex], that

[tex] f \left( \frac kn \right) = \frac{i}{\sqrt n}.[/tex]

In addition, you know that either

[tex] f \left( \frac{k+1}{n} \right) = \frac{i-1}{\sqrt n}[/tex]

-OR-

[tex] f \left( \frac{k+1}{n} \right) = \frac{i+1}{\sqrt n}.[/tex]

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

[tex] f(t) - f \left( \frac{\lfloor tn \rfloor}{n} \right) = O(1/n).[/tex]

where of course I have referred to the floor function. (Incidentally, if [itex]\frac kn \leq t \leq \frac{k+1}{n}[/itex] as assumed, doesn't it follow that [itex]\lfloor nt \rfloor = k[/itex]?) 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

[tex] f(t) - f \left( \frac{\lfloor tn \rfloor}{n} \right) = \frac{k - tn}{\sqrt n},[/tex]

whereas if the SECOND option obtains, we have

[tex] f(t) - f \left( \frac{\lfloor tn \rfloor}{n} \right) = \frac{tn - k}{\sqrt n}.[/tex]

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