学習環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
- Windows 10 Pro (OS)
- 数式入力ソフト(TeX, MathML): MathType
- MathML対応ブラウザ: Firefox、Safari
- MathML非対応ブラウザ(Internet Explorer, Microsoft Edge, Google Chrome...)用JavaScript Library: MathJax
- 参考書籍
ラング線形代数学(上)(S.ラング (著)、芹沢 正三 (翻訳)、ちくま学芸文庫)の1章(R^n におけるベクトル)、3(スカラー積)、練習問題8.を取り組んでみる。
コード(Emacs)
Python 3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from sympy import pprint, symbols, Matrix, ZeroMatrix
import random
A = Matrix([0 for _ in range(10)])
pprint(A.T)
for _ in range(10):
X = Matrix([random.randrange(10) for _ in range(10)])
pprint(X.T)
x = A.dot(X)
print(x)
print(x == 0)
入出力結果(Terminal, Jupyter(IPython))
$ ./sample8.py [0 0 0 0 0 0 0 0 0 0] [0 0 8 4 7 7 9 2 9 7] 0 True [9 5 5 6 5 8 9 9 6 8] 0 True [7 0 4 5 7 6 4 2 3 7] 0 True [6 2 3 4 6 6 6 1 6 6] 0 True [4 8 6 5 5 6 3 0 7 0] 0 True [5 0 2 6 1 3 2 9 9 3] 0 True [3 7 9 1 6 1 5 0 5 8] 0 True [1 9 2 0 0 5 3 1 9 4] 0 True [6 0 7 8 5 2 1 4 6 7] 0 True [4 3 9 5 5 5 2 9 5 7] 0 True $
0 コメント:
コメントを投稿