227k views
0 votes
We have three containers whose sizes are 10 pints, 7 pints, and 4 pints, respectively. The 7-pint and 4-pint containers start out full of water, but the 10-pint container is initially empty. - We are allowed one type of operation: pouring the contents of one container into another, stopping only when the source container is empty or the destination container is full. - We want to know if there is a sequence of pourings that leaves exactly 2 pints in the 7- or 4-pint container.

User Doblak
by
5.5k points

2 Answers

7 votes

Answer:

Yes, there is a sequence, and at the end of the sequence the following arrangement will be in each container;

10-pint container will contain 2 pints of water

7-pint container will contain 7 pints of water

4-pint container will contain 2 pints of water

Step-by-step explanation:

The 7- and 4-pint containers are full, while the 10-pint container is initially full.

The following steps are followed;

1. pour the content of the 7-pint container into the 10-pint container, and pour 3-pint of water from the 4-pint container to fill up the 10-pint container, leaving the following in the three containers

10-pint container will contain 10 pints of water

7-pint container will contain 0 pints of water

4-pint container will contain 1 pints of water

2. Next, pour the 1 pint of water from the 4-pint container into the 7-pint container, and in turn pour from the 10-pint container into the 4-pint container until it is full, leaving the following in the three containers;

10-pint container will contain 6 pints of water

7-pint container will contain 1 pints of water

4-pint container will contain 4 pints of water

3. next, pour all the content of the 4-pint container into the 7-pint container, and refill the 4-pint container by pouring into it from the 10-pint container, leaving the following in the 3 containers;

10-pint container will contain 2 pints of water

7-pint container will contain 5 pints of water

4-pint container will contain 4 pints of water

4, Finally, pour from the 4-pint container into the 7-pint container until it is full, leaving the following in the 3 containers;

10-pint container will contain 2 pints of water

7-pint container will contain 7 pints of water

4-pint container will contain 2 pints of water.

There you go, this sequence leaves 2-pint of water in the 4-pint container.

User Kakyo
by
6.0k points
3 votes

Answer:

Here’s a way to solve this:

(7/7,4/4,0/10) Æ (7/7, 0/4, 4/10) Æ(1/7, 0/4, 10/10) Æ (1/7, 4/4, 6/10), (5/7, 0/4, 6/10) Æ

(5/7, 4/4, 2/10) Æ (7/7, 2/4, 2/10), hence we end up with 2 pints in the 4‐pint container .

To model this as a graph problem, we represent each potential state of the three containers with an ordered pair (A,B), where A represents the amount of water in the 7‐pint container and B represents the amount of water in the 4‐pint container.

Hence the initial state would be(7,4). Note that we do not need an ordered triple as we know the total amount of water in all three containers (11 pints). Therefore, the total state is completely determined by water in the 7 and 4 pint containers.

Hence, we have 5 x 8 = 40 possible states for the system. We model these states as nodes in a directed graph and draw an edge from one node to another node if we can go from the configuration represented by one node to the configuration represented by another node through one pour.

For example, there would be an edge from (7,4) to (0,4) but no edge from (1,3) to (5,1).

Thus, if we can find a path from one node to another, then we can go from one state to another

through a series of pourings. The nodes are represented in the attached file (the edges are left out).

Step-by-step explanation:

Since we want to find a path from (7,4) to one of the nodes contained in one of the rectangles. Our solution above is depicted in the attached file

Looking at the graph in attachment, we will start at node (7,4) and run DFS to see if we can reach one of the nodes boxed by a rectangle (i.e. has 2 as one of the coordinates). If we can, then there is a solution.

Otherwise, there is no way to have two liters in one of the containers through a series of pouring from

the original state of (7/7,4/4,0/10).

We have three containers whose sizes are 10 pints, 7 pints, and 4 pints, respectively-example-1
User Snowcore
by
5.8k points