Op Tim Ization
Op Tim Ization
Op Tim Ization
Managerial Economics
Optimization
Techniques
Economics is filled with optimization problems
Could we do better?
First, lets figure out the demand curve this business faces. For simplicity, lets assume
that the demand is linear.
Q A BP
Price
We also know that every dollar change in price alters passengers
by 50.
0 A BP A
A B 50
P B
B
$15
1,200 A Passengers
Q A B *0 A
First, lets figure out the demand curve this business faces. For simplicity, lets assume
that the demand is linear.
1,950
$39 1, 200 A 50 15
50
A 1,950 Q 1,950 50 P
$15
Fare
Revenues P * Q
1,950
$39 Q 1,950 50 P
50
Revenues
20000
Price Quantity Revenues
18000
0 1,950 0
16000
1 1,900 1,900
14000
2 1,850 3,700
12000
3 1,800 5,400
10000
8000
Price Quantity Revenues
6000
19.50 975 19,012.50
4000
2000
37 100 3,700
38 50 1,900 We could do better! Now, how do we find this
39 0 0 point without resorting to excel?
“Take the derivative and set it equal
to zero!”
-Fermat’s Theorem
Pierre de Fermat
1607- 1665 Pierre de Fermat was actually a lawyer before he
was a mathematician….perhaps he was trying to
figure out how to maximize his legal fees!
f x x f x
slope lim f ' x
f x x f x x 0
x
slope
x
f x
f x
Now, let those two points get
f x x closer and closer to each
other
f ' x
f x
f x
x
x x x x
x
Let’s try one numerically… 2
f x x f x
36 4 slope
slope 8 x
4
x f x x Slope
f x 2
4 36 8
x 2 16 6
1 9 5
36
.5 6.25 4.5
.25 5.0625 4.25
.1 4.41 4.1
.05 4.2025 4.05
4
.01 4.0401 4.01
x .001 4.004001 4.001
2 6
x
The slope gets closer and closer to 4
Or, in general… slope
f x x f x
x
x x x2
2
slope
x
f x
x2
f x x slope
x 2 2 xx x 2 x 2
x
2xx x 2
f x slope
x
x slope 2 x
x x x
slope 2 x x
Let the change in x go to 0
f ' 2 4
x
Some useful derivatives
Exponents
Linear Functions
f ( x) Axn f ' ( x) nAxn1
f ( x) Ax f ' ( x) A
Example: f ( x) 4 x
Example: f ( x) 3x 5
f ' x 4 f ' x 15 x 4
Logarithms
A
f ( x) A ln( x) f ' ( x)
x
Example: f ( x) 12 ln x
f ' x
12
x
A necessary condition for a maximum or a minimum is that the
derivative equals zero
f x f x
f ' x 0
OR
f ' x 0
x *
x
x* x
f ' x 0
f x f x
f ' x 0
f ' x 0
f ' x 0
x *
x
x* x
As x increases, the
f ''
x 0
As x increases, the
f '' x 0
slope is decreasing slope is increasing
The B2 Bomber: A lesson in second derivatives
“The flying wing was the aerodynamically worst
possible choice of configuration”
--Joseph Foa
4000
P $19.50
2000 R $19, 012.50
0
15
Note, the second derivative is
1 5 9 13 17 21 25 29 33 37
Price negative…a maximum!
19.50
R '' 100
After prices for almonds climbed to a record $4 per pound in 2014, farmers
across California began replacing their cheaper crops with the nut, causing
a huge increase in supply. Now, the bubble has popped. Since late 2014,
according to The Washington Post, almond prices have fallen by around
25%.
Q 35 t P 3.00 .04t
Revenue P * Q 35 t 3 .04t
Now, take a
derivative with R 105 1.6t .04t 2
respect to ‘t’ and set
it equal to zero
R ' 1.6 .08t
P $2.20
Then, solve for ‘t’
t 20
*
Q 55
R $121
We want to maximize revenues which is price per pound times total pounds sold
125
120
115
Revenues
110
105
100
95
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 Weeks
Suppose that you run a
trucking company. You have
the following expenses.
Expenses
• Driver Salary: $22.50 per hour What speed should you
• $0.27 per mile depreciation tell your driver to maintain
• v/140 dollars per mile for fuel
in order to minimize your
costs where ‘v’ is speed in miles
per hour cost per mile?
What speed should you tell your driver to
maintain in order to minimize your cost per
mile?
22.50 v
Cost .27
Note that if I divide the v 140
driver’s salary by the speed, I
get the driver’s salary per
mile
$ Now, take a 22.50 1
$ derivative with C' 2 0
hr. respect to ‘t’ and set v 140
miles mile it equal to zero
hr.
Then, solve for ‘t’ v 3,150 56 mph
Cost $1.07 per mile
We want to minimize cost per mile
1.1
1.09
1.08
Cost Per Mile
1.07
1.06
1.05
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 Speed
Suppose you know that demand for your
product depends on the price that you set and
the level of advertising expenditures.
Q p, A 5,000 10 p 40 A pA .8 A .5 p 2 2
Q 5, 000 10 p 40 A pA .8 A2 .5 p 2
Now, we need
Q p 10 A p 0
partial derivatives 40 p 1.6 A 0
with respect to both
‘p’ and ‘A’. Both are 10 A p 0
set equal to zero QA 40 p 1.6 A 0
This gives us two
equations with two
unknowns
We could solve one of the equations
for ‘A’ and then plug into the other
40 p 1.6 A 0
40 p 1.6 A 0
10 A p 0 A p 10
10 A p 0
Price
40 p 1.6 A 0
40
40 p 1.6 p 10 0
10 25 50
Advertising
24 .6 p 0
-10
p 40
A 50
-40
The method of Lagrange multipliers is a strategy for
finding the local maxima and minima of a function
subject to equality constraints.
Joseph-Louis Lagrange
1736-1813
Choice
max f x, y Constraint(s)
x, y
variables
subject to g x,y 0
f x, y g x, y
Multiplier (assumed greater or equal to zero)
Here’ s how this would look in two dimensions…we’ve created a new function that includes
the constraints. This new function coincides with the original objective at one point – the
maximum of both!
f x
g x 0
f x g x
f x
x
x*
The new function is
x 0 maximized
Therefore, at the maximum,
two thigs have to be true g x 0 The new function coincides
with the original objective
So, we have our Lagrangian function….
f x, y g x, y
We need the derivatives with respect o both ‘x’ and ‘y’ to be zero
x f x x, y g x x, y 0
y f y x, y g y x, y 0
0 g x, y 0 g x, y 0
Example: Suppose you sell two products ( X and Y ). Your profits
as a function of sales of X and Y are as follows:
Profit 10 x 20 y .1( x y )
2 2 Objective
f x, y
Constraint
x y 100 g x, y
First, for comparison purposes, lets solve this unconstrained….
Profit 10 x 20 y .1( x 2 y 2 )
Px 10 .2 x
P 1, 250
100 Py 20 .2 y
Set the derivatives equal to
zero and solve for ‘x’ and ‘y’
x* 50
y* 100
50 x
P 1, 250
Now, add the constraint Profit 10 x 20 y .1( x 2 y 2 )
Subject to x y 100
part
Take derivatives with respect to ‘x’ and ‘y’
x 10 .2 x 0
y
unconstrained
y 20 .2 y 0
solution
P 1, 250 And the multiplier conditions
100
0 100 x y 0 (100 x y ) 0
Acceptable
values for ‘x’
and ‘y’
50
x
Now, the mechanical x 10 .2 x 0
part y 20 .2 y 0
50
x
Now, the mechanical x 10 .2 x 0 0 (100 x y ) 0 100 x y 0
20 .2 y 0
part y
So, we have three equations and three unknowns (‘x’, ‘y’, and lambda)
10 .2 x 0 10 .2 x
y 20 .2 y 0 20 .2 y
Solve the first
unconstrained two expressions
solution for lambda
P 1, 250
100 10 .2 x 20 .2 y
P 1,125
constrained solution
75 rearrange
y x 50
x* 25
Plug into third equation
y* 75
x 100 x x 50 0 5
25 50
P 1,125
Suppose that the x 10 .2 x 0
production constraint y 20 .2 y 0
y Resolve….
unconstrained x* 25.5
solution
P 1, 250 101 x x 50 0 y* 75.5
100 4.9
P 1,125 (x + y = 100)
P 1,,129.5
75 P 1,129.5 (x + y = 101)
Profit Slope x y #
unconstrained
P 1,125 P 1, 250 solution
150
#
100
If we continue to assume lambda is positive….
Suppose that the production
constraint is 160 x 10 .2 x 0
y 20 .2 y 0
y
160 0 (160 x y ) 0 160 x y 0
x* 105
y* 155
P 1, 245
160 x x 50 0
100 1
P 1, 245
unconstrained
solution
This is no good! Lambda must
P 1, 250 be zero then!
x* 50
y* 100
x 0
50 160 P 1, 250
Lambda measures the marginal impact of the constraint on the objective
function! So, when the constraint in irrelevant, lambda hits zero!
Profit Slope
unconstrained
P 1, 250 solution
Profit
Lambda
# x y #
150
Example Postal regulations require that a package whose length
plus girth exceeds 108 inches must be mailed at an
oversize rate. What size package will maximize the
volume while staying within the 108 inch limit?
Y Z max
x 0, y 0, z 0
xyz
Girth 2 x 2 y subject to 2 x 2 y z 108
Volume xyz
g x, y , z 0 108 2 x 2 y z 0
Remember, we need to write the
constraint in the right format!
Postal regulations require that a package whose length
plus girth exceeds 108 inches must be mailed at an
X oversize rate. What size package will maximize the
volume while staying within the 108 inch limit?
Y Z
First, write down the lagrangian
xyz (108 2 x 2 y z )
Now, take the derivatives with respect to ‘x’, ‘y’, and ‘z’
x yz 2 0
Set the derivatives equal to zero
y xz 2 0
z xy 0
xz 2 0
xy 0 xy
108 2 x 2 y z 0
yz 2 0 2 x 2 y z 108
yz 2 xy 0
z z z 108
z 2x
3 z 108
xz 2 0 y 18 Area xyz 18 18 36 11, 664
xz 2 xy 0 x 18 xy 18 18 324
z 2y
z 36
Adding 1 inch to the girth/length will allow us to
increase the area by approximately 324 cubic inches
Example Suppose that you manufacture IPods. Your assembly
plant utilizes both labor and capital inputs. You can
write your production process as follows
yk l .5 .5
Labor inputs
Hourly output of
IPods Capital Inputs
Labor costs $10 per hour and capital costs $40 per unit. Your objective is to
minimize the production costs associated with producing 100 IPods per hour.
g x, y , z 0 k .5l .5 100 0
Remember, we need to write the
constraint in the right format!
f x, y g x , y
A negative sign instead of a positive sign!!
min 10l 40k
l 0,k 0
200 50 100
.5 .5
100
16
100 k .5l .5
50 100 625
l
Minimize the production costs associated with
producing 100 IPods per hour.
(k .5l .5 100) 0
Lets assume that lambda is positive. So we have three equations and three unknowns
10 .5 k .5l .5 0 Lets solve the first two for lambda
1 Additional
IPod would cost k .5l .5 100
$40 (wait, isn’t 20l .5 k .5 80k .5l .5
k .5 4k 100
.5
that marginal
cost?!) l 4k
2k 100
Plug into the last
k 50 expression and
l 200 simplify
min 10l 40k
l 0,k 0
The shaded area is what the constraint
subject to k l 100
.5 .5
look like
k
Total Costs 10 50 40 200 8,500
50
16
100 k .5l .5
Apples cost $4 each and bananas cost $5 each. You want to maximize your
satisfaction given that you have $100 to spend
Total Expenditures 4 A 5B
Total Expenditures 4 A 5B 100
A
$100
25
$4
subject to 100 4 A 5B 0
4 A 5 B 100
*Note: Technically, there are two
additional constraints here
A0 B0
But given that zero consumption of B
either apples or oranges yields zero 20
$100
utility, we can ignore them $5
Apples cost $4 each and bananas cost $5 each. You want to
maximize your satisfaction given that you have $100 to spend
subject to 100 4 A 5B 0
1 Additional
dollar would
4 A 5B 100 .1A.6 B .6 .12 A.4 B .4
provide an
additional .11 4 A 51.2 A 100 B 1.2 A
units of
happiness
A 10 Plug into the last
expression and
B 12 simplify
Total Expenditures 4 A 5B 100
A
$100
25
$4
subject to 100 4 A 5B 0
B
12 $100
20
$5
Non-Binding Constraints
Suppose that you manufacture IPods. Your assembly plant utilizes both
labor and capital inputs. You can write your production process as follows
yk l .5 .5
Labor inputs
Hourly output of
IPods Capital Inputs
Labor costs $10 per hour and capital costs $40 per unit. Your objective is to minimize the
production costs associated with producing 100 IPods per hour.
TC 10l 40k
The local government will not allow you to fully automate your plant. That is, you have
to use at least 1 hour in your production process
l 1
min 10l 40k
l 0,k 0
Possible
Choices
100 k .5l .5
l
1
Minimize the production costs associated with
producing 100 IPods per hour while utilizing at least 1
hour of labor.
Labor constraint
0 k l 100 0
.5 .5
k l 100 = 0
.5 .5
k 40 .5k .5l .5 0
40 .5k .5 0 Plug in capital equals 10 and solve for lambda and mu
10 .5k .5 0
40 .5k .5 0 8, 000
k 100 0
.5
k 10, 000
10 .5k .5 0 399,990
This doesn’t work. That means the second constraint is not binding and so we can ignore it
min 10l 40k
l 0,k 0
50
100 k .5l .5
l
1 200
Lets make sure the constraint binds… suppose that
labor costs $500,000 per hour!!
Labor constraint
40 .5k .5 0
Plug in capital equals 10 and solve for lambda and mu
500, 000 .5k .5 0
40 .5k .5 0 8, 000
k 100 0
.5
k 10, 000
500, 000 .5k .5 0 100, 000
10, 000
100 k .5l .5
l
1
So, when does the constraint bind? Lets solve the problem for a generic price of capital, wage,
and production requirement
min wl pk
l 0, k 0
subject to k .5l .5 y
l 1
Assuming L = 1
p .5k .5 0
w .5k .5 0
yk 0 .5
ky 2
2 p k 2 py w py 2 py 2
Whether or not the constraint binds depends on prices!!
Hourly
w w py 2
Wage Constraint is Binding
k y2
l 1
Constraint is Non-Binding
p w
ly k y
w p
p
Price of
capital
per unit
Let’s go back to the banana/apple problem. However,
lets change up the utility function.
max A.5 2 B
A, B
subject to
PA A PB B $100
A0 B0
( A, B) A.5 2B ($100 PA A PB B) 1 A 2 B
1 0 A0 1 A 0
2 0 B0 2 B 0
We can simplify this down a bit....we already know that the constraint on income will bind
0 100 PA A PB B 0
Further, consider the change in utility with respect to a change in apple consumption. Zero consumption of apples
would make this infinite, so the zero apple constraint will never bind
U
.5 A.5 .5 0
.5
A0 1 =0
A
Now, let’s solve for the conditions under which the zero
banana condition binds
.5 A.5
.5 A.5 PA 0
PA
2 PB 2 0 2 PB 2 0
PA A PB B 100 A
100
B0 PA
2 0
.5 A.5 PB 40 PA
PB 2 0
PA
Once again, prices determine whether or not the constraint is binding!
PB Constraint is Binding
B0
A
$100 PB 40 PA
PA
Constraint is Non-Binding
2
P $100 PA A
A .25 B B
PA PB
PA