## Problem Description and Formulation

Frank has up to $5000 to invest in the cigarette and tobacco industries. The goal is to maximize his investment profit under the following constraints:
1. At least 40% of all the money invested must be in the cigarette industry.
2. At least $1000 must be invested in the tobacco industry.
3. Each dollar invested in the cigarette industry yields a $0.30 profit.
4. Each dollar invested in the tobacco industry yields a $0.45 profit.

Let's denote:
- \(x\) as the amount invested in the cigarette industry.
- \(y\) as the amount invested in the tobacco industry.

The objective function to maximize profit is:
\[ \text{Maximize:} \quad 0.30x + 0.45y \]

Subject to:
1. \( x + y \leq 5000 \) (total investment not exceeding $5000)
2. \( x \geq 0.40(x + y) \) (at least 40% in the cigarette industry)
3. \( y \geq 1000 \) (at least $1000 in the tobacco industry)
4. \( x \geq 0 \) and \( y \geq 0 \) (non-negativity constraints)

## Converting Constraints to Standard Form

1. \( x + y \leq 5000 \)
2. \( x \geq 0.40x + 0.40y \) simplifies to \( 0.60x - 0.40y \geq 0 \)
3. \( y \geq 1000 \)

## Gurobi Code

```python
import gurobi

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

    # Define variables
    x = model.addVar(name="cigarette_investment", lb=0)
    y = model.addVar(name="tobacco_investment", lb=0)

    # Objective function: Maximize profit
    model.setObjective(0.30 * x + 0.45 * y, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(x + y <= 5000, name="total_investment")
    model.addConstr(0.60 * x - 0.40 * y >= 0, name="cigarette_proportion")
    model.addConstr(y >= 1000, name="tobacco_min_investment")

    # Optimize
    model.optimize()

    # Print solution
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal investment in cigarette industry: $", x.varValue)
        print("Optimal investment in tobacco industry: $", y.varValue)
        print("Maximum profit: $", model.objVal)
    else:
        print("The problem is infeasible")

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