
Yuriy S. answered 03/28/20
Theoretical physicist and mathematician
Initially, at M = 0 miles traveled, the volume of gas in the full tank was G = 20 gallons. The same result can be obtained by substituting M = 0 into the formula G = 20 - M/22. This is why the computation “starts” with the value 20.
Next consider these quantities after traveling d = 22 miles. In this case, 1 gallon of gas is used, and the remaining volume should be 20 - 1 = 19 gallons. Indeed, from the formula we obtain G = 20 - 22/22 = 19. Thus, the value 22 appears in the denominator of the fraction because we can ride M = 22 miles per gallon of gas, and the consumption is M/22 gallons of gas per M miles traveled.
If George has driven 100 miles since the tank was filled, there is still G = 20 - 100/22 = 15.45454546 gallons left (we just have to substitute M = 100 into the formula for remaining gas volume G).
When 4 gallons left in the tank, G = 4, and from our formula we have 4 = 20 - M/22, which we have to solve for the number of traveled miles M, giving M = 352 miles. This is how far George can drive and be left with 4 gallons in the tank.
For the case of 1 gallon left, we repeat the same calculations with G = 1, i.e., 1 = 20 - M/22, giving M = 418 miles traveled before the “low fuel” light comes on.