## Problem Description and Formulation

The problem requires formulating a linear programming (LP) model to minimize the weekly wage bill for a restaurant, given certain constraints on the number of new and senior cooks.

- Let \(x\) be the number of new cooks.
- Let \(y\) be the number of senior cooks.

The objective is to minimize the total weekly wage bill: \(500x + 1000y\).

Subject to the following constraints:

1. The total number of cooks must be at least 30: \(x + y \geq 30\).
2. There must be at least 5 senior cooks: \(y \geq 5\).
3. The number of senior cooks should be at least a third of the number of new cooks: \(y \geq \frac{1}{3}x\).
4. The weekly wage bill must be kept below $50,000: \(500x + 1000y \leq 50000\).

## Conversion to Gurobi Code

To solve this LP problem using Gurobi, we will use the Gurobi Python interface. First, ensure you have Gurobi installed in your Python environment. You can install it via pip: `pip install gurobi`.

```python
import gurobi as gp
from gurobi import gp

# Create a new model
m = gp.Model("Cooks_Optimization")

# Define the variables
x = m.addVar(lb=0, vtype=gp.GRB.INTEGER, name="new_cooks")  # Number of new cooks
y = m.addVar(lb=0, vtype=gp.GRB.INTEGER, name="senior_cooks")  # Number of senior cooks

# Objective: Minimize the total weekly wage bill
m.setObjective(500*x + 1000*y, gp.GRB.MINIMIZE)

# Constraints
m.addConstr(x + y >= 30, name="total_cooks")  # Minimum total cooks
m.addConstr(y >= 5, name="min_senior_cooks")  # Minimum senior cooks
m.addConstr(y >= x/3, name="senior_to_new_ratio")  # Senior cooks to new cooks ratio
m.addConstr(500*x + 1000*y <= 50000, name="wage_bill")  # Maximum wage bill

# Solve the model
m.optimize()

# Print the solution
if m.status == gp.GRB.OPTIMAL:
    print("Optimal Solution:")
    print(f"Number of new cooks: {x.varValue}")
    print(f"Number of senior cooks: {y.varValue}")
    print(f"Minimum wage bill: ${500*x.varValue + 1000*y.varValue}")
else:
    print("The model is infeasible")
```