Constrained Optimization When Calculus Works

Christopher Makler

Stanford University Department of Economics

Econ 50: Lecture 8

First Checkpoint Next Friday!

The homework due Tuesday night will have lots of old exam questions as optional exercises. Don't do them all! But solutions will be posted on Wednesday morning so you can review them.

Office hours will be different (additional office hours Wednesday, no office hours after the exam)

Section will be spent reviewing old exam questions.

I will also run a review session on Thursday night.

If you have special arrangements, do the paperwork today!

  • OAE: upload your form to the link on the web site
  • Traveling with a sports team - email me and copy your athletic coordinator

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.

Agenda for Today and Friday

Today: When Calculus Works

Friday: When Calculus Doesn't Work

Graphs: PPFs and indifference curves

Words: MRS vs MRT

Math: applying Lagrange

Graphs: PPFs and indifference curves

Words: MRS vs MRT

Math: applying Lagrange

Corner solutions

Kinks

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.

MRS
>
MRT

Better to produce
less good 1
and more good 2.

MRS
<
MRT

Better to produce
more good 1
and less good 2.

MRS
>
MRT
MRS
<
MRT

“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.

MRS
>
MRT
MRS
<
MRT

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:

L_1(x_1) = {1 \over 3}x_1
L_2(x_2) = {1 \over 2}x_2
{1 \over 3}x_1 + {1 \over 2}x_2 = 150
f_1(L_1) = 3L_1
f_2(L_2) = 2L_2
L_1 + L_2 = 150

Production function for fish

Production function for coconuts

Resource constraint

Example 1: 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\)

\text{s.t. }
\mathcal{L}(x_1,x_2,\lambda)=
\displaystyle{\max_{x_1,x_2}}
x_1^2x_2
150 - {1 \over 3}x_1 - {1 \over 2}x_2
+ \lambda\ (
)

OBJECTIVE

FUNCTION

CONSTRAINT

x_1^2x_2
150 - {1 \over 3}x_1 - {1 \over 2}x_2 = 0
{1 \over 3}x_1 + {1 \over 2}x_2 = 150

UTILS

HOURS

What are the units?

UTILS

PER

HOUR

\mathcal{L}(x_1,x_2,\lambda)=
x_1^2x_2
150 - {1 \over 3}x_1 - {1 \over 2}x_2
+ \lambda\ (
)
\displaystyle{\partial \mathcal{L} \over \partial x_1} =

FIRST ORDER CONDITIONS

\displaystyle{\partial \mathcal{L} \over \partial x_2} =
\displaystyle{\partial \mathcal{L} \over \partial \lambda} =
2x_1x_2
x_1^2
150 - {1 \over 3}x_1 - {1 \over 2}x_2
=0
- \lambda\ \times
{1 \over 3}
{1 \over 2}
- \lambda\ \times
=0
=0
\displaystyle{\Rightarrow \lambda\ = \ \ \ \ \ \ \ \ \ \ \ \times}
{1 \over 3}x_1 + {1 \over 2}x_2 = 150
\displaystyle{\Rightarrow \lambda\ = \ \ \ \ \ \ \ \ \ \ \ \times}
2x_1x_2
x_1^2
3
2
MU_1
MU_2
MP_{L1}
MP_{L2}
\Rightarrow

Utility from last hour spent fishing

Utility from last hour spent collecting coconuts

Equation of PPF

\displaystyle{\lambda\ = \ \ \ \ \ \ \ \ \ \ \ \times}
{1 \over 3}x_1 + {1 \over 2}x_2 = 150
\displaystyle{ = \ \ \ \ \ \ \ \ \ \ \ \times}
2x_1x_2
x_1^2
3
2
MU_1
MU_2
MP_{L1}
MP_{L2}

Utility from last hour spent fishing

Utility from last hour spent collecting coconuts

Equation of PPF

{1 \over 3}x_1 + {1 \over 2}x_2 = 150
=
2x_1x_2
x_1^2
3
2
MU_1
MU_2
MP_{L1}
MP_{L2}

Equation of PPF

TANGENCY
CONDITION

MRS

MRT

CONSTRAINT

{1 \over 3}x_1 + {1 \over 2}x_2 = 150
=
2x_1x_2
x_1^2
3
2
x_2 = {1 \over 3}x_1
{1 \over 3}x_1 + {1 \over 2}\ \ \ \ \ \ \ \ \ = 150
({1 \over 3}x_1)
{1 \over 3}x_1 + {1 \over 6}x_1 = 150
{1 \over 2}x_1 = 150
x_1^* = 300
x_2 = {1 \over 3}
x_2^* = 100
(300)

TANGENCY
CONDITION

CONSTRAINT

PLUG INTO
CONSTRAINT

PLUG BACK INTO TANGENCY CONDITION

{1 \over 3}x_1 + {1 \over 2}x_2 = 150
x_2 = {1 \over 3}x_1
x_1^* = 300
x_2^* = 100

TANGENCY
CONDITION

CONSTRAINT

TANGENCY
CONDITION

CONSTRAINT

\displaystyle{\lambda\ = \ \ \ \ \ \ \ \ \ \ \ \times}
\displaystyle{ = \ \ \ \ \ \ \ \ \ \ \ \times}
2x_1x_2
x_1^2
3
2
MU_1
MU_2
MP_{L1}
MP_{L2}

Utility from last hour spent fishing

Utility from last hour spent collecting coconuts

Interpretation of the Lagrange Multplier

At the optimum, we have \(x_1^* = 300\) and \(x_2^* = 100\):

2 \times 300 \times 100 \times 3 = 180,000
300^2 \times 2 = 180,000

What does this mean?

{1 \over 3}x_1 + {1 \over 2}x_2 = 150
=
2x_1x_2
x_1^2
3
2
x_2 = {1 \over 3}x_1
{1 \over 3}x_1 + {1 \over 2}\ \ \ \ \ \ \ \ \ = 150
({1 \over 3}x_1)
{1 \over 3}x_1 + {1 \over 6}x_1 = 150
{1 \over 2}x_1 = 150
x_1^* = 300
x_2 = {1 \over 3}
x_2^* = 100
(300)

TANGENCY
CONDITION

CONSTRAINT

PLUG INTO
CONSTRAINT

PLUG BACK INTO TANGENCY CONDITION

\ \ \ \overline L\ \ \
\ \ \ \overline L\ \ \
\ \ \ \overline L\ \ \
\ \ \ \overline L\ \ \
\ \ 2\overline L\ \ \
\ (2\overline L)\
\ \ \tfrac{2}{3}\overline L\ \
x_1^*(\overline L) = 2 \overline L
x_2^*(\overline L) = \tfrac{2}{3}\overline L
u(x_1,x_2) = x_1^2x_2
= {8 \over 3} \overline L^3
V(\overline L) = u[x_1^*(\overline L),x_2^*(\overline L)] = (2 \overline L)^2(\tfrac{2}{3}\overline L)

How much utility do you get from that bundle?

What is the optimal bundle to produce if you have \(\overline L\) hours of labor available to you?

What is the marginal utility from another hour?

V'(L) = 8L^2
x_1^*(\overline L) = 2 \overline L
x_2^*(\overline L) = \tfrac{2}{3}\overline L
u(x_1,x_2) = x_1^2x_2
= {8 \over 3} \overline L^3
V(\overline L) = u[x_1^*(\overline L),x_2^*(\overline L)] = (2 \overline L)^2(\tfrac{2}{3}\overline L)

How much utility do you get from that bundle?

What is the optimal bundle to produce if you have \(\overline L\) hours of labor available to you?

What is the marginal utility from another hour?

V'(\overline L) = 8 \overline L^2

We found that when \(\overline L = 150\), \(\lambda = 180,000\)

8 \times 150^2 = 180,000

Example 2: Curved PPF, Cobb-Douglas Utility

\text{s.t. }
\mathcal{L}(x_1,x_2,\lambda)=
\displaystyle{\max_{x_1,x_2}}
a \ln x_1 + b \ln x_2
100 - {1 \over 100}x_1^2 + {1 \over 36}x_2^2
+ \lambda\ (
)

OBJECTIVE

FUNCTION

CONSTRAINT

a \ln x_1 + b \ln x_2
100 - {1 \over 100}x_1^2 + {1 \over 36}x_2^2 = 0
{1 \over 100}x_1^2 + {1 \over 36}x_2^2 = 100

First order conditions:

\displaystyle{\partial \mathcal{L} \over \partial x_1} =
\displaystyle{\partial \mathcal{L} \over \partial x_2} =
{a \over x_1}
{b \over x_2}
- \lambda\ \times
{x_1 \over 50}
{x_2 \over 18}
- \lambda\ \times
=0
=0
\Rightarrow \lambda\ = {x_1^2 \over 50a}
\Rightarrow \lambda\ = {x_2^2 \over 18b}
{x_2^2 \over 18b} = {x_1^2 \over 50a}
x_2^2 = {9b \over 25a}x_1^2
x_2 = \sqrt{b \over a} \times {3 \over 5}x_1

T.C.

Example 2: Curved PPF, Cobb-Douglas Utility

\text{s.t. }
\mathcal{L}(x_1,x_2,\lambda)=
\displaystyle{\max_{x_1,x_2}}
a \ln x_1 + b \ln x_2
100 - {1 \over 100}x_1^2 + {1 \over 36}x_2^2
+ \lambda\ (
)

OBJECTIVE

FUNCTION

CONSTRAINT

a \ln x_1 + b \ln x_2
100 - {1 \over 100}x_1^2 + {1 \over 36}x_2^2 = 0
{1 \over 100}x_1^2 + {1 \over 36}x_2^2 = 100

First order conditions:

\displaystyle{\partial \mathcal{L} \over \partial x_1} =
\displaystyle{\partial \mathcal{L} \over \partial x_2} =
{a \over x_1}
{b \over x_2}
- \lambda\ \times
{x_1 \over 50}
{x_2 \over 18}
- \lambda\ \times
=0
=0
\Rightarrow \lambda\ = {x_1^2 \over 50a}
\Rightarrow \lambda\ = {x_2^2 \over 18b}
{x_2^2 \over 18b} = {x_1^2 \over 50a}
x_2^2 = {9b \over 25a}x_1^2
x_2 = \sqrt{b \over a} \times {3 \over 5}x_1

T.C.

x_2 = \sqrt{b \over a} \times {3 \over 5}x_1

Tangency Condition

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?

Econ 50 | Lecture 08

By Chris Makler

Econ 50 | Lecture 08

Constrained Optimization with Calculus

  • 332