Solution

ID: past-exam-of-the-mathematical-and-computational-biology-course-of-the-university-of-cambridge/2024/paper-2/a3/b/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 need not reach the deepest one, which is near . For the literal maximization in part (a), no minimum was being sought at all. Under the intended minimization interpretation, the result near belongs to a different attraction region from the global minimum.
Figure 1.
Local extrema, the global minimum and the constrained minimum of the oscillatory objective
. Details.

New to topics? Read the docs here!