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 and Ethereum 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 and denote the number of hours devoted to mining Bitcoin and Ethereum, respectively, on a given day. These mining hours yield and 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
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
- = hours spent mining Bitcoin,
- = hours spent mining Ethereum.
The outputs are given as and , and the prices are and .
1) Write profit
Since electricity and other operating costs are zero, profit equals revenue:
2) Write the time constraint
The computers may work for at most 15 hours per day:
At the optimum, because more hours increase output and there is no cost of hours directly, the full time constraint will typically bind:
3) Form the Lagrangian
Using multiplier for the constraint,
4) First-order conditions
Differentiate with respect to each choice variable:
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 for using the computers, the objective would become . If the 15-hour limit were replaced by , the same Lagrangian form would apply with 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).