A harbour town puts a levy of t dollars on every crate of oysters sold. Without it, the market for crates follows two lines (prices in dollars per crate, quantities in crates a week):
- demand: buyers want a - b \cdot P_b crates when they pay P_b;
- supply: fishers offer c + d \cdot P_s crates when they keep P_s.
With the levy, every crate has two prices: buyers pay P_b, the town takes t, and fishers keep P_s = P_b - t. The market clears where the crates buyers want at P_b equal the crates fishers offer at P_s. (In this model it makes no difference whether the buyer or the fisher hands the levy to the town.)
Write tax_split(a, b, c, d, t) that returns the tuple (buyer_price, seller_price, quantity, revenue, buyer_share):
revenueis the levy collected per week,ttimes the quantity;buyer_shareis the part of the levy that buyers bear: how much the price they pay rose above the no-levy equilibrium price P^*, as a fraction oft. Fishers bear the rest,1 - buyer_share.
The inputs promise that b > 0, d > 0, t > 0, that the market without the levy clears at a positive price and quantity, and that with it the quantity is still positive and the seller price at least 0.
Examples
Input: a = 1000, b = 20, c = -200, d = 40, t = 3
Output: (22.0, 19.0, 560.0, 1680.0, 0.6666666666666666)
Explanation: without the levy the market clears at 20 dollars and 600 crates.
Buyers now pay 2 dollars more and fishers keep 1 dollar less: buyers bear 2/3.
Input: a = 1000, b = 40, c = -200, d = 20, t = 3
Output: (21.0, 18.0, 160.0, 480.0, 0.3333333333333333)
Constraints
- answers are compared with a tolerance of
1e-6
Goals
- Find the market outcome when a tax drives a wedge between the price buyers pay and the price sellers keep
- Compute the tax revenue and each side's share of the tax
- See that the side with the steeper response bears less of the tax