Silly Druid 6,925 November 6, 2023 Share November 6, 2023 There's not much interest in the problems so far, but let's try another one... (it's from a movie btw) You have a 3-gallon container, and a 5-gallon container. You have access to a source of water and a sink. Your goal is to have exactly 4 gallons of water in the 5-galloon container. How can you do that? 2 Link to comment Share on other sites More sharing options...
arashi_ 19 November 15, 2023 Share November 15, 2023 A cooking challenge huh? Say less: Fill the 3-gallon container up with water. Pour the water from the 3-gallon into the 5-gallon container. Fill the 3-gallon container again. Pour the 3-gallon into the 5-gallon container until full. Since the 5-gallon container already has 3 gallons, you can only pour in 2 more gallons from the 3-gallon container. This leaves 1 gallon left in the 3-gallon container. Empty the 5-gallon container, then pour the 1 gallon of water from the 3-gallon container to the 5-gallon container. Fill the 3-gallon container one more time and pour it into the 5-gallon container. Bam, 4-gallons baby. 1 Link to comment Share on other sites More sharing options...
Silly Druid 6,925 November 15, 2023 Author Share November 15, 2023 (edited) @arashi_ That's correct! You get a point. Here's my solution, I think it's a bit simpler (I put the amount of water in both containers next to each step to make it easier to follow); 1. Fill the 5-gallon container. (5/0) 2. Pour the water from 5-galloon container to the 3-gallon until the latter is full. (2/3) 3. Empty the 3-gallon container. (2/0) 4. Pour the water from 5-gallon into 3-gallon. (0/2) 5. Fill the 5-gallon container again (5/2) 6. Pour the water from it into the 3-gallon until it's full. (4/3) If I'm not mistaken, this problem comes from the movie "Die Hard" (I haven't seen the movie myself, but I've seen that information somewhere.) Edited November 15, 2023 by Silly Druid 1 Link to comment Share on other sites More sharing options...
SasQ 1,376 January 28 Share January 28 On 2023-11-15 at 7:33 AM, arashi_ said: A cooking challenge huh? More like "Die Hard 3" challenge My best posts list Recent post: Language Exchange Link to comment Share on other sites More sharing options...
Recommended Posts