In: Computer Science
Searching Question:
We have three unmarked jugs, which hold exactly 19, 13 and 7 ounces of water respectively. The 19-ounce jug is empty, but the 13 and 7 ounces jugs are full (thus, there is a total of 20 ounces of water). You need to get exactly two 10 ounces of water (in the first two jugs) by using only the three jugs mentioned above. The cost of each action is the ounce of water poured/moved.
A. How do you represent states? (5 points)
B. What are the initial state(s) and the goal state(s) in your representation? (5 points)
A.
The following would be the procedure in chart form:
19Ounces 13Ounces 7Ounces
0 13 7 //Initial State
Step 1 7 13 0
Step 2 19 1 0
Step 3 12 1 7
Step4 12 8 0
Step 5 5 8 7
Step 6 5 13 2
Step 7 18 0 2
Step 8 18 2 0
Step 9 11 2 7
Step 10 11 9 0
Step 11 4 9 7
Step 12 4 13 3
Step 13 17 0 3
Step 14 17 3 0
Step 15 10 3 7 //goal state
B.
here initial state is the state from where we started which is 0,13,7 because The 19-ounce jug is empty, but the 13 and 7 ounces jugs are full (thus, there is a total of 20 ounces of water) as mentioned in question
and goal state is the final stateofthese jugs which is 10,3,7 , here the goal is to You need to get exactly two 10 ounces of water (in the first two jugs) by using only the three jugs mentioned above.
A.