## Problem Description and Formulation

Martin wants to invest $2,000,000 in four technology sectors: GPUs, CPUs, software, and mobile devices, with annual rates of return being 4%, 6%, 11%, and 8%, respectively. He has the following conditions:

1. The amount invested in GPUs cannot exceed the amount invested in CPUs.
2. The amount invested in mobile devices cannot exceed the amount invested in software.
3. At most 9% of the investment can be in GPUs.

The goal is to maximize the total return on investment.

## Mathematical Formulation

Let \(G\), \(C\), \(S\), and \(M\) be the amounts invested in GPUs, CPUs, software, and mobile devices, respectively. The problem can be formulated as:

Maximize: \(0.04G + 0.06C + 0.11S + 0.08M\)

Subject to:

1. \(G \leq C\)
2. \(M \leq S\)
3. \(G \leq 0.09 \times 2000000\)
4. \(G + C + S + M = 2000000\)
5. \(G, C, S, M \geq 0\)

## Gurobi Code

```python
import gurobi

def martin_investment_problem():
    # Create a new model
    model = gurobi.Model()

    # Define the variables
    G = model.addVar(lb=0, name="GPUs")
    C = model.addVar(lb=0, name="CPUs")
    S = model.addVar(lb=0, name="software")
    M = model.addVar(lb=0, name="mobile_devices")

    # Objective function: Maximize return
    model.setObjective(0.04 * G + 0.06 * C + 0.11 * S + 0.08 * M, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(G <= C, name="GPUvsCPU")
    model.addConstr(M <= S, name="MobilevsSoftware")
    model.addConstr(G <= 0.09 * 2000000, name="GPU_limit")
    model.addConstr(G + C + S + M == 2000000, name="total_investment")

    # Solve the problem
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal investment amounts:")
        print(f"GPUs: ${G.varValue:.2f}")
        print(f"CPUs: ${C.varValue:.2f}")
        print(f"Software: ${S.varValue:.2f}")
        print(f"Mobile Devices: ${M.varValue:.2f}")
        print(f"Total return: ${model.objVal:.2f}")
    else:
        print("No optimal solution found.")

if __name__ == "__main__":
    martin_investment_problem()
```