Supply and demand
Understanding supply and demand through the lens of optimization
Setup
Suppose there is a single company selling a single product and a single consumer buying that specific product. Can we understand how the market interaction works in this scenario? 1 Need a visual example in this post.
Supply as profit maximization
Let’s have
- price per unit item
- quantity
- is the cost of producing items
Then, the company’s profit is total price it sells at, minus total cost of production:
The company’s objective is to produce exactly that many units which maximizes its profit:
Note that is a function of price per unit item .
This is the supply curve: for every price how much should the company produce to maximize its profits?
Demand as utility maximization
In the same way, a consumer is trying to maximize the utility of the goods they buy. But what exactly is utility? Utility is a scoring function that tells the benefit of the bought goods for the consumer. 2 How should we quantify utility? An unanswered question for later.
So if we have a utility function , then the consumer’s benefit is the utility minus the cost of buying the goods 3 The buying and selling of goods is the common part between the company and the consumer. :
The consumer’s objective (also a function of ) is the maximize their own benefit:
The is the demand curve: for every price how much should the consumer buy the maximize their benefit.
Market equilibrium
We know that:
- The company is trying to maximize their profit, and in that process, it will produce a (supply of) quantity of product if the product price in the market is .
- The consumer is trying the maximize their benefit, and in that process, they will try to buy a (demand of) quantity of product if the product price in the market is .
If the system reaches an equilibrium, then the company and consumer are both maximizing their respective profit and benefit. That means:
This gives us: