## Problem Description and Formulation

The problem requires maximizing the profit from selling heated and regular seats on a train with 100 seats. The train service has the following constraints:

- At least 15 seats must be reserved as heated seats.
- At least 3 times as many people prefer regular seats to heated seats.
- The profit per heated seat is $20.
- The profit per regular seat is $15.

Let's denote:
- \(H\) as the number of heated seats to be sold.
- \(R\) as the number of regular seats to be sold.

The objective is to maximize the total profit \(P = 20H + 15R\).

The constraints are:
1. \(H + R \leq 100\) (The total number of seats sold cannot exceed 100)
2. \(H \geq 15\) (At least 15 seats must be heated)
3. \(R \geq 3H\) (At least 3 times as many people prefer regular seats to heated seats)
4. \(H \geq 0\) and \(R \geq 0\) (The number of seats cannot be negative)

## Gurobi Code

To solve this linear programming problem using Gurobi in Python, we can use the following code:

```python
import gurobi

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

    # Define the variables
    H = model.addVar(name="heated_seats", lb=0, ub=100, vtype=gurobi.GRB.INTEGER)
    R = model.addVar(name="regular_seats", lb=0, ub=100, vtype=gurobi.GRB.INTEGER)

    # Objective function: Maximize profit
    model.setObjective(20 * H + 15 * R, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(H + R <= 100, name="total_seats")
    model.addConstr(H >= 15, name="min_heated_seats")
    model.addConstr(R >= 3 * H, name="regular_to_heated_ratio")

    # Solve the model
    model.optimize()

    # Print the results
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal profit: {model.objVal}")
        print(f"Heated seats: {H.varValue}")
        print(f"Regular seats: {R.varValue}")
    else:
        print("The model is infeasible")

solve_seat_allocation()
```

This code defines the problem in Gurobi, solves it, and prints out the optimal allocation of heated and regular seats to maximize profit, along with the maximum achievable profit. If the problem is infeasible, it indicates that as well.