How to write an algebraic rule and a function rule

Hello! Let's analyze the question:
Every time, the dishwasher uses 20 gallons of water.
x = number of times that the dishwasher is run
y = number of gallons of water used
Knowing that we can write the function as:
[tex]f(x)=20.x[/tex]To find how many gallons of water were used, you just need to know the number of times that the dishwasher is run (because every 1 time spends 20 gallons).
Another way to write it is:
y = 20x