Recall & Review
beginner
What is the main goal of linear programming?
Linear programming aims to find the best value (maximum or minimum) of a linear function, called the objective, while following certain linear constraints.
Click to reveal answer
beginner
In scipy's linprog, what does the 'c' parameter represent?
The 'c' parameter is a list or array of coefficients for the objective function that we want to minimize.
Click to reveal answer
intermediate
What types of constraints can you specify in linprog?
You can specify inequality constraints (A_ub x ≤ b_ub) and equality constraints (A_eq x = b_eq) in linprog.
Click to reveal answer
beginner
What does the result of linprog contain?
The result includes the optimal values for variables, the minimum value of the objective function, and a success flag indicating if the solution was found.
Click to reveal answer
intermediate
Why do we often minimize the objective function in linprog instead of maximizing?
linprog is designed to minimize by default. To maximize, we multiply the objective coefficients by -1 and then minimize.
Click to reveal answer
What does the 'linprog' function in scipy.optimize do?
✗ Incorrect
linprog is used to find the minimum of a linear objective function subject to linear constraints.
In linprog, which parameter represents the inequality constraint matrix?
✗ Incorrect
A_ub is the matrix for inequality constraints of the form A_ub x ≤ b_ub.
How do you represent the constraint x1 + 2x2 ≤ 4 in linprog?
✗ Incorrect
Inequality constraints use A_ub and b_ub where A_ub x ≤ b_ub.
If you want to maximize 3x + 4y using linprog, what should you do?
✗ Incorrect
linprog minimizes by default, so multiply coefficients by -1 to maximize.
What does the 'success' attribute in linprog's result indicate?
✗ Incorrect
The 'success' flag tells if linprog found an optimal solution.
Explain how to set up a linear programming problem using scipy's linprog.
Think about what you want to minimize and the rules your variables must follow.
You got /5 concepts.
Describe how to convert a maximization problem into a minimization problem for linprog.
Remember linprog only minimizes by default.
You got /3 concepts.