For the double well f(x) = x^4 - 4x^2, why does the starting point decide which minimum you reach?
answer
- count the stationary points first
- there is a hill between the wells
- downhill paths cannot climb out
- the sign of the starting x settles it
basics
~20 sf(x) = x^4 - 4x^2 has minima at x = -sqrt(2) and x = +sqrt(2) with a local maximum at x = 0 between them. A downhill search never climbs that barrier, so the starting sign fixes the answer.
solid answer
~50 sDifferentiating gives `f'(x) = 4x^3 - 8x = 4x(x^2 - 2)`, so the stationary points are `x = 0` and `x = ±sqrt(2)`. Since `f''(x) = 12x^2 - 8`, we get `f''(0) = -8 < 0`, a local maximum, and `f''(±sqrt(2)) = 16 > 0`, two local minima with `f = -4`. The local maximum at the origin is a barrier between two **basins of attraction**: start anywhere with `x < 0` and every downhill step keeps `x` negative, so you land at `-sqrt(2)`; start with `x > 0` and you land at `+sqrt(2)`. Here the two wells are equally deep, so either answer is globally optimal. Tilt the function — say `f(x) = x^4 - 4x^2 + x`, which lowers the left branch and raises the right — and the wells stop being equal, so one starting region converges to a genuinely worse local minimum.
go deeper
Be able to solve for the stationary points and say which is the hump and which are the wells. Knowing that a local minimum need not be the global one is the takeaway here.
Explain the barrier argument: a downhill path never increases the value, so it cannot cross a point higher than where it started. Be ready to define basin of attraction in your own words.
Show how you would diagnose start-dependent results in practice, distinguishing a genuine multi-basin landscape from an actual defect, and describe a restart strategy and what you record from each run.
Own the policy question of how much budget goes to exploring multiple basins versus refining one, and set the standard for what a team is allowed to claim about a solution it cannot certify as globally optimal.
## Mapping the landscape Start by finding every stationary point of `f(x) = x^4 - 4x^2`: `f'(x) = 4x^3 - 8x = 4x(x^2 - 2)` This vanishes at `x = 0`, `x = -sqrt(2)` and `x = +sqrt(2)`. Now classify them with the second derivative, `f''(x) = 12x^2 - 8`: - At `x = 0`: `f''(0) = -8`, negative, so the origin is a **local maximum**, with value `f(0) = 0`. - At `x = ±sqrt(2)`: `f''(±sqrt(2)) = 12*2 - 8 = 16`, positive, so both are **local minima**, each with value `f = 4 - 8 = -4`. The picture is a W-shape: two wells of equal depth with a hump between them. This is the standard **double well**, and it is the smallest example that separates "stationary", "local minimum" and "global minimum" into three different ideas. ## Basins of attraction A **basin of attraction** for a minimum is the set of starting points from which a downhill procedure converges to that minimum. Here the boundary between the two basins is the local maximum at the origin. The reason is simple: a strictly downhill method only ever moves to points with a lower value. To get from a negative `x` to a positive one you must pass through `x = 0`, where `f = 0`, which is higher than everything in either well. So a downhill path starting at `x = -3` cannot reach `+sqrt(2)`, and a path starting at `x = +3` cannot reach `-sqrt(2)`. The sign of the initial `x` determines the answer completely, and the two runs are equally correct: they are answering different questions, namely "what is the best point reachable downhill from here". ## Local versus global A point `c` is a **local minimum** if no point in some neighbourhood of `c` has a smaller value. It is a **global minimum** if no point in the whole domain does. In `x^4 - 4x^2` the symmetry makes both local minima global as well — they tie at `-4` — so starting-point dependence costs nothing in objective value even though it changes the answer you report. Break the symmetry and the cost appears. Consider `f(x) = x^4 - 4x^2 + x`. The added linear term lowers the function wherever `x` is negative and raises it wherever `x` is positive, so the left well becomes strictly deeper than the right one. The landscape still has two wells with a hump between them, but now one of them is the global minimum and the other is a genuinely suboptimal local minimum. A run started on the right converges to a point that is stationary, that passes the second-derivative test as a bona fide local minimum, and that is nevertheless worse than what a run started on the left would have found. ## Why this matters beyond the toy Three lessons transfer directly to real objectives. **First, convergence is not optimality.** A method that has stopped has found a point it cannot improve on locally. Nothing about stopping tells you the value is the best available. Reporting "the optimiser converged" as evidence of a good solution is the classic overclaim. **Second, you cannot certify global optimality from local information.** Standing at `+sqrt(2)` in the tilted well, everything you can measure — the value, the zero derivative, the positive curvature — looks exactly as it does at the deeper minimum. Distinguishing them requires information from elsewhere in the domain, not more precision where you are. **Third, the practical response is to sample the space.** Run the search from several diverse starting points and compare the final values. That does not prove you found the global minimum, but it converts a single arbitrary answer into a distribution over basins, and a wide spread in the final values is a direct warning that the landscape has multiple wells and that your reported answer is start-dependent. ## The reproducibility angle If two people run the same procedure on the same objective and get different answers, the landscape rather than the code is often responsible. Before hunting for a bug, check whether the reported points are both stationary and both local minima with different values. If they are, the runs are behaving correctly and the real question is which basin you want — a modelling decision, not a numerical one. That also means the starting point is part of the specification of the result and belongs in whatever you record about the run.
- How is the stationary point at x = 0 classified for f(x) = x^4 - 4x^2?It is a local maximum. The derivative `4x^3 - 8x` vanishes there, and the second derivative `12x^2 - 8` evaluates to `-8`, which is negative, so the curve bends downward. Its value `f(0) = 0` sits above the two wells at `-4`, which is exactly what makes it the barrier separating the two basins.
- Can you certify that a local minimum you have found is the global one?Not from local information alone. The value, the zero gradient and the positive curvature look identical at a shallow well and a deep one, so nothing measurable at the point distinguishes them. Certification needs either an exhaustive search of the domain or structural knowledge of the function. In practice you settle for many diverse starts and report the best value found.
- What does a wide spread in final values across several restarts tell you?That the landscape has multiple basins with different depths, and therefore that any single reported answer is an accident of where that run began. It is a direct signal to keep restarting, to record the starting point alongside the result, and to be sceptical of claims that the procedure found the best solution.
Rain falling on either side of a ridge line ends up in different valleys. The water is following the same rule everywhere; the ridge alone decides the destination.
saying these in an interview costs you the question
- Treats convergence as proof of global optimality
- Assumes any stationary point found is the global minimum
- Blames different results across runs on a bug in the code
- Thinks a downhill method can cross the barrier between wells
- Confuses the local maximum at the origin with a minimum