2017年8月8日火曜日

学習環境

ラング線形代数学(上)(S.ラング (著)、芹沢 正三 (翻訳)、ちくま学芸文庫)の6章(行列式)、9(行列の逆転)、練習問題1.を取り組んでみる。


    1. Det( A ) =2( 3+1 )+4( 16 ) =828 =20 b 11 = ( 1 ) 2 | 3 1 1 1 | 20 = 3+1 20 = 1 5 b 21 = ( 1 ) 3 | 0 1 4 1 | 20 = 4 20 = 1 5 b 31 = ( 1 ) 4 | 0 3 4 1 | 20 = 12 20 = 3 5 b 12 = ( 1 ) 3 | 1 2 1 1 | 20 = 12 20 = 1 20 b 22 = ( 1 ) 4 | 2 2 4 1 | 20 = 28 20 = 3 10 b 32 = ( 1 ) 5 | 2 1 4 1 | 20 = 24 20 = 1 10 b 13 = ( 1 ) 4 | 1 2 3 1 | 20 = 16 20 = 7 20 b 23 = ( 1 ) 5 | 2 2 0 1 | 20 = 2 20 = 1 10 b 33 = ( 1 ) 6 | 2 1 0 3 | 20 = 6 20 = 3 10 B=( 1 5 1 20 7 20 1 5 3 10 1 10 3 5 1 10 3 10 )

    2. Det( ( 3 1 5 1 2 1 2 4 3 ) ) =3( 64 )+1( 3+2 )+5( 4+4 ) =61 =5 b 11 = | 2 1 4 3 | 5 = 64 5 = 2 5 b 12 = | 1 5 4 3 | 5 = ( 320 ) 5 = 23 5 b 13 = | 1 5 2 1 | 5 = 110 5 = 11 5 b 21 = | 1 1 2 3 | 5 = ( 3+2 ) 5 = 1 5 b 22 = | 3 5 2 3 | 5 = 9+10 5 = 19 5 b 23 = | 3 5 1 1 | 5 = ( 3+5 ) 5 = 8 5 b 31 = | 1 2 2 4 | 5 = 4+4 5 =0 b 32 = | 3 1 2 4 | 5 = ( 122 ) 5 =2 b 33 = | 3 1 1 2 | 5 = 61 5 =1 A 1 =( 2 5 23 5 11 5 1 5 19 5 8 5 0 2 1 )

    3. Det( A )=2( 3 )+1( 46 ) =62 =4 b 11 = | 3 0 2 1 | 4 = 3 4 b 12 = | 4 3 2 1 | 4 = 46 4 = 1 2 b 13 = | 4 3 3 0 | 4 = 9 4 b 21 = | 1 0 0 1 | 4 = 1 4 b 22 = | 2 3 0 1 | 4 = 1 2 b 23 = | 2 3 1 0 | 4 = 5 4 b 31 = | 1 3 0 2 | 4 = 1 2 b 32 = | 2 4 0 2 | 4 =1 b 33 = | 2 4 1 3 | 4 = 5 2 A 1 =( 3 4 1 2 9 4 1 4 1 2 5 4 1 2 1 5 2 )

    4. Det( ( 1 2 1 0 1 1 0 2 7 ) ) =72 =5 b 11 = | 1 1 2 7 | 5 =1 b 12 = | 2 1 2 7 | 5 = 16 5 b 13 = | 2 1 1 1 | 5 = 3 5 b 21 = | 0 1 0 7 | 5 =0 b 22 = | 1 1 0 7 | 5 = 7 5 b 23 = | 1 1 0 1 | 5 = 1 5 b 31 = | 0 1 0 2 | 5 =0 b 32 = | 1 2 0 2 | 5 = 2 5 b 33 = | 1 2 0 1 | 5 = 1 5 A 1 =( 1 16 5 3 5 0 7 5 1 5 0 2 5 1 5 )

    5. Det( ( 1 5 3 4 0 0 2 7 8 ) ) =4( 4021 ) =76 b 11 = | 0 0 7 8 | 76 =0 b 12 = | 5 3 7 8 | 76 = 4021 76 = 19 76 =4 b 13 = | 5 3 0 0 | 76 =0 b 21 = | 4 0 2 8 | 76 = 32 76 = 8 19 b 22 = | 1 3 2 8 | 76 = 86 76 = 14 76 = 7 38 b 23 = | 1 3 4 0 | 76 = 12 76 = 3 19 b 31 = | 4 0 2 7 | 76 = 28 76 = 7 19 b 32 = | 1 5 2 7 | 76 = 710 76 = 17 76 b 33 = | 1 5 4 0 | 76 = 20 76 = 5 19 A 1 =( 0 4 0 8 19 7 38 3 19 7 19 17 76 5 19 )

コード(Emacs)

Python 3

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from sympy import pprint, symbols, Matrix

print('1.')
ms = [Matrix([[2, 1, 2],
              [0, 3, -1],
              [4, 1, 1]]),
      Matrix([[3, -1, 5],
              [-1, 2, 1],
              [-2, 4, 3]]),
      Matrix([[2, 4, 3],
              [-1, 3, 0],
              [0, 2, 1]]),
      Matrix([[1, 2, -1],
              [0, 1, 1],
              [0, 2, 7]]),
      Matrix([[-1, 5, 3],
              [4, 0, 0],
              [2, 7, 8]])]

for i, m in enumerate(ms):
    print(f'({chr(ord("a") + i)})')
    pprint(m)
    pprint(m.inv())

入出力結果(Terminal, IPython)

$ ./sample1.py
1.
(a)
⎡2  1  2 ⎤
⎢        ⎥
⎢0  3  -1⎥
⎢        ⎥
⎣4  1  1 ⎦
⎡-1/5  -1/20  7/20 ⎤
⎢                  ⎥
⎢1/5   3/10   -1/10⎥
⎢                  ⎥
⎣3/5   -1/10  -3/10⎦
(b)
⎡3   -1  5⎤
⎢         ⎥
⎢-1  2   1⎥
⎢         ⎥
⎣-2  4   3⎦
⎡2/5  23/5  -11/5⎤
⎢                ⎥
⎢1/5  19/5  -8/5 ⎥
⎢                ⎥
⎣ 0    -2     1  ⎦
(c)
⎡2   4  3⎤
⎢        ⎥
⎢-1  3  0⎥
⎢        ⎥
⎣0   2  1⎦
⎡3/4   1/2  -9/4⎤
⎢               ⎥
⎢1/4   1/2  -3/4⎥
⎢               ⎥
⎣-1/2  -1   5/2 ⎦
(d)
⎡1  2  -1⎤
⎢        ⎥
⎢0  1  1 ⎥
⎢        ⎥
⎣0  2  7 ⎦
⎡1  -16/5  3/5 ⎤
⎢              ⎥
⎢0   7/5   -1/5⎥
⎢              ⎥
⎣0  -2/5   1/5 ⎦
(e)
⎡-1  5  3⎤
⎢        ⎥
⎢4   0  0⎥
⎢        ⎥
⎣2   7  8⎦
⎡  0    1/4     0  ⎤
⎢                  ⎥
⎢8/19   7/38  -3/19⎥
⎢                  ⎥
⎢       -17        ⎥
⎢-7/19  ────  5/19 ⎥
⎣        76        ⎦
$

0 コメント:

コメントを投稿