Constrained Optimization with Calculus
Christopher Makler
Stanford University Department of Economics
Econ 50: Lecture 7
Choice space:
all possible options
Feasible set:
all options available to you
Optimal choice:
Your best choice(s) of the ones available to you
Constrained Optimization
Choice Space
(all colleges plus alternatives)
Feasible Set
(colleges you got into)
Your optimal choice!
Preferences
Preferences describe how the agent ranks all options in the choice space.
For example, we'll assume that you could rank all possible colleges
(and other options for what to do after high school) based upon your preferences.
Preference Ranking
Found a startup
Harvard
Stanford
Play Xbox in parents' basement
Cal
Choice space
Feasible set
Optimal
choice!
Found a startup
Stanford
Cal
Harvard
Play XBox in parents' basement
Optimal choice is the highest-ranking option in the feasible set.
Today's Agenda
Part 1: A Short Math Review
Part 2: Economic Intuition
Unconstrained optimization
Constrained optimization and Lagrange
Interpreting the Lagrange multiplier
Graphs: PPFs and indifference curves
Words: MRS vs MRT
Math: applying Lagrange
Unconstrained Optimization
Constrained Optimization
Canonical Constrained Optimization Problem
Suppose \(g(x_1,x_2)\) is monotonic (increasing in both \(x_1\) and \(x_2\)).
Then \(k - g(x_1,x_2)\) is negative if you're outside of the constraint,
positive if you're inside the constraint,
and zero if you're along the constraint.
OBJECTIVE
FUNCTION
CONSTRAINT
FIRST ORDER CONDITIONS
3 equations, 3 unknowns
Solve for \(x_1\), \(x_2\), and \(\lambda\)
How does the Lagrange method work?
It finds the point along the constraint where the
level set of the objective function passing through that point
is tangent to the constraint
FIRST ORDER CONDITIONS
TANGENCY
CONDITION
CONSTRAINT
Example: Fence Problem
You have 40 feet of fence and want to enclose the maximum possible area.
Example: Fence Problem
You have 40 feet of fence and want to enclose the maximum possible area.
OBJECTIVE
FUNCTION
CONSTRAINT
FIRST ORDER CONDITIONS
TANGENCY
CONDITION
CONSTRAINT
TANGENCY
CONDITION
CONSTRAINT
Meaning of the Lagrange multiplier
Suppose you have \(F\) feet of fence instead of 40.
TANGENCY
CONDITION
CONSTRAINT
SOLUTIONS
Meaning of the Lagrange multiplier
Suppose you have \(F\) feet of fence instead of 40.
SOLUTIONS
Maximum enclosable area as a function of F:
Meaning of the Lagrange multiplier
Suppose you have \(F\) feet of fence instead of 40.
Fish vs. Coconuts
- Can spend your time catching fish (good 1) or collecting coconuts (good 2)
- What is your optimal division of labor between the two?
- Intuitively: if you're optimizing, you couldn't reallocate your time
in a way that would make you better off.
Graphical Analysis:
PPFs and Indifference Curves
The story so far, in two graphs
Production Possibilities Frontier
Resources, Production Functions → Stuff
Indifference Curves
Stuff → Happiness (utility)
Both of these graphs are in the same "Good 1 - Good 2" space
Better to produce
more good 1
and less good 2.
Better to produce
less good 1
and more good 2.
Better to produce
more good 1
and less good 2.
“Gravitational Pull" Towards Optimality
Better to produce
more good 2
and less good 1.
These forces are always true.
In certain circumstances, optimality occurs where MRS = MRT.
Verbal Analysis: MRS, MRT, and the “Gravitational Pull" towards Optimality
Marginal Rate of Transformation (MRT)
- The number of coconuts you need to give up in order to get another fish
- Opportunity cost of fish in terms of coconuts
Marginal Rate of Substitution (MRS)
- The number of coconuts you are willing to give up in order to get another fish
- Willingness to "pay" for fish in terms of coconuts
Both of these are measured in
coconuts per fish
(units of good 2/units of good 1)
Marginal Rate of Transformation (MRT)
- The number of coconuts you need to give up in order to get another fish
- Opportunity cost of fish in terms of coconuts
Marginal Rate of Substitution (MRS)
- The number of coconuts you are willing to give up in order to get another fish
- Willingness to "pay" for fish in terms of coconuts
Opportunity cost of marginal fish produced is less than the number of coconuts
you'd be willing to "pay" for a fish.
Opportunity cost of marginal fish produced is more than the number of coconuts
you'd be willing to "pay" for a fish.
Better to spend less time fishing
and more time making coconuts.
Better to spend more time fishing
and less time collecting coconuts.
Mathematical Analysis:
Lagrange Multipliers
We've just seen that, at least under certain circumstances, the optimal bundle is
"the point along the PPF where MRS = MRT."
CONDITION 1:
CONSTRAINT CONDITION
CONDITION 2:
TANGENCY
CONDITION
This is just an application of the Lagrange method!
Example: Linear PPF, Cobb-Douglas Utility
Chuck has 150 hours of labor, and can produce 3 fish per hour or 2 coconuts per hour.
His preferences may be represented by the utility function \(u(x_1,x_2) = x_1^2x_2\)
To find the equation of his PPF, we invert the production functions and plug them in to the resource constraint:
Production function for fish
Production function for coconuts
Resource constraint
Example: Linear PPF, Cobb-Douglas Utility
Chuck has 150 hours of labor, and can produce 3 coconuts per hour or 2 fish per hour.
His preferences may be represented by the utility function \(u(x_1,x_2) = x_1^2x_2\)
OBJECTIVE
FUNCTION
CONSTRAINT
FIRST ORDER CONDITIONS
Utility from last hour spent fishing
Utility from last hour spent collecting coconuts
Equation of PPF
Utility from last hour spent fishing
Utility from last hour spent collecting coconuts
Equation of PPF
Equation of PPF
TANGENCY
CONDITION
MRS
MRT
CONSTRAINT
pollev.com/chrismakler

Suppose your preferences may be represented by the utility function
\(u(x_1,x_2) = a \ln x_1 + b \ln x_2\).
What happens to the slope of the line representing the tangency condition if a increases?
Videos of Worked Examples
- There are videos of worked examples for this class. Watch them, pause them, work along with them.
Next Time
Examine cases where the optimal bundle is not characterized by a tangency condition.
New concepts:
corner solutions and kinks.
Econ 50 | Spring 23 | Lecture 7
By Chris Makler
Econ 50 | Spring 23 | Lecture 7
Constrained Optimization with Calculus
- 548