## Problem Description and Formulation

The car company produces two types of cars: race cars and regular cars. There are two teams, one for each type of car. The production rates and profit margins are as follows:

- The race car team can produce at most 3 race cars per day.
- The regular car team can produce at most 5 regular cars per day.
- The safety check team can inspect at most 6 cars of either type per day.

The profit per race car is $20,000, and the profit per regular car is $10,000. The goal is to maximize the company's profit by determining the optimal number of race cars and regular cars to produce.

## Mathematical Formulation

Let \(R\) be the number of race cars produced and \(r\) be the number of regular cars produced.

The objective function to maximize profit is:
\[ \text{Maximize:} \quad 20000R + 10000r \]

Subject to the constraints:
1. \( R \leq 3 \) (race car production limit)
2. \( r \leq 5 \) (regular car production limit)
3. \( R + r \leq 6 \) (safety check limit)
4. \( R \geq 0, r \geq 0 \) (non-negativity constraints)

## Gurobi Code

```python
import gurobi

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

    # Define variables
    R = model.addVar(lb=0, ub=3, name="Race_Cars")  # Number of race cars
    r = model.addVar(lb=0, ub=5, name="Regular_Cars")  # Number of regular cars

    # Objective function: Maximize profit
    model.setObjective(20000*R + 10000*r, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(R <= 3, name="Race_Car_Limit")
    model.addConstr(r <= 5, name="Regular_Car_Limit")
    model.addConstr(R + r <= 6, name="Safety_Check_Limit")

    # Optimize
    model.optimize()

    # Print solution
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: Race Cars = {R.varValue}, Regular Cars = {r.varValue}")
        print(f"Maximum profit: ${20000*R.varValue + 10000*r.varValue}")
    else:
        print("No optimal solution found.")

solve_production_problem()
```