You are given two (unmarked) containers of capacity 9 and 4 L and a huge tank of water. Need is to get a measure of exactly 6 L of water. A move is either filling a container completely or emptying a container (either fully or partically). The smallest number of moves needed to do this task is
Explanation
To find the minimum number of moves, we need to track the state of both containers: the 9 L container and the 4 L container. We aim to reach a state where one container holds exactly 6 L.
Initial State: (0,0)
| Move # |
Action |
9 L Container |
4 L Container |
| 1 |
Fill the 9 L container |
9 L |
0 L |
| 2 |
Pour from 9 L to 4 L |
5 L |
4 L |
| 3 |
Empty the 4 L container |
5 L |
0 L |
| 4 |
Pour from 9 L to 4 L |
1 L |
4 L |
| 5 |
Empty the 4 L container |
1 L |
0 L |
| 6 |
Pour from 9 L to 4 L |
0 L |
1 L |
| 7 |
Fill the 9 L container |
9 L |
1 L |
| 8 |
Pour from 9 L to 4 L (filling it) |
6 L |
4 L |
Explanation of the final move:
The 4 L container already had 1 L. To fill it, we need exactly 3 L more. We pour that 3 L from the 9 L container.
Remaining in 9 L container: 9−3=6 L.
The task is completed in exactly 8 moves.
Final Answer:
The smallest number of moves needed is 8.
The correct option is (a).