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 15
Below you will find 15 well-known five-letter words, with only their endings remaining.
Can you find the words? --lta--yss--pty--dth--day--ybe--dex--fth--nda--aph--alp--era--njo--eue--xty
Answer
I asked for 7 feet, 4 inches and Alex brought me 4 feet, 7 inches.
Reasoning
If we label what I asked for as A feet and B inches, which is (12 x A + B) inches, then I actually received B feet and A inches, which is (12 x B + A) inches. Which means that:
5/8 x (12 x A + B) = (12 x B + A)
Simplifying gives:
A = 91/52 x B
As B is the number of inches, it can only be between 1 and 12 and must give A as a whole number of feet.
B = 4 is the only possible value, which means that A = 7.
So I originally asked for 7 feet, 4 inches.
Double-Checking
I received 4 feet, 7 inches = 55 inches.
I asked for 7 feet, 4 inches = 88 inches, and 88 x 5/8 = 55.