[MUSIC] People have the idea that a local minimum means the function decreases and
then increases. Here's a local minimum on the graph of
this random function. And the misconception is that they all
look like this. That every time you got a local minimum
on one side, the function's decreasing, and on the other side the function's
increasing. Plenty of local minima do look exactly
like that. But, there's also plenty of pathological examples.
For instance, consider this a somewhat pathological example.
I'm going to define this function f as a piecewise function.
If the input's nonzero, I'm going to do this. 1+sin(1/x), which makes sense since
x isn't zero, time x^2. And if the input is zero, the function's
output will also be zero. In this case, there's a local minimum at
zero. How do I know? Well, here's how I know.
Let's take a look at this function The claim is that f(x) is never negative.
How do I know that? Well, what do I know about sine? Sine of absolutely anything
at all, no matter what I take this sine of, is between -1 and 1.
Now, if I add 1 to this, 1 plus sine of absolutely anything at all,
is between zero and two. Now, that's pretty good.
Now, think back to the definition of this function.
Here, I've got 1 plus sine of something, it doesn't matter what,
alright? 1 plus sine of anything,
this is between zero and two. Now,
I'm multiplying it by x^2. What do I know about x^2? Well, x^2 is
not negative. It could be zero, it could be positive.
But no matter what x is, x^2 is not negative.
Now, I'm multiplying 1+sin(1/x), this number which is trapped between zero and
to, by x^2 which is never negative. And that means f(x) is not negative as long
as x isn't equal to zero, alright?
As long as x isn't equal to zero. I mean, this first case and this is a
non-negative number times a non-negative number, so the product is also
non-negative. Now, the other possibility, of course, is
that I plug in zero for x. But then, f(0) is just by definition
zero. And that means in either case, no matter
that I plug in for x, f(x) is never a negative.
Now if f(x) is never negative and f(0)=0, then I know that this must be the
smallest possible output value for the function.
The only numbers that are smaller than zero are negative numbers, and the output
of this function is never negative. But this isn't the usual sort of local
minimum where the function just decreases and then increases.
Well, here's the graph for our funciton f.
And, there is a local minimum at zero, but if I start zooming in, no matter how
much I zoom in, there's no little region on which the graph is just decreasing and
then increasing. The graph is always wiggling.
The upshot here is that decreasing and then increasing is one way to produce a
local minimum, but it's not the definition of a local minimum.
And not every local minimum arises in that exact way.
What a local minimum means is just that no nearby output value is smaller than
that local minimum value.