Dynamic programming, Markov chains, and the method of successive approximations