Problem 437516 · medium · Economics · Level 04 Strategy and Growth

The Old Brewery Moves First

Stackelberg competition · sequential game · backward induction · first-mover advantage · limit output

An old brewery (firm 1, the leader) announces its output q_1 for the season first. A young brewery (firm 2, the follower) sees q_1 and then chooses its own output q_2. All their beer sells at one price,

P = a - b\,(q_1 + q_2)

dollars per barrel (outputs are in barrels, any amounts >= 0). Brewery i has a constant marginal cost c_i per barrel and no fixed cost: its profit is \pi_i = (P - c_i)\,q_i.

  • The follower picks the q_2 \ge 0 that maximises its own profit, given the q_1 it sees (0 if every positive output would lose money).
  • The leader knows this rule and picks the q_1 \ge 0 that maximises its own profit, taking into account how the follower will respond.

In this model the leader's best q_1 is unique. Write stackelberg(a, b, c1, c2) that returns the tuple (q1, q2, P, profit1, profit2) that results.

Examples

Input:  a = 100, b = 1, c1 = 10, c2 = 10
Output: (45.0, 22.5, 32.5, 1012.5, 506.25)
Explanation: facing 45 barrels, the follower makes (100 - 10 - 45) / 2 = 22.5. Moving
first, the leader makes twice as much as the follower.

Input:  a = 100, b = 1, c1 = 10, c2 = 46
Output: (54.0, 0.0, 46.0, 1944.0, 0.0)
Explanation: 54 barrels push the price down to the follower's cost of 46, so it makes nothing.
The leader earns more this way than by leaving the follower room.

Input:  a = 60, b = 0.5, c1 = 50, c2 = 10
Output: (0.0, 50.0, 35.0, 0.0, 1250.0)
Explanation: the leader's cost is so high that it is best off making nothing.

Constraints

  • answers are compared with a tolerance of 1e-6

Goals

  • Solve a leader-follower game backwards: the follower's best response first, then the leader's choice
  • Find the leader's output, including the corner where it shuts the follower out
  • Compare the leader's and the follower's outputs and profits
Starting Python…