The process you undergo to measure out the desired amount (3 oz.) is done by filling the smaller container (16 oz.), dumping as much as possible into the larger container, and repeating until the larger container is full. When the larger container is full, dump it out and repeat. After the smaller container has been filled 8 times and the larger container has been emptied 5 times, you will be left with 3 oz. in the smaller container. Consider the following sequence of steps (x, y), where x represents the amount in the 16 oz. container, and y represents the amount in the 25 oz. container.
$(0,0) \rightarrow (16,0) \rightarrow (0, 16) \rightarrow (16, 16) \rightarrow (7, 25)$
At this point we dump the larger container.
$(7, 0) \rightarrow (0, 7) \rightarrow (16,7) \rightarrow (0, 23) \rightarrow (16, 23) \rightarrow (14, 25)$
Again we dump the larger container.
$(14,0) \rightarrow (0, 14) \rightarrow (16, 14) \rightarrow (5, 25)$
Dump the larger container.
$(5, 0) \rightarrow (0,5) \rightarrow (16, 5) \rightarrow (0, 21) \rightarrow (16,21) \rightarrow (12, 25)$
You know the drill by now.
$(12,0) \rightarrow (0,12) \rightarrow (16, 12) \rightarrow (3, 25)$
Dump the larger container, and you are left with $(3,0)$.