From 6e725459fc0408e15372db6e436a8d11e64ca084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kn=C3=BCttel?= Date: Wed, 23 Jan 2019 16:46:26 +0100 Subject: [PATCH] fixed matrix power --- ex_43.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ex_43.py b/ex_43.py index 2c7f569..d64cbb1 100644 --- a/ex_43.py +++ b/ex_43.py @@ -10,6 +10,6 @@ P = np.array( print(P.shape) v = np.array([0, 1, 0, 0, 0, 0]) -w = np.power(np.dot(P**4, v), 1/4) +w = np.dot(np.linalg.matrix_power(P, 4), v) print(w) print(w[-1])