Answer each using Python and Markdown. First, state what type of optimization (2 points), the number of dimensions (1 point), if it's convex (1 points), and if there are bounds or constraints (2 points). Next, write out any constraints or rearrangements of equations in Markdown. For example, if you use root finding you should write out the expression for which you're finding roots (e.g., $x^2 = 4$ becomes $x^2 - 4 = 0$). Solve the problem ( 6 points) and then graph your solution (4 points). You must make a graph showing a graph of the equation and the otpimum point for each problem 16 points per problem. You must also print your numerical answer.
Solve the following equation
$$ \sin x = \sqrt{x} \ln x $$Find the minimum value for this expression:
$$ x^4 - x^2 - x $$Find the positive root for this expression. Specify bounds in your call to the optimization function
$$ \frac{x^3(1 - x)}{x^2 - x + 2} = -\frac{1}{10} $$Take $p$ to be a probability. Find the maximum value for the following expression:
$$ p^{8} (1 - p)^{2} $$Minimize the following problem where $x$ and $y$ are bounded to lie between $-\pi$ and $\pi$.
$$ \cos 3.1x \sin 5.2y + \frac{(x + y - 2)^2}{250} $$The following snippet will plot the function in 3D
import numpy as np
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
def fxn_5(x, y):
return 2 * np.cos(3.1 * x) * np.sin(5.2 * y) + (x + y - 2)**2 / 250
x = np.linspace(- np.pi, np.pi, 100)
y = np.linspace(-np.pi, np.pi, 100)
xx, yy = np.meshgrid(x, y, sparse=True)
z = fxn_5(xx, yy)
plt.contourf(x,y,z, cmap=cm.plasma)
plt.colorbar()
plt.show()
Maximize the following equation subject to the following constraints $x_0 > 0$, $x_1 > 0$, $ x_0 + x_1 = 1$. You do not need to plot this.
$$ f(x_0, x_1) = e^{-(x_0 - 4)^2}e^{-(x_1 + 2)^2} $$Solve the following system of equations. Remember that if there are multiple solutions, it is non-convex. You do not need to plot this problem
$$ xy - z = 1 $$$$ x + z = -2 $$$$ x^2 -y + z = 3 $$