You have 2 water bottles, a 5l bottle and a 3l bottle.
- If the bottle is empty, You can fill it up fully at the tap.
- If the bottle is full, You can empty the bottle.
- You can transfer the content of one bottle to the other. Ex: if the 5l bottle has 3l of water and you put water from 5l bottle in the 3ml bottle, You will end up with 5l in the biggest and 1l in the smallest.
- All bottles are empty.
- Your goal is to obtain exactly 4l in the biggest bottle.
2026-04-05 09:33:09.1775381589
How to draw a graph that represent this problem? Using a $5$-liter bottle and a $3$-liter bottle to arrive at exactly $4$ liters of water.
183 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
3

Here is the graph representing the states of the puzzle and the possible ways we can get from one state to another.
A node labeled $(a,b)$ corresponds to a state where the $5$-liter bottle contains $a$ liters and the $3$-liter bottle contains $b$ liters. There are two kinds of edges:
This distinction is just to make the graph easier to read, avoiding too many arrows.