## Problem Description and Formulation

The bakery's problem can be formulated as a linear programming optimization problem. The goal is to maximize profit given certain constraints on demand, production capacity, and contract requirements.

### Decision Variables

- \(x\): Number of chocolate donuts produced
- \(y\): Number of maple donuts produced

### Objective Function

The profit per chocolate donut is $2, and the profit per maple donut is $3. The objective is to maximize the total profit \(P = 2x + 3y\).

### Constraints

1. **Demand Constraints**
   - \(x \geq 50\) (at least 50 chocolate donuts)
   - \(y \geq 75\) (at least 75 maple donuts)

2. **Production Capacity Constraints**
   - \(x \leq 100\) (at most 100 chocolate donuts)
   - \(y \leq 150\) (at most 150 maple donuts)

3. **Contract Constraint**
   - \(x + y \geq 200\) (at least 200 donuts total)

4. **Non-Negativity Constraints**
   - \(x \geq 0\) and \(y \geq 0\) (production cannot be negative, but these are implicitly satisfied by the demand constraints)

## Gurobi Code

```python
import gurobi

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

    # Define variables
    x = model.addVar(lb=50, ub=100, name="chocolate_donuts")
    y = model.addVar(lb=75, ub=150, name="maple_donuts")

    # Objective function: maximize profit
    model.setObjective(2*x + 3*y, gurobi.GRB.MAXIMIZE)

    # Contract constraint: at least 200 donuts
    model.addConstraint(x + y >= 200, name="total_donuts")

    # Solve the model
    model.optimize()

    # Check if the model is optimized
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: x = {x.varValue}, y = {y.varValue}")
        print(f"Maximum profit: ${2*x.varValue + 3*y.varValue}")
    else:
        print("The model is infeasible.")

solve_bakery_problem()
```

This code defines the bakery problem using Gurobi's Python interface, sets up the optimization model with the specified constraints and objective function, and solves it to find the optimal production levels for chocolate and maple donuts that maximize profit.