StoneTemplePython
Science Advisor
Gold Member
- 1,265
- 597
Freixas said:Hey, Mr. StoneTemplePython, thanks a lot for burning up all my spare time!I took a look at the problem and solving it became an obsession.
I didn't look at your solution or anyone else's until after coming up with my own (and I learned that email alerts don't honor the SPOILER codes, so I had to avert my eyes to that portion of your message). Actually, I haven't read any of the other answers except yours.
Yes, I can certainly relate to this. Figuring out how to break the abstraction into something useful can take a little or an awful lot of time. That's kind of the joy, and peril, of these challenges I think.
I also didn't realize that Spoilers aren't hidden in emails... interesting.
Freixas said:I often get caught by misreading the problem or making the wrong assumptions or failing to make the right assumptions.
For example, I assumed all canisters hold the same amount of fuel, since assuming otherwise would definitely put the problem out of my reach...
I came up with something like your solution, but I don't think your solution is complete. Consider the 4-canister case. I place two canisters together and another two together such that the distance between them is greater than two intervals. Your argument fails.
Sorry no. Your assumption isn't justifed. The canisters in general hold a varying amount of fuel. The only constraint is that of course each amount is real non-negative and in aggregate the amount of fuel sums to exactly the amount required to drive around the track. (There is a way to convert from your not justified assumption to the actual problem by changing perspective and just looking at partial sums though... edit: specifically if you consider for any arbitrarily chosen starting position then the ith 'gas station' has ##x_i## of gas and ##y_i## as the gas required to get to the next station -- the value of ##z_i:= (x_i - y_i)## is what is of interest.)
Your 'counterexample' doesn't hold water I'm afraid. If you place two canister touching each other (I guess that's what 'together' means?) then it's just another legal 4 canister configuration. If together means 'exactly the same spot' I'm not really sure that's allowed physically but in the interest of sport I'd point out that if it were allowed you have just reduced it to the 2 canister problem which most people can solve by inspection.
- - - -
edit: thread was moved to the right home so suggested place for follow-ups is not needed.
- - - -
note: some of your questions and confusions were already asked and answered in that thread.
another note: even if you've been out of the habit of doing math for many decades, in the event you've been doing computer programming in the interim, my suggested solution should feel quite familiar to certain recursive programs.
- - - -
All in all I think we agree that this is a nice Basic Challenge
Last edited: