Use a depth-first search in the previous example to show that any amount between 0 and 10 quarts can be obtained in one of the pitchers.


Answered 1 year ago
Answered 1 year ago
Step 1
1 of 4

In the example we study the following problem: we have three pitchers of water of sizes 1010 quarts, 77 quarts and 44 quarts. At the beginning, the first pitcher is full of water, while the other two are empty. We can pour water from one pitcher into the other until the first pitcher is empty or the second is full. We can memorize the current amounts of water in each pitcher as an ordered triple (a,b,c)(a,b,c). Then at the beginning we have that (a,b,c)=(10,0,0)(a,b,c)=(10,0,0).

Create an account to view solutions

Create an account to view solutions

More related questions