Given
First, let's summarize the costs of each ingredient
Distilled Water: $2/gallon
Diet cola: $4/gallon
Diluted alchohol: $1/gallon
Total = 8 gallons
Cost = $18
Batch of goo uses the same amount of Water an Cola
Procedure
Let's formulate a system of equations to define the problem we have.
w = gallons of water
c = gallons of cola
a = gallons of alcohol
The first equation we can create is using the total amount of gallons created.
Now we can create an equation associated with costs and total cost
As you can see in our system we have 3 unknowns so we need a third equation.
For this we use the information that we need the same amount of Cola and Water.
8a) Let's write this as a system of equations
8b) Now let's proceed to solve the system of equations
As we know w = c, therefore c = 2.5. Now, for a
Water = 2.5 gallons
Cola = 2.5 gallons
Alcohol = 3.0 galons