## Problem Description and Formulation

The bike shop sells two models of bikes: a mountain bike and a road bike. The goal is to determine the optimal number of each type of bike to stock in order to maximize profit, given certain constraints.

- The mountain bike costs $750 and yields a profit of $300.
- The road bike costs $1000 and yields a profit of $500.
- The monthly demand will be at most 150 bikes.
- The total value of bikes in stock should not exceed $40,000.

## Decision Variables

Let \(M\) be the number of mountain bikes and \(R\) be the number of road bikes.

## Objective Function

The objective is to maximize the total profit: \(300M + 500R\).

## Constraints

1. **Demand Constraint**: \(M + R \leq 150\)
2. **Inventory Value Constraint**: \(750M + 1000R \leq 40000\)
3. **Non-Negativity Constraints**: \(M \geq 0, R \geq 0\)
4. **Integer Constraints**: \(M \in \mathbb{Z}, R \in \mathbb{Z}\) (Since we cannot stock fractions of a bike)

## Gurobi Code

```python
import gurobi

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

    # Define decision variables
    M = model.addVar(lb=0, vtype=gurobi.GRB.INTEGER, name="Mountain_Bikes")
    R = model.addVar(lb=0, vtype=gurobi.GRB.INTEGER, name="Road_Bikes")

    # Objective function: Maximize profit
    model.setObjective(300*M + 500*R, gurobi.GRB.MAXIMIZE)

    # Demand constraint
    model.addConstr(M + R <= 150, name="Demand_Constraint")

    # Inventory value constraint
    model.addConstr(750*M + 1000*R <= 40000, name="Inventory_Value_Constraint")

    # Optimize
    model.optimize()

    # Print solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution found. Mountain Bikes: {M.varValue}, Road Bikes: {R.varValue}")
    else:
        print("No optimal solution found.")

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