## Problem Description and Formulation

The problem is a linear programming optimization problem. The goal is to maximize the profit by determining the number of sofas and beds an outlet should buy and sell, given certain constraints.

### Variables

- \(S_b\): Number of sofas to buy
- \(B_b\): Number of beds to buy
- \(S_s\): Number of sofas to sell
- \(B_s\): Number of beds to sell

### Objective Function

The objective is to maximize the total profit \(P\), where the profit per sofa sold is $100 and per bed sold is $200.

\[P = 100S_s + 200B_s\]

However, the problem does not explicitly state that the number of items sold must equal the number of items bought. For simplicity and based on typical interpretations of such problems, we will assume that the outlet sells all it buys, i.e., \(S_s = S_b\) and \(B_s = B_b\). The objective function then becomes:

\[P = 100S_b + 200B_b\]

### Constraints

1. **Space Constraint**: Each sofa takes 8 sq ft, and each bed takes 12 sq ft. The outlet has 500 sq ft available.

\[8S_b + 12B_b \leq 500\]

2. **Budget Constraint**: Buying a sofa costs $200, and buying a bed costs $300. The outlet has a budget of $12,500.

\[200S_b + 300B_b \leq 12500\]

3. **Sofa Percentage Constraint**: At least 30% of items in stock must be sofas.

\[S_b \geq 0.3(S_b + B_b)\]

Simplifying:

\[0.7S_b \geq 0.3B_b\]

\[7S_b \geq 3B_b\]

4. **Non-Negativity Constraints**: The number of sofas and beds bought must be non-negative.

\[S_b \geq 0, B_b \geq 0\]

## Gurobi Code

```python
import gurobipy as gp

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

# Variables
S_b = m.addVar(name="Sofa_Buy", vtype=gp.GRB.INTEGER, lb=0)
B_b = m.addVar(name="Bed_Buy", vtype=gp.GRB.INTEGER, lb=0)

# Objective function: Maximize profit
m.setObjective(100 * S_b + 200 * B_b, gp.GRB.MAXIMIZE)

# Space constraint
m.addConstr(8 * S_b + 12 * B_b <= 500, name="Space_Constraint")

# Budget constraint
m.addConstr(200 * S_b + 300 * B_b <= 12500, name="Budget_Constraint")

# Sofa percentage constraint
m.addConstr(7 * S_b >= 3 * B_b, name="Sofa_Percentage_Constraint")

# Solve the model
m.optimize()

if m.status == gp.GRB.OPTIMAL:
    print(f"Optimal Solution: Buy {S_b.varValue} sofas and {B_b.varValue} beds")
else:
    print("The problem is infeasible")
```