You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lectures/intro_supply_demand.md
+37-39Lines changed: 37 additions & 39 deletions
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,8 @@ jupytext:
3
3
text_representation:
4
4
extension: .md
5
5
format_name: myst
6
+
format_version: 0.13
7
+
jupytext_version: 1.11.5
6
8
kernelspec:
7
9
display_name: Python 3 (ipykernel)
8
10
language: python
@@ -11,7 +13,7 @@ kernelspec:
11
13
12
14
# Introduction to Supply and Demand
13
15
14
-
## Outline
16
+
## Overview
15
17
16
18
This lecture is about some models of equilibrium prices and quantities, one of
17
19
the main topics of elementary microeconomics.
@@ -31,9 +33,9 @@ Key infrastructure concepts that we'll encounter in this lecture are
31
33
* social welfare as the sum of consumer and producer surpluses
32
34
* relationship between equilibrium quantity and social welfare optimum
33
35
34
-
Throughout the lectures, we'll assume that inverse demand and supply curves are **affine** functions of output.
36
+
Throughout the lectures, we'll assume that inverse demand and supply curves are **affine** functions of quantity.
35
37
36
-
("Affine" means "linear plus a constant".)
38
+
("Affine" means "linear plus a constant" and [here](https://math.stackexchange.com/questions/275310/what-is-the-difference-between-linear-and-affine-function) is a nice discussion about it.)
37
39
38
40
We'll also assume affine inverse supply and demand functions when we study models with multiple consumption goods in our {doc}`subsequent lecture <supply_demand_multiple_goods>`.
39
41
@@ -46,7 +48,6 @@ import numpy as np
46
48
import matplotlib.pyplot as plt
47
49
```
48
50
49
-
50
51
## Supply and demand
51
52
52
53
We study a market for a single good in which buyers and sellers exchange a quantity $q$ for a price $p$.
@@ -73,11 +74,11 @@ implementing the inverse demand and supply curves.
73
74
```{code-cell} ipython3
74
75
class Market:
75
76
76
-
def __init__(self,
77
-
d_0=1.0, # demand intercept
78
-
d_1=0.6, # demand slope
79
-
s_0=0.1, # supply intercept
80
-
s_1=0.4): # supply slope
77
+
def __init__(self,
78
+
d_0=1.0, # demand intercept
79
+
d_1=0.6, # demand slope
80
+
s_0=0.1, # supply intercept
81
+
s_1=0.4): # supply slope
81
82
82
83
self.d_0, self.d_1 = d_0, d_1
83
84
self.s_0, self.s_1 = s_0, s_1
@@ -87,22 +88,19 @@ class Market:
87
88
88
89
def inverse_supply(self, q):
89
90
return self.s_0 + self.s_1 * q
90
-
91
91
```
92
92
93
-
94
-
95
93
Let's create an instance.
96
94
97
95
```{code-cell} ipython3
98
96
market = Market()
99
97
```
100
98
101
-
102
99
Here is a plot of these two functions using `market`.
103
100
104
101
```{code-cell} ipython3
105
102
:tags: [hide-input]
103
+
106
104
market = Market()
107
105
108
106
grid_min, grid_max, grid_size = 0, 1.5, 200
@@ -122,7 +120,7 @@ ax.set_ylabel('price')
122
120
plt.show()
123
121
```
124
122
125
-
In the above graph, an **equilibrium** price, quantity pair occurs at the intersection of the supply and demand curves.
123
+
In the above graph, an **equilibrium** price-quantity pair occurs at the intersection of the supply and demand curves.
126
124
127
125
### Consumer surplus
128
126
@@ -135,7 +133,7 @@ curve minus $p q$:
135
133
$$
136
134
S_c(q) :=
137
135
\int_0^{q} (d_0 - d_1 x) dx - p q
138
-
$$
136
+
$$ (eq:cstm_spls)
139
137
140
138
The next figure illustrates
141
139
@@ -149,11 +147,11 @@ ps = np.ones_like(q_grid) * p
0 commit comments