(C) 2017-2024 by Damir Cavar
Download: This and various other Jupyter notebooks are available from my GitHub repo.
Version: 1.2, September 2024
Prerequisites:
!pip install -U numpy
import numpy as np
a = np.array([[1, 1, 0],
[1, 0, 0],
[0, 0, 0]])
a
array([[1, 1, 0], [1, 0, 0], [0, 0, 0]])
b = np.array([[0, 1, 0],
[0, 1, 0],
[0, 0, 0]])
c = np.array([[0, 0, 0],
[0, 0, 1],
[0, 0, 0]])
init = np.array([1, 0, 0])
init
array([1, 0, 0])
final = np.array([[0],
[0],
[1]])
final
array([[0], [0], [1]])
init.dot(a.dot(b.dot(c))).dot(final)
array([2])
init.dot(a.dot(a.dot(c.dot(c)))).dot(final)
array([0])