Question text is in black, my answers in blue.
You could do that, or you could simulate the seasons by hand. In the latter case you might get your random bits from a physical source like coins, cards, dice, or a stopwatch. Or you might just read the random bits off of some generator. The program has the advantage that you could simulate 1000 seasons as easily as 10, but I only asked for 10.
You don't need to keep track of the amount of water in the source or in the drain, just in the two vessels. Since these two amounts must be integers in a limited range, there are only finitely many states. There will be cycles, which are sequences of actions that return you to the same position, but they don't matter for finding the shortest path. Once you find a short path, you only care about making sure there is no shorter one, by checking all the shorter ones -- you may well find the shortest path to your goal without checking all the states.
Right, the problem as stated is incorrect and I will fix it on the assignment page. There is still a steady state distribution for the Markov chain made from any connected undirected graph in this way, but as you have shown this distribution is not always attracting because the chain may be periodic. In fact the steady state is attracting if and only if there is an odd cycle in the graph -- a path from some vertex v to itself that never revisits any other vertex and has an odd number of edges. I'll put the revised question on the assignment page.
Last modified 23 November 2009