Lumber Hp Def
1. **State the problem:** You have 3 lumber units to spend.
Each lumber can buy 160000 HP directly.
Each lumber can also buy 640 DEF, and each point of DEF increases your total HP by 2%.
We want to find the best way to allocate lumber to maximize your total HP.
2. **Define variables:** Let $x$ be the number of lumber used to buy HP.
Let $y$ be the number of lumber used to buy DEF.
Since you have 3 lumber:
$$x + y = 3$$
3. **Express HP and DEF in terms of $x$ and $y$:**
- HP bought directly:
$$HP_{base} = 160000 \times x$$
- DEF bought:
$$DEF = 640 \times y$$
4. **Calculate effective HP including DEF buffs:**
Each DEF point increases HP by 2%, so total multiplier from DEF is:
$$M = 1 + 0.02 \times DEF = 1 + 0.02 \times 640y = 1 + 12.8y$$
5. **Total effective HP:**
$$HP_{total} = HP_{base} \times M = 160000x (1 + 12.8y)$$
6. **Express $x$ in terms of $y$:**
$$x = 3 - y$$
7. **Rewrite total HP as function of $y$ only:**
$$HP_{total}(y) = 160000(3 - y)(1 + 12.8y)$$
Expanding:
$$HP_{total}(y) = 160000(3 + 38.4y - y - 12.8y^2) = 160000(3 + 37.4y - 12.8y^2)$$
$$HP_{total}(y) = 480000 + 5984000 y - 2048000 y^2$$
8. **Find maximum by differentiating and setting derivative to zero:**
$$\frac{d HP_{total}}{d y} = 5984000 - 4096000 y = 0$$
Solve for $y$:
$$4096000 y = 5984000 \\ y = \frac{5984000}{4096000} = 1.46$$
9. **Check if $y=1.46$ is within bounds $0 \leq y \leq 3$:** It is.
10. **Calculate $x$:**
$$x = 3 - 1.46 = 1.54$$
11. **Final allocation:**
- Use approx 1.54 lumber to buy HP.
- Use approx 1.46 lumber to buy DEF.
12. **Calculate final total HP:**
$$HP_{base} = 160000 \times 1.54 = 246400$$
$$DEF = 640 \times 1.46 = 934.4$$
Multiplier:
$$1 + 0.02 \times 934.4 = 1 + 18.688 = 19.688$$
Total HP:
$$246400 \times 19.688 = 4,851,123.2$$
**Answer:** Allocate about 1.54 lumber to HP and 1.46 lumber to DEF to maximize your total effective HP of approximately 4,851,123.