<jupyter_start><jupyter_text>Exercise 3.17from <NAME>'s book<jupyter_code>import numpy as np
from numpy.linalg import matrix_power as mp

P=np.array([
    [0.5, 0.5],
    [0.0, 1.0]
])
mp(P,1000)
series_sum = 0
for i in range(1001):
    series_sum+=mp(P,i)
series_sum<jupyter_output><empty_output>