solve_bellman_equation modified to return the transition matrix.