= Solution
Plot the entire stated interval:
``
import matplotlib.pyplot as plt
x_grid = np.linspace(-4, 4, 1500)
plt.plot(x_grid, f(x_grid))
plt.xlabel("x")
plt.ylabel("f(x)")
plt.show()
``
The oscillating objective has several wells. A local search starting at $-1$ need not reach the deepest one, which is near $-0.309$. For the literal maximization in part (a), no minimum was being sought at all. Under the intended minimization interpretation, the result near $-1.546$ belongs to a different attraction region from the <global minimum>.
\Image[/past-exam-of-the-mathematical-and-computational-biology-course-of-the-university-of-cambridge/2024/paper-2-multistart-optimization.png]
{title=Local extrema, the <global minimum> and the constrained minimum of the oscillatory objective}
Back to article page