Question

How to set up a Lagrangian for a crypto mining profit maximization problem

Original question: 2. You are the manager of a firm that makes money by mining two cryptocurrencies: Bitcoin and Ethereum. Every day at 0:00, the prices of Bitcoin (p1)(p_1) and Ethereum (p2)(p_2) are posted, and you must decide for how long your computers will mine each of the two cryptocurrencies on that day. Then a new day comes, cryptocurrency prices are modified, and the decision process starts over again.

Let x10x_1\geq 0 and x20x_2\geq 0 denote the number of hours devoted to mining Bitcoin and Ethereum, respectively, on a given day. These mining hours yield x1\sqrt{x_1} and x2\sqrt{x_2} units of Bitcoin and Ethereum, respectively, on that day. Electricity is free, so your operating costs are zero, and the company has no other costs than energy. However, computers may work for up to 15 hours per day.

(a) Write down the firm’s profit maximization problem and the corresponding Lagrangian.

Expert Verified Solution

thumb_up100%(1 rated)

Key takeaway: This is a standard constrained optimization setup dressed in a modern story. The economics is simple: choose hours for each activity, respect the time limit, and maximize profit given prices and production functions. The real work is translating the narrative into symbols cleanly.

Let

  • x10x_1\ge 0 = hours spent mining Bitcoin,
  • x20x_2\ge 0 = hours spent mining Ethereum.

The outputs are given as x1\sqrt{x_1} and x2\sqrt{x_2}, and the prices are p1p_1 and p2p_2.

1) Write profit

Since electricity and other operating costs are zero, profit equals revenue:

π(x1,x2)=p1x1+p2x2.\pi(x_1,x_2)=p_1\sqrt{x_1}+p_2\sqrt{x_2}.

2) Write the time constraint

The computers may work for at most 15 hours per day:

x1+x215.x_1+x_2\le 15.

At the optimum, because more hours increase output and there is no cost of hours directly, the full time constraint will typically bind:

x1+x2=15.x_1+x_2=15.

3) Form the Lagrangian

Using multiplier λ\lambda for the constraint,

L(x1,x2,λ)=p1x1+p2x2+λ(15x1x2).\mathcal{L}(x_1,x_2,\lambda)=p_1\sqrt{x_1}+p_2\sqrt{x_2}+\lambda(15-x_1-x_2).

4) First-order conditions

Differentiate with respect to each choice variable:

Lx1=p12x1λ=0,\frac{\partial \mathcal{L}}{\partial x_1}=\frac{p_1}{2\sqrt{x_1}}-\lambda=0,

Lx2=p22x2λ=0,\frac{\partial \mathcal{L}}{\partial x_2}=\frac{p_2}{2\sqrt{x_2}}-\lambda=0,

Lλ=15x1x2=0.\frac{\partial \mathcal{L}}{\partial \lambda}=15-x_1-x_2=0.

These conditions characterize the optimum.


Pitfalls the pros know 👇 A common error is to forget the constraint is an inequality and then write a Lagrangian without checking whether it binds. Here, since output is increasing in both variables, the solution uses all 15 hours. Another trap is putting the prices inside the square root or treating output as cost. The problem asks for profit maximization, so revenue goes in the objective and the zero cost assumption keeps the setup clean.

What if the problem changes? If the firm had a fixed hourly cost cc for using the computers, the objective would become p1x1+p2x2c(x1+x2)p_1\sqrt{x_1}+p_2\sqrt{x_2}-c(x_1+x_2). If the 15-hour limit were replaced by x1+x2Tx_1+x_2\le T, the same Lagrangian form would apply with TT in place of 15. If short-selling or negative hours were allowed, which they are not here, the problem would no longer make economic sense.

Tags: Lagrangian, constrained optimization, profit maximization

FAQ

What is the firm's profit function in this mining problem?

With Bitcoin hours x1 and Ethereum hours x2, profit is pi(x1,x2)=p1 sqrt(x1)+p2 sqrt(x2), since operating costs are zero.

What is the Lagrangian for the 15-hour constraint?

The Lagrangian is L(x1,x2,lambda)=p1 sqrt(x1)+p2 sqrt(x2)+lambda(15-x1-x2).

chat