The lecture notes are posted on my website. I’ve added link to the location at the top of the canvas page.
The lectures are not recorded. I am recording supplemental versions for the add drop period, if these are useful (and time allows) I will continue to make them.
Please post your questions about course content on the canvas discussions for each lecture (they go live after the lecture).
Thanks to those of you that have reached out with questions! I enjoy answering them, and it helps me a lot to see what is working and what is not.
The review lectures will address everyone’s favorite question: “Dr. Morris, please tell me exactly what will be on the exam.”
Note: The answer to the most popular questions seems to be: “Focus on setup and interpretation, not calculation.”
A note on incremental cost and marginal cost:
Marginal Cost: as it’s used in economics (i.e. MR=MC under competition) is a mathmatical term: the derivative of the cost function w.r.t. quantity.
Incremental Cost is a practical term: the change in cost for a one unit change in output.
The two are often interchangable, but we should know that they are different. They are the same when the cost curve is linear, they are intechangable whenever we decide that a linear approximation is suitable for our purposes.
In this exercise, we will use the incremental cost as a simple way to get an idea of how the marginal cost is changing.
Let’s go through the homework:
You manage a two-product firm. The production technology requires a mixture of capital and labor to produce each product. Capital is shared, while labor is specific to each of the two products. For the first product, capital (\(K \geq
0\)) and labor (\(L_1 \geq 0\)) must satisfy the following, in order to produce \(q_1\) units: \(q_{1} \leq \sqrt{KL_{1}}\). Likewise, producing \(q_2\) units of the second product requires capital (\(K\)) and labor (now \(L_2 \geq 0\)) such that: \(q_2 \leq\sqrt{KL_2}\). In addition, total capital is limited to a maximum of 200 units. (So \(K \leq 200\).) Naturally, \(K\), \(L_1\), \(L_2\) are all required to be non-negative. Capital costs 100 per unit, labor for the first product costs 140 per unit and labor for the second product costs 175 per unit. The first product sells for 275 per unit, and the second sells for 300 per unit.
Initially suppose only the first product is present. Determine and interpret your optimal production plan.
Next suppose only the second product is present. Determine and interpret your optimal production plan.
Now assume both products are present. Determine and interpret your optimal production plan.
Repeat the three parts above assuming the first product sells for 200 per unit.
Fill in the following table:
\(q_1\)
\(q_2\)
MC of \(q_1\) with \(q_2\) fixed.
MC of \(q_2\) with \(q_1\) fixed.
50
50
50
100
50
150
100
50
100
100
100
150
150
100
150
150
(MC is the marginal cost, but for this exercise we can use one unit changes as a proxy for the marginal cost.)
Q 1: Determine and interpret your optimal production plan.
Start by thinking about what \(q_{1} \leq \sqrt{KL_{1}}\) and \(q_2 \leq\sqrt{KL_2}\) are?
A name for this sort of function is a “production function”
The expression \(q_{1} \leq \sqrt{KL_{1}}\) is the rate at which our production process changes inputs into outputs.
Notice that this even though there is a \(\leq\) sign, that this is not a constraint per se because we get to choose \(K\) and \(L_1\), and it is only that choice that constrains the amount of \(q_1\) that we produce.
Also notice that if we are trying to optimize we will never produce less than \(q_1=\sqrt{KL_{1}}\)
Exploring Production Functions:
Let’s look at some plots to see the implications of this.
Note that I’ll use python for the examples today, this is because it makes 3-d plotting easy, and I want you to think of these as list of steps.
Exploring Production Functions:
Set up by loading the libraries and creating the framework for our plot.
# quick set up for our plotimport matplotlib.pyplot as pltfrom mpl_toolkits.mplot3d import Axes3Dimport pandas as pdimport numpy as np# create the framework for our plotl1 = np.linspace(0, 300, 300)k = np.linspace(0, 200, 300)L1, K = np.meshgrid(l1, k)# CALCULATE THE PRODUCTION FUNCTION Q1 = np.sqrt(L1*K)
Exploring Production Functions:
# Create the figure and add a 3D axisfig = plt.figure()ax = fig.add_subplot(111, projection='3d')# Plot the dataax.plot_surface(L1, K, Q1)# Set axis labels and show the plotax.set_xlabel('L1')ax.set_ylabel('K')ax.set_zlabel('Q1')plt.show()
Capital Contraints:
What if we hold K fixed? What will the graph look like?
In Q1 = np.sqrt(L1*K) we will plug in values for K and let L1 vary.
l1 = np.linspace(0, 300, 300)Q1_10 = np.sqrt(L1*10) # k = 10Q1_100 = np.sqrt(L1*100) # k = 100Q1_200 = np.sqrt(L1*200) # k = 200
Capital Contraints:
What if we hold K fixed? What will the graph look like?
This makes it seem like we have more choices than we actually have. The constraint (production function) makes it so that we can only choose two of K, q1, and l1. So we can plug the production function in for labor or quantity (I choose labor to get rid of the sqrt)
Set up and solve a Legrangian :) I am not going to ask you to actually solve this by hand… you can do it with Excel and Python!
Note that you can apply the steps we do here to any similar solver.
iPRS: How did you solve this?
Since this is not a linear problem let’s use GEKKO
(don’t worry… we will do this in Excel as well, and the exam will focus on setup and interpretation)
# set up the solverfrom gekko import GEKKO # pip install gekko... I posted a video about thism = GEKKO(remote=False) # here we create a gekko object called 'm'
Step 1: Specify the ‘Choice Variables’ and their constraints
# Initialize the decision variablesq1 = m.Var( name="q1", lb=0# the lower bound) q1.value=1# most solvers run faster when you give a starting pointk = m.Var( name="k", lb=0, # lower bound ub=200# upper bound) k.value=200# this is our first guess to speed up the solution
Step 2: Write down the objective function (what we want to maximize), any remaining constraints, and solve.
\[ \Pi(P,C) \equiv 275 \times q_1 - 140 \times \frac{q_1^2}{K} - 100 \times K \]What happened to \(K \leq \bar{K} = 200\)? (hint: it is a constraint on a choice variable look for it on the previous slide!)
m.Maximize(275*q1 -140*((q1**2)/k) -100*k)m.solve(disp=False) # silencing the output because it is diagnostic
Step 2 continued:
The output from the model is just the choice variables: we need to calculate profit and labor:
This gives us the following solutions (note that I’m rounding here):
print('q1 ', int(q1.value[0])) # q1 is a list q1[0] is the first element of the list.print('l1 ', int(l1))print('K ', int(k.value[0]))print('profit ', int(profit))
q1 196
l1 192
K 200
profit 7008
Optimal production plan for \(q_2\) alone:
Let’s refer to the prices as “P”, and the labor and capital costs as “C”
This means that the capital constraint is preventing us from making the next unit of output.
When a constraint does this we often call it a ‘binding constraint’.
The q1,L1 and q2,L2 pairs that we pick are the same when we consider the products separately and together. What does this mean?
It means that the profit function is separable when the capital constraint is binding.
Repeat all three steps with \(P_1=200\)
m = GEKKO(remote=False)q1 = m.Var(name="q1", lb=0)q1.value=1q2 = m.Var(name="q2", lb=0)q2.value=1k = m.Var(name="k", lb=0, ub=200)k.value=200m.Maximize(200*q1 -140*((q1**2)/k) -100*k)m.solve(disp=False) # silencing the out put because it is diagnosticprofit = (200*q1.value[0] -140*((q1.value[0]**2)/k.value[0]) -100*k.value[0])l1 = q1.value[0]**2/k.value[0]
\(Q_1\) when \(P_1=200\)
q1 0
l1 0
K 0
profit 0
The optimal amount of Q1 to produce is 0.
What does this mean?
This means that a firm that only produces Q1 should not produce it at this price, given this cost structure.
What does this mean for a firm that produces Q2?
What should they do? enter the market for Q1 or not?
Lets look at the profit functions for the two single product firms with k=200
Plots of two single product firms with k=200
# plot so we can see what is going onplt.plot(q1,Pq1,label='Profit (q1)')plt.plot(q1,Pq2,label='Profit (q2)')plt.xlabel('Quantity')plt.legend()plt.grid()plt.axhline(0, color='grey')plt.title('Profit with k=200 and P1=200')plt.show()
\(Q_1\) and \(Q_2\) when \(P_1=200\)
Now we are back to the multiproduct firm
# Let's look at the two together# reset gekkom = GEKKO(remote=False)# Initialize the decision variablesq1 = m.Var(name="q1", lb=0)q1.value=1q2 = m.Var(name="q2", lb=0)q2.value=1k = m.Var(name="k", lb=0, ub=200) # this is the constraintk.value=200# this is our first guess to speed up the solutionm.Maximize(200*q1 -140*((q1**2)/k)+300*q2 -175*((q2**2)/k)-100*k)m.solve(disp=False)profit = (200*q1.value[0] -140*((q1.value[0]**2)/k.value[0]) +300*q2.value[0] -175*((q2.value[0]**2)/k.value[0]) -100*k.value[0])l1 = q1.value[0]**2/k.value[0]l2 = q2.value[0]**2/k.value[0]
# Create the figure and add a 3D axisfig = plt.figure()ax = fig.add_subplot(111, projection='3d')# Plot the dataax.plot_surface(Q1, Q2, Pi12)# Set axis labels and show the plotax.set_xlabel('Q1')ax.set_ylabel('Q2')ax.set_zlabel('Profit')plt.show()
Notice that alot of this profit graph is below zero!
Let’s zoom to the zero lower bound
These are the profitable production plans, and the one at the top is the optimal plan.
## What interesting insights or questions jump out from these facts?
Now there is some synergy!
The functions are no longer separable
Why is this? What is going on?
This is what it means to share capital.
What are scenarios where this would play out in the real world?
Adding a second product that does not compete with the first but that can be made using the same machines?
A manufacturing firm takes on additional work with idle capacity.
A retail firm adding a product line.
Now let’s fill in the marginal cost table
For each of these the first step is to see how much K we need given the production choices.
BTW, we are going to use a one unit increment here, but something less is fine i.e. true marginal cost.
\(q_1\)
\(q_2\)
MC of \(q_1\) with \(q_2\) fixed.
MC of \(q_2\) with \(q_1\) fixed.
50
50
50
100
50
150
100
50
100
100
100
150
150
100
150
150
We are going to take the q as given and then calculate the optimal K for each and then increment.
Quick notes:
Steps:
Find the optimal production plan for each combination.
Increment and find the optimal production plan for the incremented combinations.
Take difference to get marginal cost.
Note 1: This is VERY time consuming to do in excel, and relatively easy to do in python (or similar tools)
Note 2: We are using incremental cost in place of the marginal cost to avoid some difficult math.
Note 3: The key insight is that the marginal cost of the two products depend on each other.
def findK(q1,q2): m = GEKKO(remote=False)# Initialize the decision variablesc k = m.Var(name="k", lb=0, ub=200) # this is the constraint k.value=200# this is our first guess to speed up the solution m.Maximize(275*q1 -140*((q1**2)/k)+300*q2 -175*((q2**2)/k)-100*k ) m.solve(disp=False)return k.value[0]
Second, write down the functions
def labor(q,K):return (q**2)/K
Second, write down the functions
def cost(L1,L2,K):return140*L1 +175*L2 +100*K
Second, write down the functions
findK(50,50)
88.741196671
Fill in the optimal production plan for each set of points