1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Optimization in Python

Connected

Exercise

Multivariate optimization

Great job maximizing that revenue! You now want to look at minimizing costs.

You'll need to consider two variables for your new cookie product, the sugar ingredient (a[0]) and the flour ingredient (a[1]). This is a multivariate optimization problem where you want to find the best way to mix these ingredients so that your cookies are delicious but not too expensive!

SciPy's minimize() function has been loaded for you and the objective function has been provided.

Instructions

100 XP
  • Save your initial guess to x0; this can be anything!
  • Calculate and print the minimum.