Email: andrew@magic-man.com Mobile: 07947 064845
Magician in London, Close-up Magician, Corporate Magician
Professional Close-up Magician, Cabaret, Wedding, Corporate Event Magician

Weekly puzzle 16 – solution

Free Gas!

The correct answer is 9 miles from Andy’s house.

Each round trip is 21 miles. Clearly some common sense assumptions need to be made about the size of a gas tank. For example, if he makes 15,873 round trips before filling up with gas, that is a total of 15873*21=333333 miles. He gets 15 miles per gallon, so he used 333333/15=22222.2 gallons. Gas cost $.30/gallon, so the bill comes to 0.3*22222.2=$6666.66

Clearly this is not practical, and the cost of purchasing a vehicle with 22000 gallon tank would far out-way the free gas. And I don’t think the gas station manager would be too happy when that huge thing rolled up. And as for why Andy wants to commute in a 22000 gallon monster I don’t know. Also, the time it takes him to fill it up would mean he either has to get up very early one morning, be late for work, or have his wife put his dinner in the microwave. But since it would only happen once every 60 years or so, he would be retiring before the first tank load ran out ….

So, we can safely assume that the maximum gas is $9.99 which would equate to a tank of 9.99/30 = 33.3 gallons.

This means that the price (and the number of miles between fillings) is a multiple of 37.

Now, if Andy were to fill his tank always on the same leg, he would need to travel an number of miles that would be a multiple of 21 and 37, i.e. at least 777, which gives a price of $15.54 and a tank capacity of 51.8 gallons, which is too large.

We can therefore assume that Andy fills his tank alternately on the outbound and on the inbound legs. Let us assume that the station is a miles from one end of the road and b = 10.5 – a miles from the other end. The distances between fillings are p*21+2a and q*21+2b.

After two fillings the total distance travelled is (p+q+1)*21, and this must be a multiple of 37, which implies that p+q+1 is a multiple of 37.

Because we want the number of miles between fillings to be less than or equal to 444, p and q must both be <= 21. Therefore we must have p+q = 36, and p and q must be between 15 and 21.

As p*21+2a must be a multiple of 111 and 2a <= 21, the only possible solution (excluding symmetry) is p = 21, 2a = 3, q = 15, 2b = 18. the distances are 444 and 333 miles, and the prices are $8.88 and $6.66.

As the station is an integral number of miles from Andy's home, the distance in question is b = 9 miles.

Note that the tank capacity is still 29.6 gallons, which is still quite large. Therefore we have established that Andy is a Texan.

Extra Note : Some mathematicians have argued that the puzzle was not explicitly defined, and that there are infinitely many solutions i.e. multiples of the 22,000 example above. However, it should noted that every reader made correct assumptions about the gas tank to solve the puzzle, and mentioned the size as a humourous addition. This is a puzzle site, not a Math site.

Related Articles:

YouTube | Facebook | Twitter | Website

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • LinkedIn
  • MySpace
  • RSS
  • StumbleUpon
  • Twitter
  • MisterWong

7 Comments

Joao Pedro AfonsoApril 29th, 2010 at 10:10 am

Hi Andrew,

Regarding what some mathematicians said about infinite solutions, some Physicist could also answer that it is mathematically impossible the problem to have infinite solutions… this because the problem described is also a physical one with physical entities implying an additional implicit mathematical subtext restraining the problem.

For instance, the energy for the car comes from the energetic content of the gas, fixed for each gallon. Even if we don’t loose energy to friction, we still need energy to put the car at the speed required to do the travel in a reasonable time (at least, half a day, although in that case Andy will not have time to sleep or work). For a typical travel of acceleration in the beginning until a certain speed, and braking in the end, we’ll need a quantity of energy which is proportional to the car mass, and can not surpass the potential chemical energy of 21Mi/(15Mi/1gallon)=(7/5) of a gallon of gas. And since this imposes a limit to the mass of the car, it also imposes a limit to the fuel it can takes, and to the range it can run. While a mathematician can argue about a certain number of possible solutions, he can not say they are infinite.

[The mathematician can however argue that the car is an hybrid, saving energy from braking to increase its range. But since we already established that Andy is a Texan, that (hybrid car) is also a mathematical impossibility. In a last desperate argument, he can also argue that I’m recurring to too much implicit physical arguments or assumptions, perverting what would be a mathematically puzzle. It should be noted however that the last statement is also false: the puzzle starts as a physical puzzle since all entities in it are such: time, space, gas consumes, etc… To translate this in a mathematical problem, we need physics knowledge (even if we don’t see it as such), and claiming I’m asking too much physics, is tantamount to say they did the (incomplete) translation they wanted to give the result they wanted (infinite solutions). That’s cheating! Kill the mathematicians!!!… oh!, wait, mathematics is what I’ve being doing lately… :,-(

Joao Pedro AfonsoApril 27th, 2010 at 12:51 am

Since we are exchanging solutions, mine involved the solution of the integer equation in m, D, d and n:

21n +/- 2D = d/2 (10^m-1)/9, where d runs from 2 to 8 in steps of 2.

It looks worse than it is. We pick a number from, let’s say, S(m=3)={111,222,333,444} and divide by 21. We mark the nearest integer with the same parity than the number we started first , and multiply that number by 21. The result, we subtract from the first number and divide it by 2. For instance, if we pick 333, we have:

333 odd -> 333/21=15.857 -> 15 odd
(333-15*21)/2=9

This means a tank filled after coming from gas station to home, plus 15 complete trips home-work-home plus a travel until the gas station again at 9 miles from home, totaling 21*15+2*9 Mi=333Mi. To get the pay, we multiply the number by $0.02, getting $6.66. If we had chose 444 instead:

444 even -> 444/21=21.14 -> 22 even
(444-22*21)/2=-9

This means a tank filled after coming from gas station to work, plus 21 complete trips work-home-work plus a travel until the gas station again at 9 miles from home, totaling 21*21+2*(10.5-9) Mi=21*21+21+2*(-9) Mi = 21*22+2*(-9) Mi=333Mi. For this kind of travel, instead of summing the distance from gas station to work, I subtract from the voyage home-work, the distance home-station. This way, the inbound and outbound legs are characterized by the same absolute number, but in positive and negative forms, and once we got those, we’ll have a solution. This process is easy to do with paper and pencil and indeed, that was how I did (and why I was lazy and missed some parts). Below is the complete process for m=2, 3, 4, 5, etc… :

S(m=2)
11->-5
22->-10
33->6
44->1 (hmm…)

S(m=3)
111->3 (third?)
222->6 (doesn’t pair with 33)
333->9 (watch out)
444->-9 (Bingo! First Solution)

S(m=4)
1111->-1 (Dam!, I didn’t saw this coming… it’s the second, not third)
2222->-2
3333->-3 (third)
4444->-4

S(m=5)
11111->1 (hmmm…)
22222->2 (fourth)
33333->3
44444->4 (Fifth)

S(m=6)
111111->0 (we can stop now… every solution is possible here)

I did now all the steps. Since each number m added 4 candidates to the solution, drawn from -10 to 10, it was likely that different solutions would appear eventually. The zero solution is the super-solution, meaning the gas station can be anywhere.

Note that in my last comment, I presented the 1 Mi solution as third solution… If we accept $.88 as a repeated digit price, it is second, not third, happening for a ride 44 Mi long ($.88, 2*21+2*1) and 1111 Mi long ($22.22, 53*21-2*1)… meaning there is a second solution below the 3000 Mi tank in that case.

Andrew MWApril 26th, 2010 at 10:32 pm

PPS.. the 9 clearly ‘complements’ the 1.5 in the $8.88 row to give a complete 10.5 mile one way trip.

Extending the table gives other pairs and possible solutions (ensuring one is integral) –

At $2.22 (3) and $66.66 (7.5)
At $22.22 (9.5) and $222.22 (1)
At $44.44 (8.5) and $444.44 (2)

etc!
cheers

Andrew MWApril 26th, 2010 at 10:15 pm

I thought not, oh well, the columns are “$”, “miles”, “mod 21″, and “div by 2″,

e.g. an example row is
$6.66 – permissible dollars per tank
333 – miles per that tank
18 – amount left over after 21 mile round trip
9 – half of that left over amount (i.e. the distance from *either* home or work – it must be home because that is stated to be an integral amount)

cheers

Andrew MWApril 26th, 2010 at 10:12 pm

Hi

I actually got my solution through a ‘brute force’ excel effort, which is much less beautiful, but effective.

Will the table come out below?

$ miles mod 10.5 div by 2
1.11 55.5 13.5 6.75
2.22 111 6 3
3.33 166.5 19.5 9.75
4.44 222 12 6
5.55 277.5 4.5 2.25
6.66 333 18 9
7.77 388.5 10.5 5.25
8.88 444 3 1.5
9.99 499.5 16.5 8.25

It’s clear from this that the 9 and 1.5 add up to 10.5 (a one way trip), therefore 9 is the number away from his house.

This table can be easily extended to higher values, hence the 3000 mile limit.

great puzzle.

Joao Pedro AfonsoApril 26th, 2010 at 7:51 pm

Dam… I failed to saw the real meaning behind the 3000 mi remark from Andrew MW. There is a solution needing a tank of 222.2 Gallon (3333 mi) which puts the gas station at 3 Miles from home.
:-(

The next solution puts the gas station at 1 mi, for a 11111 miles maximum ride. The funny thing, I came to the conclusion I didn’t went enough far, AFTER reading my own previous words. It should have been obvious from my own reasoning, but I didn’t get it in time.

Joao Pedro AfonsoApril 26th, 2010 at 10:38 am

Maybe I did something wrong. My estimate for integral rounds is a third of your number: 5291, or 111111 miles per refill, giving $2222.22

Very cool puzzle indeed. I must mention I was going to bitch/tease about proper limits to the problem Friday, when I saw the remarks from Andrew MW… very cool remarks, praise to him, presenting the right approach to the problem basing it in common sense. If I had done the calcs first, I would have reached that some conclusion too but the truth is, I didn’t, and I was going to argue about multiple solutions. Luckily, Andrew wrote first and I learned a bit more.

Now let’s see if I was right in the solution… Pick my polynomial, substitute the X for 9, power it to the 3, hmm, hmm,… yep, right in the mark. However, I have a comment to present: just because it is reasonable to not have huge tanks in the car, that doesn’t mean “we can safely assume that the maximum gas is $9.99″. More to the point, what we must do is to start first with multiples (from 1x to 9x) of $1.11, then $11.11, then $111.11 and so on. It is very likely that the solution will appear in the smaller quantities because we have a limited number of possible searched solutions (1mile, 2, 3, until 9), and each of those quantities, $1.11, $11.11, etc, presents some integral candidates for the problem which eventually will repeat the required numbers. The first number which will appear either for outbound and inbound legs will be the solution. Indeed, that happened with the multiples of $1.11, but if it hadn’t, we should have continued with $11.11 (adding its candidates to $1.11 ones) and so on until it happened.

Leave a comment

Your comment