Numerical Methods Quiz

Test your understanding — Weeks 5–8

These quizzes help you distinguish between numerical approaches covered in Weeks 5–8 of Programming & Numerical Methods. Each section tests a different topic. Select your answer, then click Check to see whether you’re right — and why.

Section 1 — Root-Finding

  1. You need to find the steady-state capital stocks of a 3-country Solow model — a system of three non-linear equations in three unknowns. Which approach is most appropriate?

  1. You run fsolve on a non-linear system with initial guess x₀ = [0.5, 0.5, 0.5] and get a solution. You change to x₀ = [5, 5, 5] and get a different answer. What is the most likely explanation?

  1. Your non-linear equation has a parameter that must satisfy 0 < s < 1 (e.g., a saving rate). You use fsolve and it returns s = 1.3. What is the best response?

Section 2 — Optimisation

  1. You minimise the 5-dimensional Rosenbrock function with brute-force grid search and with BFGS. Brute-force takes 17 seconds; BFGS takes 0.01 seconds with comparable accuracy. Why is BFGS so much faster?

  1. You want to minimise a function but you cannot compute or approximate its gradient. Which method is most appropriate?

  1. You are solving a consumer’s constrained utility maximisation problem: max u(x) subject to p·x ≤ I and x ≥ 0. You have coded three approaches from the lecture: penalty method, augmented Lagrangian, and SQP (Newton on the Lagrangian). Which statement is correct?

  1. You need to minimise a function subject to the constraint x₁² + x₂² ≤ 1. The feasible set is bounded. Which of the following methods can directly handle this inequality constraint?

Section 3 — Function Approximation

  1. You interpolate f(x) = 1/(1+x²) on [−5, 5] with uniformly spaced nodes and a degree-11 polynomial. The approximation oscillates wildly near the boundaries. What is this phenomenon called, and how do you fix it?

  1. You need to approximate a value function V(k) that has a kink (is continuous but not differentiable at a point). Which approximation method handles this best?

  1. When constructing a Chebyshev approximation of f on [a, b], why do we map the interval to [−1, 1] before computing the nodes?

Section 4 — Choosing the Right Method

  1. Match the problem to the best numerical approach: “Find the saving rate s ∈ (0,1) such that the Solow steady-state condition k* = (sA/δ)^(1/(1−α)) matches a target capital stock.”

  1. Match the problem to the best numerical approach: “Represent the value function V(k) on a grid of 50 capital values so that you can evaluate V at any k between grid points during value function iteration.”

  1. Match the problem to the best numerical approach: “Maximise a consumer’s Cobb-Douglas utility u(x) = Σ αᵢ log(xᵢ) subject to a budget constraint p·x ≤ I and non-negativity xᵢ ≥ 0.”

  1. You are comparing BFGS, Nelder–Mead, and L-BFGS-B for minimising a function on a box [0.5, 2]⁵. Which statement is true?