Given a markovchain object and reward values for every state, function calculates expected reward value after n steps.
expectedRewards(markovchain,n,rewards)
returns a vector of expected rewards for different initial states
the function uses a dynamic programming approach to solve a recursive equation described in reference.
Stochastic Processes: Theory for Applications, Robert G. Gallager, Cambridge University Press