2019年5月14日火曜日

学習環境

ラング線形代数学(上)(S.ラング (著)、芹沢 正三 (翻訳)、ちくま学芸文庫)の4章(線形写像と行列)、3(線形写像の合成)、練習問題3の解答を求めてみる。



    1. i d 1 , 1 , 0 = a 11 2 , 1 , 1 + a 21 0 , 0 , 1 + a 31 - 1 , 1 , 1 i d - 1 , 1 , 1 = a 12 2 , 1 , 1 + a 22 0 , 0 , 1 + a 32 - 1 , 1 , 1 i d 0 , 1 , 2 = a 13 2 , 1 , 1 + a 23 0 , 0 , 1 + a 33 - 1 , 1 , 1 2 a 11 - a 31 = 1 a 11 + a 31 = 1 a 11 + a 21 + a 31 = 0 a 11 = 2 3 a 31 = 1 - 2 3 = 1 3 a 21 = - 2 3 - 1 3 = - 1 2 a 12 - a 32 = - 1 a 12 + a 32 = 1 a 12 + a 22 + a 32 = 1 a 12 = 0 a 32 = 1 a 22 = 0 2 a 13 - a 33 = 0 a 13 + a 33 = 1 a 13 + a 23 + a 33 = 2 a 13 = 1 3 a 33 = 2 3 a 23 = 1

      よって、 求める問題の2つの基底と恒等を後に対応する行列は、

      M β β , i d = [ 2 3 0 1 3 - 1 0 1 1 3 1 2 3 ]

    2. a 11 - a 21 + 2 a 31 = 3 a 11 + 2 a 21 - a 31 = 2 4 a 21 + a 31 = 1 a 11 + 6 a 21 = 3 a 11 = 3 - 6 a 21 a 31 = 3 - 6 a 21 + 2 a 21 - 2 = 1 - 4 a 21 3 - 6 a 21 - a 21 + 2 - 8 a 21 = 3 a 21 = 2 15 a 11 = 3 - 6 · 2 15 = 33 15 a 31 = 1 - 8 15 = 7 15 a 12 - a 22 + 2 a 32 = 0 a 12 + 2 a 22 - a 32 = - 2 4 a 22 + a 32 = 5 a 12 + 6 a 22 = 3 a 12 = 3 - 6 a 22 3 - 6 a 22 - a 22 + 2 a 32 = 0 a 32 = 7 a 22 - 3 2 4 a 22 + 7 a 22 - 3 2 = 5 15 2 a 22 = 13 2 a 22 = 13 15 a 12 = 3 - 6 · 13 15 = - 33 15 a 32 = 7 · 13 15 - 3 2 = 23 15 a 13 - a 23 + 2 a 33 = 1 a 13 + 2 a 23 - a 33 = 1 4 a 23 + a 33 = 2 - 3 a 23 + 3 a 33 = 0 a 23 = a 33 a 33 = 2 5 a 13 - 2 5 + 4 5 = 1 a 13 = 3 5

      よって求める行列は、

      1 15 [ 33 - 33 9 2 13 6 7 23 6 ]

コード

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, Matrix, solve


print('3.')

t = [(Matrix([[1, -1, 0],
              [1, 1, 1],
              [0, 1, 2]]),
      Matrix([[2, 0, -1],
              [1, 0, 1],
              [1, 1, 1]])),
     (Matrix([[3, 0, 1],
              [2, -2, 1],
              [1, 5, 2]]),
      Matrix([[1, -1, 2],
              [1, 2, -1],
              [0, 4, 1]]))]

X = Matrix([[symbols(f'a{i + 1}{j + 1}') for j in range(3)]
            for i in range(3)])

for i, (A, B) in enumerate(t):
    print(f'({chr(ord("a") + i)})')
    pprint(solve(B * X - A))
    print()

入出力結果(cmd(コマンドプロンプト)、Terminal、Jupyter(IPython))

C:\Users\...>py sample3.py
3.
(a)
{a₁₁: 2/3, a₁₂: 0, a₁₃: 1/3, a₂₁: -1, a₂₂: 0, a₂₃: 1, a₃₁: 1/3, a₃₂: 1, a₃₃: 2
/3}

(b)
⎧                                                 13                          
⎨a₁₁: 11/5, a₁₂: -11/5, a₁₃: 3/5, a₂₁: 2/15, a₂₂: ──, a₂₃: 2/5, a₃₁: 7/15, a₃₂
⎩                                                 15                          

  23          ⎫
: ──, a₃₃: 2/5⎬
  15          ⎭


C:\Users\...>

0 コメント:

コメントを投稿