Lesson 35 Exercise Review
Overall Assessment
The work demonstrates readiness for Lesson 36. The central ideas are secure: the gradient assembles coordinate sensitivities, directional derivatives are dot products, the gradient represents the differential in Euclidean coordinates, and gradient descent uses the negative gradient.
Problems 1-3, 6, and 8-11 are correct apart from local arithmetic or implementation cleanup. Problems 4, 5, and 7 need corrections, but the errors are sign-copying and geometric-expression issues rather than prerequisite gaps.
Problem-by-Problem Review
-
Correct overall. A partial derivative is one coordinate sensitivity, while the gradient collects all coordinate sensitivities. The surface-slice picture is useful. One geometric refinement: the gradient lives in the input plane and is normal to a contour line there; it is not a vector lying in the tangent plane of the graph itself.
-
Correct:
-
The norm and stated unit direction are correct:
The extra rationalization line at the bottom simplifies rather than the full vector expression and should be discarded.
-
All three direction vectors were correctly verified as unit vectors, but the gradient’s second component was copied as instead of the exercise’s . Using
gives:
-
The conclusion needs correction. If is tangent to the contour , moving along keeps constant to first order. Therefore:
A zero dot product means the gradient is perpendicular to the contour tangent. The gradient is not tangent to the contour.
-
Correct. Cauchy-Schwarz gives the upper bound for every unit vector:
Equality occurs when points in the gradient direction. The absolute-value form also bounds the magnitude of the directional derivative.
-
The setup identifies the right first-order formula and displacement, but was evaluated with the wrong sign and the gradient was not evaluated at . For
we have:
Hence:
The exact value is:
-
Correct. The displacement is , and the predicted first-order loss change is .
-
Correct. A zero gradient supplies no first-order classification; the Hessian supplies the relevant second-order curvature information.
-
The analytic gradient is correct:
The centered-difference structure is also correct. The TypeScript needs small syntax fixes: close the function signature with
): number[], use one function name consistently, and return or assert the componentwise tolerance check. -
Correct. The differential is the linear map that consumes an input displacement, while the gradient is the Euclidean vector representing that map through
Readiness
Ready for Jacobians. Lesson 36 should reinforce three refinements:
- preserve signs when copying vectors and functions;
- derive contour orthogonality from a zero directional derivative;
- evaluate both the base function and gradient at the stated point before applying a first-order approximation.