def trueValues(T, R, discountFactor):
 assert (discountFactor < 1)
 distr = T.copy()
 res = dot(T, R)
 for i in range(1, int((10 / (1.0 - discountFactor)))):
  distr = dot(distr, T)
  res += ((discountFactor ** i) * dot(distr, R))
 return res

def trueValues ( T , R , discountFactor ) : assert ( discountFactor < 1 ) distr = T . copy ( ) res = dot ( T , R ) for i in range ( 1 , int ( ( 10 / ( 1.0 - discountFactor ) ) ) ) : distr = dot ( distr , T ) res += ( ( discountFactor ** i ) * dot ( distr , R ) ) return res
compute the true discounted value function for each state .