Course Retrospective:
Review of Optimization

Christopher Makler

Stanford University Department of Economics

Econ 50

Resources

Technology

Stuff

Happiness

🌎

🏭

⌚️

🤓

Part I: The Real Economy

Demand

Supply

Equilibrium

🤩

🏪

Part II: Little Green
Pieces of Paper

Three Fundamental Tools of Analysis

Optimization

Given a fixed set of circumstances (prices, technology, preferences), how do economic agents (consumers, firms) make choices? 

Comparative Statics

How do changes in circumstances (changing prices, shifting technology, preferences, etc.) translate into changes in behavior? 

Equilibrium

How do economic systems converge toward certain outcomes?

Three Fundamental Tools of Analysis

Optimization

Constrained Optimization

Unconstrained Optimization

Tradeoffs between two good things

Goal: balance MB/MC ratio

Math characterization: tangency condition

Optimal amount of one thing

Goal: balance MB and MC

Math characterization: MB = MC

Constrained Optimization

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

Canonical Constrained Optimization Problem

f(x_1,x_2)
\text{s.t. }
g(x_1,x_2) = k
k - g(x_1,x_2) = 0
\mathcal{L}(x_1,x_2,\lambda)=
\displaystyle{\max_{x_1,x_2}}
f(x_1,x_2)
k - g(x_1,x_2)
+ \lambda\ (
)

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

\mathcal{L}(x_1,x_2,\lambda)=
f(x_1,x_2)
k - g(x_1,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} =
\displaystyle{\partial f \over \partial x_1}
\displaystyle{\partial f \over \partial x_2}
k - g(x_1,x_2)
=0
- \lambda\ \times
\displaystyle{\partial g \over \partial x_1}
\displaystyle{\partial g \over \partial x_2}
- \lambda\ \times
=0
=0

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

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.

 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 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}(L,W,\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
\mathcal{L}(L,W,\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

Optimization Subject to a Budget Constraint

\mathcal{L}(x_1,x_2,\lambda)=
u(x_1,x_2)+
(m - p_1x_1 - p_2x_2)
\lambda
\frac{\partial \mathcal{L}}{\partial x_1} = \frac{\partial u}{\partial x_1} - \lambda p_1

First Order Conditions

\frac{\partial \mathcal{L}}{\partial x_2} = \frac{\partial u}{\partial x_2} - \lambda p_2
\frac{\partial \mathcal{L}}{\partial \lambda} = m - p_1x_1 - p_2x_2
= 0 \Rightarrow \lambda = \frac{MU_1}{p_1}
= 0 \Rightarrow \lambda = \frac{MU_2}{p_2}

"Bang for your buck" condition: marginal utility from last dollar spent on every good must be the same!

\text{Also: }\frac{\partial \mathcal{L}}{\partial m} = \lambda = \text{bang for your buck, in }\frac{\text{utils}}{\$}
\text{Set two expressions }
\text{for }\lambda \text{ equal:}
\frac{MU_1}{p_1} = \frac{MU_2}{p_2}

The Tangency Condition

What happens when the price of a good increases or decreases?

Utility Maximization

Cost Minimization

\max \ u(x_1,x_2)
\min \ p_1x_1 + p_2x_2
\text{s.t. }p_1x_1 + p_2x_2 = m
\text{s.t. }u(x_1,x_2) = U

Solution functions:
"Ordinary" Demand functions

x_1^*(p_1,p_2,m)
x_2^*(p_1,p_2,m)

Solution functions:
"Compensated" Demand functions

x_1^c(p_1,p_2,U)
x_2^c(p_1,p_2,U)

Utility Maximization

Cost Minimization

\text{Objective function: } x_1x_2
\text{Objective function: } p_1x_1 + p_2x_2
\text{Constraint: }p_1x_1 + p_2x_2 = m
\text{Constraint: }x_1x_2 = U

Plug tangency condition back into constraint:

\displaystyle{\text{Tangency condition: } x_2 = {p_1 \over p_2}x_1}

Same tangency condition, different constraints

The Social Planner's Problem

How do we maximize GDP subject to the PPF?

\text{s.t. }
\mathcal{L}(Y_1,Y_2,\lambda)=
\displaystyle{\max_{Y_1,Y_2}}
p_1Y_1 + p_2Y_2
\overline L - L_1(Y_1) - L_2(Y_2)
+ \lambda\ (
)

OBJECTIVE

FUNCTION

CONSTRAINT

p_1Y_1 + p_2Y_2
\overline L - L_1(Y_1) - L_2(Y_2) = 0
L_1(Y_1) + L_2(Y_2) = \overline L

DOLLARS

HOURS

What are the units?

DOLLARS

PER

HOUR

\mathcal{L}(Y_1,Y_2,\lambda)=
p_1Y_1 + p_2Y_2
\overline L - L_1(Y_1) - L_2(Y_2)
+ \lambda\ (
)
\displaystyle{\partial \mathcal{L} \over \partial Y_1} =

FIRST ORDER CONDITIONS

\displaystyle{\partial \mathcal{L} \over \partial Y_2} =
p_1
p_2
- \lambda\ \times
{dL_1 \over dY_1}
{dL_2 \over dY_2}
- \lambda\ \times
=0
=0
\displaystyle{\Rightarrow \lambda\ = \ \ \ \ \ \ \times}
\displaystyle{\Rightarrow \lambda\ = \ \ \ \ \ \ \times}
p_1
p_2
MP_{L1}
MP_{L2}

Tangency condition: 

{p_1 \over p_2} = {MP_{L2} \over MP_{L1}}

Firms setting their own MRPL equal to the wage rate will choose the point along the PPF at which \({p_1 \over p_2} = MRT\)

Conditions for
GDP Maximization

{p_1 \over p_2} = MRT

TANGENCY CONDITION

CONSTRAINT CONDITION

L_1(Y_1) + L_2(Y_2) = \overline L

Firms in industry 1 set \(w = p_1 \times MP_{L1}\)

Firms in industry 2 set \(w = p_2 \times MP_{L2}\)

How does competition achieve this?

Wages adjust until the
labor market clears

Corner Solutions 

Interior Solution:

Corner Solution:

Optimal bundle contains
strictly positive quantities of both goods

Optimal bundle contains zero of one good
(spend all resources on the other)

If only consume good 1: \(MRS \ge MRT\) at optimum

If only consume good 2: \(MRS \le MRT\) at optimum

What would Lagrange find...?

The Tangency Condition when Lagrange sometimes works

What happens when income decreases?

Kinked Constraints

Unconstrained Optimization

\pi(q) = r(q) - c(q)

Optimize by taking derivative and setting equal to zero:

\pi'(q) = r'(q) - c'(q) = 0
\Rightarrow r'(q) = c'(q)

Profit is total revenue minus total costs:

"Marginal revenue equals marginal cost"

Example:

p(q) = 20 - q \Rightarrow r(q) = 20q - q^2
c(q) = 64 + {1 \over 4}q^2

What is the profit-maximizing value of \(q\)?

Profit as a function of quantity

Profit as a function of labor

c(q) = wL(q) + r \overline K

1. Total costs = cost of required inputs

2. Profit = total revenues minus total costs

3. Take derivative of profit function, set =0

\pi(q) = pq - [wL(q) + r\overline K]
\pi^\prime(q) = p - w \times {dL \over dq} = 0
r(L) = p \times f(L)

1. Total revenue = value of output produced

2. Profit = total revenues minus total costs

3. Take derivative of profit function, set =0

\pi(L) = p\times f(L) - [wL + r\overline K]
\pi^\prime(L) = p \times {dq \over dL} - w = 0
p = w \times {dL \over dq}
p \times {dq \over dL} = w
\text{Profit }\pi = pq - [wL + rK]

Profit as a function of quantity

Profit as a function of labor

1. Total revenue = value of output produced

2. Profit = total revenues minus total costs

3. Take derivative of profit function, set =0

"Keep producing output as long as the marginal revenue from the last unit produced is at least as great as the marginal cost of producing it." 

p = MC
r(L) = p \times f(L)
\pi(L) = p\times f(L) - [wL + r\overline K]
\pi^\prime(L) = p \times {dq \over dL} - w = 0
p \times {dq \over dL} = w

Profit as a function of quantity

Profit as a function of labor

"Keep producing output as long as the marginal revenue from the last unit produced is at least as great as the marginal cost of producing it." 

"Keep hiring workers as long as the marginal revenue from the output of the last worker is at least as great as the cost of hiring them." 

p = MC
w = MRP_L
L^*(w\ |\ p) = 8 \left({p \over w}\right)^2

LABOR DEMAND FUNCTION

Econ 50 | Lecture 27

By Chris Makler

Econ 50 | Lecture 27

Course Retrospective

  • 134