So I'm sure everyone asks themselves this: when's the best time to buy gas?

I think it depends how often the price fluctuates (moves up or down).

If it's basically random, and every morning when you drive past a gas station the price has changed by a random amount in a random direction since the last time, and there's no way to predict it, then:

- pick the lowest price that you'd only pay if you were at "empty" - say, $4.

- pick the highest price that's so great you'd *always* buy - say, $2.

Buy if the price is a lower percentage between the two prices, than you are through your tank. So if the current price is 25% between your two levels ($2.50 in the above) then you'll buy if you've used more than 25% of your tank.

Math geeks: under the above system, how much would you save, if prices fluctuate randomly from $2 to $4? Is there a better curve than a linear fit of tank against price?

If, on the other hand, prices go up and down slower, so if prices go up, they're likely to rise for a few days, then fall again, such that you get a few fluctuations per tank, then always buy as soon as the price starts to rise. Possibly skip buying if your tank is close to full and the price still isn't great, if there's plenty of time for it to fall again, further than it did the current time; you can use the above formula for calculating whether to skip. But if you always buy when it starts to rise, you'll always be buying at a trough, so you'll average a very low price: if peaks average $4 and troughs average $2, you'll save on average $20 per tank.

In the real world, gas prices seem to rise for months, then fall for months, such that no fluctuation lasts less than several tankfuls. In this world, it's again best to fill up as soon as prices start to rise (so you're buying as close to the bottom of the trough as you can). Also, wait as long as you can whenever prices are falling, so you're again buying as far from the peak and close to the bottom as you can. But when prices are rising, begin by topping up fairly often, then ease back to only filling up when your tank reaches the "empty" level you picked above. That'll mean that on average, when prices start dropping again, you'll be about quarter of a tank away from filling up (you either filled up a quarter tank ago, or you'll need to fill in another quarter tank).

So you always fill at the bottom of the trough, and on average, will fill up a quarter tank away from the peak. That puts you an eighth of a tank better than average! Hardly seems worth the hassle, really. Say the fluctuation lasts 6 months, and you have a 10 gallon tank. Even if it rises from $2 to $4, a difference of $20 per tank, you'll save only $2.50 over six months by following this advice. Not worth your time.

I think it depends how often the price fluctuates (moves up or down).

If it's basically random, and every morning when you drive past a gas station the price has changed by a random amount in a random direction since the last time, and there's no way to predict it, then:

- pick the lowest price that you'd only pay if you were at "empty" - say, $4.

- pick the highest price that's so great you'd *always* buy - say, $2.

Buy if the price is a lower percentage between the two prices, than you are through your tank. So if the current price is 25% between your two levels ($2.50 in the above) then you'll buy if you've used more than 25% of your tank.

Math geeks: under the above system, how much would you save, if prices fluctuate randomly from $2 to $4? Is there a better curve than a linear fit of tank against price?

If, on the other hand, prices go up and down slower, so if prices go up, they're likely to rise for a few days, then fall again, such that you get a few fluctuations per tank, then always buy as soon as the price starts to rise. Possibly skip buying if your tank is close to full and the price still isn't great, if there's plenty of time for it to fall again, further than it did the current time; you can use the above formula for calculating whether to skip. But if you always buy when it starts to rise, you'll always be buying at a trough, so you'll average a very low price: if peaks average $4 and troughs average $2, you'll save on average $20 per tank.

In the real world, gas prices seem to rise for months, then fall for months, such that no fluctuation lasts less than several tankfuls. In this world, it's again best to fill up as soon as prices start to rise (so you're buying as close to the bottom of the trough as you can). Also, wait as long as you can whenever prices are falling, so you're again buying as far from the peak and close to the bottom as you can. But when prices are rising, begin by topping up fairly often, then ease back to only filling up when your tank reaches the "empty" level you picked above. That'll mean that on average, when prices start dropping again, you'll be about quarter of a tank away from filling up (you either filled up a quarter tank ago, or you'll need to fill in another quarter tank).

So you always fill at the bottom of the trough, and on average, will fill up a quarter tank away from the peak. That puts you an eighth of a tank better than average! Hardly seems worth the hassle, really. Say the fluctuation lasts 6 months, and you have a 10 gallon tank. Even if it rises from $2 to $4, a difference of $20 per tank, you'll save only $2.50 over six months by following this advice. Not worth your time.