Search:
Gasoline Challenge!
 Image: Author: XrayGroup: DefaultFilesize: 229.88 kBDate added: 2017-08-24Rating: 6.5Downloads: 2655Views: 663Comments: 21Ratings: 4Times favored: 0Made with: Algodoo v2.1.0Tags: Scene tag [scene]166675[/scene] You have three gasoline containers of different sizes, and by pouring gasoline between the containers, your challenge is to end up with exactly FOUR gallons in any of the containers, despite the fact that none of the containers have a 4 gallon capacity. Each transfer of gasoline from one container to another is a step. You must arrive at 4 gallons in as few steps as possible. I will list one solution in a few days in the comments if no one else has already done so. I found one solution that arrives at 4 gallons in six steps. Can you do better? Complete instructions, and a story about a woman in distress are in the scene. Enjoy reading!
Similar scenes
Responses to this scene
 Well done. Is gasoline a solution?
 Thanks, s_noonan! To answer your ambiguous but clever question, I will give you a multi-faceted answer: YES and NO. Yes, because it certainly is a liquid, and No, because it is not the answer for the world's insatiable appetite for energy.
 I changed my mind and decided to post one possible solution now, rather than waiting a few days..... 8 -----> 5 5 -----> 3 8 <----- 3 5 -----> 3 8 -----> 5 5 -----> 3 These steps (6 of them) should result in the middle (5 gallon) container having 4 gallons in it. Last edited at 2017/08/24 18:37:52 by Xray
 As far as I can tell, gasoline is a solution, which is a type of homogeneous mixture.
 I've develop thyme script to solve that // // Best result is: // Finished with 6 steps: 1->2 2->3 3->1 2->3 1->2 2->3 // scene.my.cans := [[8,8],[5,0],[3,0]]; scene.my.maxLevel := 8; scene.my.trans := (cFrom, cTo, cans, level, history) => { level <= scene.my.maxLevel ? { finish := (cans) => {cans(0)(1) == 4 || cans(1)(1) == 4}; setCan := (cans, can, val) => { newCans := []; for(3, (i) => { i == can ? {newCans = newCans ++ [[cans(i)(0), val]]} : {newCans = newCans ++ [cans(i)]} }); newCans }; nextCans := cans; a := cans(cTo)(0) - cans(cTo)(1); cans(cFrom)(1) > a ? { nextCans = setCan(nextCans, cTo, cans(cTo)(0)); nextCans = setCan(nextCans, cFrom, cans(cFrom)(1) - a) }:{ nextCans = setCan(nextCans, cTo, cans(cTo)(1) + cans(cFrom)(1)); nextCans = setCan(nextCans, cFrom, 0) }; finish(nextCans) ? {print("Finished with "+level+" steps: " + history)}:{ transfers := [[0,1],[1,0],[0,2],[2,0],[1,2],[2,1]]; for(6, (j) => { transfers(j) == [cFrom, cTo] || transfers(j) == [cTo, cFrom] ? {}:{ nextCans(transfers(j)(0))(1) > 0 && (nextCans(transfers(j)(1))(0) > nextCans(transfers(j)(1))(1)) ? { scene.my.trans(transfers(j)(0),transfers(j)(1), nextCans, level + 1, history + (transfers(j)(0)+1) + "->" + (transfers(j)(1)+1) +" "); }:{} } }) } }:{}; }; scene.my.solveAll := { scene.my.trans(0, 1, scene.my.cans, 1, "1->2 "); scene.my.trans(0, 2, scene.my.cans, 1, "1->3 ") }; scene.my.solveAll; Last edited at 2017/08/25 12:01:05 by Kilinich
 4 steps
 8>5 5>3 5>8>5 really fast
 2 steps 8>5>3 while 8 is filling 5
 1 to 2 2 to 3 3 to 1 2 to 3 1 to 2 2 to 3 Kilinich I'm starting to hate you
 Why do you hate kilinich?
 8>5 5>3 5>8>5 really fast can't work because it's not possible to pour exactly 4 gallons from 5, no matter how "fast" you do it. The volume transferred is the volume over time, so if you poured for half of a second you would have to transfer 4 gallons per second, but if you only poured 3 gallons per second you would only get 1.5 gallons, and if you poured 5 gallons per second you would get 2.5 gallons 8>5>3 while 8 is filling 5 leaves you with 2 3 3 If you overflow can 3 you return to the "how fast you do it" problem where you're getting more or less (in the quite literal sense) than the goal. This is worsened by the fact that you're doing two pours simultaneously
 jon_joy_1999 - I'm not quite sure what you are talking about because this scene does not allow the user to pour a partial amount and then stop at will. A transfer will stop when either one of two conditions is met: 1. The container supplying gasoline gets emptied, or 2. The container receiving gasoline gets filled. There are no other possibilities without hacking the code or manually starting/stopping the scene. I made it so that only integer amounts of gasoline get transferred each time. Last edited at 2017/09/12 20:49:31 by Xray
 panda's "8>5>3 while 8 is filling 5" method does work. I think that his solution is the fastest and most creative. This two step method can be viewed two ways, either panda is breaking the rules, or Xray's scene does not work as well at it should.
 s_noonan - The scene works exactly as I designed it. But if you can improve how it functions (and I'm sure that you can) please go ahead and upload an improved version of it. Wait.... I just realized that the scene could be used in a way that I hadn't designed it. While a transfer is taking place, the user could click on a different arrow which will stop the transfer and start a different transfer while the original transfer continues! By doing that, you could actually generate additional gasoline like magic! Too bad we can't do that in reality. Last edited at 2017/09/14 01:58:42 by Xray
 So the next challenge is to create a puzzle where the only solution is to exploit an Algodoo glitch. This would be a challenge open to everybody.
 Sounds interesting. You go first.
 I have another idea for a puzzle scene. First I'll create a scene with an intriguing title. Perhaps something like "How I accidentally cut off my arm", or "How filter out marble race scenes", or "I'm Sorry Everyone..". Then I'll just delete the scene. Users can then puzzle about what was really in the scene.
 Wow, you sure do come up with some great ideas.
 Is there a way to solve this in a similar fashion to the method used in http://www.algodoo.com/al … ?id=111774? Perhaps some sort of 3D isometric grid? Last edited at 2017/09/22 14:42:11 by Kilinich
 par = 7 steps Last edited at 2017/09/24 20:03:56 by aus2006
 I managed to create 6 extra gallons