Exercises

Test what we’ve learned about optimization algorithms, SciPy, vectors, and matrices.

Exercise 1: Extending binary search

We learned how to generalize gradient descent and Newton’s method to deal with more variables, but what about binary search? Well, let’s discover it ourselves. Adapt the binary search method we saw in the first lesson of this section to solve a problem with two variables. Then, solve the following problem:

minx,yx+ys.t.:x+y>1\min_{x, y} x + y \\ s.t.: x + y > 1

Get hands-on with 1200+ tech skills courses.