## Problem Description and Formulation

The problem involves Amazing Decor, a company that buys and sells furniture and carpet. The goal is to maximize profit given certain constraints.

### Variables and Parameters

- **Decision Variables:**
  - \(F_b\): Number of furniture to buy
  - \(C_b\): Number of carpet to buy
  - \(F_s\): Number of furniture to sell
  - \(C_s\): Number of carpet to sell

- **Parameters:**
  - Space per furniture: 12 square feet
  - Space per carpet: 7 square feet
  - Total space available: 1200 square feet
  - Cost to buy furniture: $300
  - Cost to buy carpet: $80
  - Total budget: $30,000
  - Profit per furniture sold: $40
  - Profit per carpet sold: $30
  - Minimum percentage of furniture in stock: 20%

### Constraints

1. **Space Constraint:** \(12F_b + 7C_b \leq 1200\)
2. **Budget Constraint:** \(300F_b + 80C_b \leq 30000\)
3. **Furniture Percentage Constraint:** \(F_b \geq 0.20(F_b + C_b)\)
4. **Non-Negativity Constraints:** \(F_b, C_b, F_s, C_s \geq 0\)
5. **Sales Constraints:** Assuming the company sells what it buys, \(F_s = F_b\) and \(C_s = C_b\).

### Objective Function

Maximize profit: \(40F_s + 30C_s = 40F_b + 30C_b\)

## Gurobi Code

```python
import gurobipy as gp

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

# Decision variables
F_b = model.addVar(name="Furniture_Buy", vtype=gp.GRB.INTEGER, lb=0)
C_b = model.addVar(name="Carpet_Buy", vtype=gp.GRB.INTEGER, lb=0)
F_s = F_b  # Assuming what is bought is sold
C_s = C_b  # Assuming what is bought is sold

# Objective function: Maximize profit
model.setObjective(40*F_s + 30*C_s, gp.GRB.MAXIMIZE)

# Space constraint
model.addConstr(12*F_b + 7*C_b <= 1200, name="Space_Constraint")

# Budget constraint
model.addConstr(300*F_b + 80*C_b <= 30000, name="Budget_Constraint")

# Furniture percentage constraint
model.addConstr(F_b >= 0.20*(F_b + C_b), name="Furniture_Percentage_Constraint")

# Solve the model
model.optimize()

# Print the results
if model.status == gp.GRB.OPTIMAL:
    print("Optimal Solution:")
    print(f"Furniture to buy: {F_b.varValue}")
    print(f"Carpet to buy: {C_b.varValue}")
    print(f"Profit: {model.objVal}")
else:
    print("No optimal solution found.")
```

This Gurobi code models the optimization problem described, with the objective of maximizing profit under the given constraints. It assumes that the company sells what it buys, hence \(F_s = F_b\) and \(C_s = C_b\). The code solves the linear programming problem and prints out the optimal quantities of furniture and carpet to buy (and sell), along with the maximum achievable profit. If no optimal solution is found, it indicates that the problem is infeasible or unbounded.