Previous | Next --- Slide 88 of 114
Back to Lecture Thumbnails
Mike

Why do we set h=2 here? Where does 2 come from?

motoole2

The $h=2$ represents the distance between samples. So in this case, we're sampling two values $f(x+1)$ and $f(x-1)$ at points $x+1$ and $x-1$, which have a distance of $(x+1)-(x-1) = 2$.

We could change this value though. For example, we could sample $f(x+1)$ and $f(x)$ (corresponding to $h=1$), or $f(x-2)$ and $f(x+2)$ (corresponding to $h=4$). However, $h > 0$ should be as small as possible for the derivative to be approximately correct.

Mike

Thanks! That makes a lot of sense!