In this module, you will encounter a number of algorithms that can be used to solve various
mathematical problems. An algorithm is just a sequence of instructions that, if followed step by step,
will lead you to the desired outcome:
1. Do A
2. Do B
3. If condition X holds, go to step 4. Otherwise, go back to step 1.
4. Solution
Not every sequence of instructions is an algorithm; they must be well-formed instructions. The
algorithm must be so precise that you can automate it. Also, the algorithm must terminate (we must
reach step 4).
Algorithms can be designed to solve general mathematical problems as well as specific economic
problems.
Example: a barter market
One of the most central topics in economics is how people exchange their owned goods and services
for goods and services owned by others. Exchange takes place because we like other people’s goods
more than we like our own goods (and vice versa).
Let’s look at a simple but useful example of an exchange market for indivisible goods.
House allocation
Alex, Dan, Harry, John and Peter own the houses Ha, Hd, Hh, Hj and Hp respectively. They have
preferences over which houses they would like to live in:
They can benefit from exchanging houses using an algorithm called the Top Trading Cycle (TTC)
algorithm.
The top trading cycle method
1. Each person points to the owner of their favourite house
2. There will be one or more “cycles”. Everyone in a cycle is assigned the house of the person
they point to. (A person pointing to themselves also constitutes a cycle)
3. Remove everyone who was assigned a house from the market, along with their houses.
, 4. Repeat the process for those who remain until everyone has been assigned a house.
The final outcome in our example is that Alex gets Hp, Peter gets Hh, Harry gets Ha, Dan gets Hj, and
John gets Hd.
All houses assigned in them first round cost a price, p1, and all houses assigned in the second round
cost a price, p2. It is important to note that p2 < p1. All houses assigned in round i cost pi < pi-1. If we
allocate houses in this way, then this allocation will constitute a competitive equilibrium.
TTC is a good algorithm in the sense that the outcome is always a core allocation meaning that no
group of individuals can benefit by doing things differently (i.e. swapping houses differently). No
matter how many individuals there are, there is always exactly one unique core allocation, and the
TTC algorithm will always find it. Shapley and Scarf (1974) proved this mathematically.
Note that the preferences of each person is private information. How can we apply the algorithm if
we don’t know their preferences? It has been mathematically proved that no one can benefit by
lying about their preferences (i.e. honesty is always the best policy and we can simply ask them what
their preferences are. This is one of the famous articles that earned Shapley (a mathematician) the
2012 Nobel prize in economics.
We can also show that the final allocation can be supported by market clearing prices (i.e. there are
prices for the houses such that the TTC allocation and these prices constitute a competitive
equilibrium). This means that ever person gets their preferred choice, given the prices and their
budget constraint.
,2. Differential Equations
Differential equations
Many equations you’ve encountered so far (in Maths 1) involve some unknown x to be found (x is
often just a real number).
Today, we will look at a different kind of equations: differential equations.
An ordinary differential equation is an equation where the unknown is a function x(t) of one variable
t, and where the equation involves derivatives (of first or higher order) of the unknown function x(t).
For example, dx(t)/dt and d2x(t)/dt2. We let the “independent variable” t be any real number and we
sometimes denote x(t) simply by x.
In differential equations, we often denote dx/dt by x ̇, d2x/dt2 by x ̈, and so on. When we deal with
differential equations in economics, the independent variable is usually time (hence “t”). Thus, x ̇ can
be interpreted as the rate of change of the quantity x at time t.
Differential equations arise frequently in economics: in microeconomics, macroeconomics, finance,
health economics, resource economics, etc.
Example 1: price adjustment process
The price of apples is denoted p, the demand function is D(p) = a – bp, the supply function is S(p) = α
+ βp where a, b, α and β are positive constants.
Suppose the price p is a function of time t. If there’s excess demand (D(p) > S(p)), p increases,
whereas if there’s excess supply (D(p) < S(p)), p decreases. The rate of price change is proportional to
excess demand: dp/dt = λ(D(p) – S(p)), where λ > 0 is a constant. Rearranging the terms gives: p ̇+ λ(b
+ β)p = λ(a – α).
This differential equation tells us how the price changes (p ̇) at any price level (p). In equilibrium p ̇ =
0, so the equilibrium price is p* = (a – α)/(b + β); this is the price where S(p) = D(p).
Example 2: network expansion model
The number of members of a social media website at time t is denoted N(t) and the size of the
population is denoted P. Assume the speed at which new people join the website is proportional to
the number of people who still haven’t joined. Then N ̇(t) = λ(P − N(t)), where λ > 0 is a constant.
How does N(t) change over time if N(0) = 0? When N(0) = 0, λ(P – N(t)) will just be λP which will be
large positive number. Over time, the number of members will increase quickly but then start to
decrease.
, What is the limit of N(t) as t tends to infinity? The limit is P.
Basic concepts
You would solve the quadratic equation x2 + 4x + 4 = 16 by finding the unknown x. The solution is the
real number x = 2. The idea is similar for differential equations, but now a solution is a function x(t)
rather than a number x.
A first order differential equation contains the first derivative of x(t), but not the second derivative
or higher. It is generally represented as x ̇= F(t, x), where F is a function of t and x = x(t).
A solution to the differential equation x ̇ = F (t, x) is a function x(t) such that dx(t)/dt = F (t, x(t)). The
graph of a solution is called a solution curve or an integral curve. There may be multiple functions
that satisfy this.
A single solution to a differential equation is called a particular solution. The set of all solution to a
differential equation is called its general solution.
Example 3
Consider dx/dt = t. “Separate” the variables: dx = tdt and integrate both sides ∫ dx = ∫ tdt. This yields
x = ½ t2 + C, which is the general solution. Both x = ½ t2 + 4 and x = ½ t2 are particular solutions, but x
= t2 is not a solution.
We’ve just committed two mathematical crimes:
1. We treated the derivative dx/dt as a fraction of two quantities, dx and dt, when we
“separated” them. It’s (typically) not
2. We integrated both sides of an equation with respect to different variables.
But when dealing with these types of differential equations, it works.
Find a solution x(t) such that x ̇ = F (t, x) and x(t0) = c. If t0 is the initial time, then x(t0) = c is called the
initial condition. This type of problem is called an initial-value problem and it usually has a unique
solution.
Example 4
Find x(t) such that dx/dt = t and x(1) = 2. From example 3, we know that the general solution is x = ½
t2 + C. By the initial condition, 2 = ½ + C, so we have C = 3/2 ⇒ x = ½ t2 + 3/2 is the unique solution.
Separable differential equations
The method we just used can be used for separable differential equations. The equation x ̇ = F (t, x) is
separable if it can be written as the product of two functions, one depending only on t and the other
only on x: x ̇ = f(t) g(x). In our example, dx/dt = t, we have f(t) = t and g(x) = 1.
Consider a differential equation of the form x ̇ = f(t) g(x):
1. Find the values of x such that g(x) = 0. Let a be such a value. Then, the constant function x(t)
= a is a solution. We do this step first to remove any values of g(x) = 0 as we cannot divide by
0 which is the next step [1/g(x)].
2. Write the equation as 1/g(x) dx = f(t) dt.
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller ursulamoore33. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $11.79. You're not tied to anything after your purchase.