Hint
Start by filling the 9 gallon container, and then use that to fill the 4 gallon container.
Answer
Here are the contents of the containers after each stage:
A B
9 0 fill A
5 4 fill B from A
5 0 empty B
1 4 fill B from A
1 0 empty B
0 1 fill B from A
9 1 fill A
6 4 fill B from A
6 0 empty B
This leaves 6 gallons in container A.
?
Puzzle 20
Can you complete the fifth circle with the correct dots?
Reasoning
At each stage, a new dot starts at the top. The first dot moves clockwise, the second dot moves counter-clockwise, the third dot moves clockwise, etc.