## Problem Description and Formulation

The problem is a linear programming optimization problem. The goal is to minimize the cost of mixing two brands of paint, Ruby and Sapphire, to create a new mixture that meets certain requirements for dye, thinner, and water.

### Variables

- Let \(R\) be the number of cans of Ruby paint.
- Let \(S\) be the number of cans of Sapphire paint.

### Objective Function

The objective is to minimize the total cost. The cost of a can of Ruby paint is $12, and the cost of a can of Sapphire paint is $15. Therefore, the objective function is:

\[ \text{Minimize:} \quad 12R + 15S \]

### Constraints

1. **Dye Requirement:** A can of Ruby paint contains 2 units of dye, and a can of Sapphire paint contains 4 units of dye. The minimum requirement for dye is 15 units.

\[ 2R + 4S \geq 15 \]

2. **Thinner Requirement:** A can of Ruby paint contains 4 units of thinner, and a can of Sapphire paint contains 6 units of thinner. The minimum requirement for thinner is 20 units.

\[ 4R + 6S \geq 20 \]

3. **Water Requirement:** A can of Ruby paint contains 5 units of water, and a can of Sapphire paint contains 2 units of water. The minimum requirement for water is 18 units.

\[ 5R + 2S \geq 18 \]

4. **Non-Negativity Constraints:** The number of cans of each paint brand must be non-negative.

\[ R \geq 0, S \geq 0 \]

## Gurobi Code

```python
import gurobipy as gp

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

# Define variables
R = model.addVar(name="Ruby", lb=0)  # Number of cans of Ruby paint
S = model.addVar(name="Sapphire", lb=0)  # Number of cans of Sapphire paint

# Objective function: Minimize cost
model.setObjective(12*R + 15*S, gp.GRB.MINIMIZE)

# Constraints
model.addConstr(2*R + 4*S >= 15, name="Dye_Requirement")
model.addConstr(4*R + 6*S >= 20, name="Thinner_Requirement")
model.addConstr(5*R + 2*S >= 18, name="Water_Requirement")

# Solve the model
model.optimize()

# Print solution
if model.status == gp.GRB.OPTIMAL:
    print(f"Optimal cost: ${model.objVal:.2f}")
    print(f"Ruby: {R.varValue:.2f} cans")
    print(f"Sapphire: {S.varValue:.2f} cans")
else:
    print("No optimal solution found.")
```