TITLE: Gradient is NOT the direction that points to the minimum or maximum
QUESTION [14 upvotes]: I understand that the gradient is the direction of steepest descent (ref:  Why is gradient the direction of steepest ascent? and Gradient of a function as the direction of steepest ascent/descent). 
However, I am not able to visualize it.

The Blue arrow is the one pointing towards minima/maxima. The gradient  (black arrow) is not and that's why we have this zig-zag motion. 
Then how come gradient is the direction of steepest descent/ascent? 
I have a related question: Why does gradient ascent/descent have zig-zag motion?

REPLY [7 votes]: Your black lines are not gradient lines at all.  The gradient should be perpendicular to the contour lines at every point.  Even in an ellipsoidal valley, the gradient will not point to the lowest point, but it will point much closer to it than your picture indicates.  
A function minimizer that follows the local gradient has to take a finite sized step in the direction of the gradient, then find the gradient at the new location to take the next step.  Often evaluating the gradient is very expensive and you want to do it as few times as possible.  One approach is then to follow the gradient from your current point as far as the function stops decreasing, then stop, evaluate the local gradient, and set off in that direction.  If that is your strategy, each new direction will be at a right angle to the prior direction.  If the new gradient were not perpendicular to the old direction of travel, you could decrease the function by moving farther or not so far in the old direction of travel.  You only change direction when you are at a local minimum in the direction you are going.