## Problem Description and Formulation

The problem is a linear programming optimization problem. The goal is to maximize the annual return on investment for a lawyer who has $1,000,000 available to invest in four industries: gold, diamond, ruby, and sapphire. The annual rates of return for these industries are 3%, 5%, 6%, and 10%, respectively.

There are several constraints:

1. The amount invested in the sapphire industry cannot exceed the amount invested in the gold industry.
2. The amount invested in the diamond industry cannot exceed the amount invested in the ruby industry.
3. A maximum of 40% of the total investment can be invested in the sapphire industry.

## Mathematical Formulation

Let \(G\), \(D\), \(R\), and \(S\) be the amounts invested in the gold, diamond, ruby, and sapphire industries, respectively. The problem can be formulated as:

### Objective Function

Maximize the total return on investment:
\[ 0.03G + 0.05D + 0.06R + 0.10S \]

### Constraints

1. Total investment constraint:
\[ G + D + R + S \leq 1,000,000 \]

2. Sapphire vs. Gold constraint:
\[ S \leq G \]

3. Diamond vs. Ruby constraint:
\[ D \leq R \]

4. Sapphire industry limit:
\[ S \leq 0.40 \times 1,000,000 \]
\[ S \leq 400,000 \]

5. Non-negativity constraints:
\[ G, D, R, S \geq 0 \]

## Gurobi Code

```python
import gurobi

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

    # Define the variables
    G = model.addVar(lb=0, name="Gold")
    D = model.addVar(lb=0, name="Diamond")
    R = model.addVar(lb=0, name="Ruby")
    S = model.addVar(lb=0, name="Sapphire")

    # Objective function: Maximize return on investment
    model.setObjective(0.03*G + 0.05*D + 0.06*R + 0.10*S, gurobi.GRB.MAXIMIZE)

    # Total investment constraint
    model.addConstr(G + D + R + S <= 1000000, name="Total_Investment")

    # Sapphire vs. Gold constraint
    model.addConstr(S <= G, name="Sapphire_vs_Gold")

    # Diamond vs. Ruby constraint
    model.addConstr(D <= R, name="Diamond_vs_Ruby")

    # Sapphire industry limit
    model.addConstr(S <= 400000, name="Sapphire_Limit")

    # Optimize the model
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal investment strategy:")
        print(f"Gold: ${G.varValue}")
        print(f"Diamond: ${D.varValue}")
        print(f"Ruby: ${R.varValue}")
        print(f"Sapphire: ${S.varValue}")
        print(f"Max Return: ${model.objVal}")
    else:
        print("No optimal solution found.")

solve_investment_problem()
```