学習環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro + Apple Pencil
- MyScript Nebo(iPad アプリ)
- 参考書籍
数学読本〈5〉微分法の応用/積分法/積分法の応用/行列と行列式(松坂 和夫(著)、岩波書店)の第21章(もう1つの数学の基盤 - 行列と行列式)、21.1(行列とその演算)、行列の乗法の性質(1)、問11.を取り組んでみる。
コード(Emacs)
Python 3
#!/usr/bin/env python3
from sympy import pprint, Matrix
print('問11')
ts = [([[2, 1],
[1, 3]],
[[3, 4],
[-2, 1]],
[[3, -2],
[0, 1]]),
([[1, 2, 3],
[4, 5, 6]],
[[1, 1],
[-2, 0],
[3, -1]],
[[1, 2],
[3, 4]]),
([[2, -4, 1],
[3, 0, -1]],
[[1, 1, 0],
[2, -1, 1],
[3, 1, 5]],
[[-1],
[3],
[1]])]
for i, t in enumerate(ts, 1):
print(f'({i})')
A, B, C = [Matrix(t0) for t0 in t]
for s in [A, B, C, (A * B) * C == A * (B * C)]:
pprint(s)
print()
print()
入出力結果(Terminal, Jupyter(IPython))
$ ./sample11.py 問11 (1) ⎡2 1⎤ ⎢ ⎥ ⎣1 3⎦ ⎡3 4⎤ ⎢ ⎥ ⎣-2 1⎦ ⎡3 -2⎤ ⎢ ⎥ ⎣0 1 ⎦ True (2) ⎡1 2 3⎤ ⎢ ⎥ ⎣4 5 6⎦ ⎡1 1 ⎤ ⎢ ⎥ ⎢-2 0 ⎥ ⎢ ⎥ ⎣3 -1⎦ ⎡1 2⎤ ⎢ ⎥ ⎣3 4⎦ True (3) ⎡2 -4 1 ⎤ ⎢ ⎥ ⎣3 0 -1⎦ ⎡1 1 0⎤ ⎢ ⎥ ⎢2 -1 1⎥ ⎢ ⎥ ⎣3 1 5⎦ ⎡-1⎤ ⎢ ⎥ ⎢3 ⎥ ⎢ ⎥ ⎣1 ⎦ True $
0 コメント:
コメントを投稿