Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

You are given three water jugs. The first one can contain 4L of water and is ini

ID: 3911496 • Letter: Y

Question

You are given three water jugs. The first one can contain 4L of water and is initially full, the second one can contain 7L and is also initially full, and the third one contains up to 10L of water but is initially empty. You can move the water between the jugs by pouring from one to the other until either (a) the jug being filled becomes completely full, or (b) the jug you are pouring from becomes empty. Can you pour the water between the containers in a way that you end up with exactly 2L of water in the first container? (i) Model the question above as a graph problem. Your answer should include a specific directed graph, a description of what the vertices and the edges of your graph represent, and the problem that you want to solve on this graph to get the answer to the original question, as well as the answer itself. ii) What graph algorithm lets you determine not just whether it is possible to end up with 2L of water in the first container, but the minimum number of pours needed to end up in this state (if it is reachable)? (ili) Let's say each jug pours IL of water per minute and we now want to know how quickly we can end up with 2L of water in the first container (if that is possible), how do we need to modify our graph representation and what algorithm do we want to run on the graph to solve this problem?

Explanation / Answer

a)refil(Size,_,_,Size),

refil(FirstSize.SecondSize.ThirdSize,Goal)

move(FirstSize,SecondSize,ThirdSize,FirstSize,0,0,Goal),

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote