練習問題 メモ 4#
4.1#
次の1~3の行列の階数標準形および階数(rank)を求めよ
1.#
\(\left(\begin{array}{ll}1 & 2 \\ 3 & 4 \\ 5 & 6\end{array}\right)\)
行ベクトルを
\[\begin{split}
\begin{pmatrix}
a_1 \\
a_2 \\
a_3
\end{pmatrix}
\end{split}\]
とする
\(a_2' = a_2 + (-2) \times a_1\)
import numpy as np
A = np.array([
[1, 2],
[3, 4],
[5, 6],
])
# 1行目を-2倍して2行目に加える
A[1, :] += A[0, :] * (-2)
A
array([[1, 2],
[1, 0],
[5, 6]])
# 1行目を-3倍して3行目に加える
A[2, :] += A[0, :] * (-3)
A
array([[1, 2],
[1, 0],
[2, 0]])
# 3行目を(1/2)倍する
A[2, :] = (1 / 2) * A[2, :]
A
array([[1, 2],
[1, 0],
[1, 0]])
# 2行目を-1倍して3行目に加える
A[2, :] += A[1, :] * (-1)
A
array([[1, 2],
[1, 0],
[0, 0]])
# 2行目を-1倍して1行目に加える
A[0, :] += A[1, :] * (-1)
A
array([[0, 2],
[1, 0],
[0, 0]])
# 1行目を(1/2)倍する
A[0, :] = (1 / 2) * A[0, :]
A
array([[0, 1],
[1, 0],
[0, 0]])
# 1行目と2行目を入れ替える
a1 = A[0, :].copy()
a2 = A[1, :].copy()
A[0, :] = a2
A[1, :] = a1
A
array([[1, 0],
[0, 1],
[0, 0]])
2.#
\[\begin{split} \left(\begin{array}{lll}0 & 1 & 0 \\ 1 & 0 & 1 \\ 0 & 1 & 0\end{array}\right) \end{split}\]
import numpy as np
A = np.array([
[0, 1, 0],
[1, 0, 1],
[0, 1, 0],
])
# 1行目を-1倍して3行目に加える
A[2, :] += (-1) * A[0, :]
A
array([[0, 1, 0],
[1, 0, 1],
[0, 0, 0]])
# 0列目を-1倍して3列目に加える
A[:, 2] += (-1) * A[:, 0]
A
array([[0, 1, 0],
[1, 0, 0],
[0, 0, 0]])
# 1行目と2行目を入れ替える
a1 = A[0, :].copy()
a2 = A[1, :].copy()
A[0, :] = a2
A[1, :] = a1
A
array([[1, 0, 0],
[0, 1, 0],
[0, 0, 0]])
3.#
\[\begin{split} \left(\begin{array}{lll}a & 1 & 1 \\ 1 & a & 1 \\ 1 & 1 & a\end{array}\right) \end{split}\]
わからなかった
from sympy import Symbol, Matrix
a = Symbol("a")
A = Matrix([
[a, 1, 1],
[1, a, 1],
[1, 1, a],
])
A
\[\begin{split}\displaystyle \left[\begin{matrix}a & 1 & 1\\1 & a & 1\\1 & 1 & a\end{matrix}\right]\end{split}\]
# 1行目と2行目を入れ替える
a1 = A[0, :].copy()
a2 = A[1, :].copy()
A[0, :] = a2
A[1, :] = a1
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & a & 1\\a & 1 & 1\\1 & 1 & a\end{matrix}\right]\end{split}\]
A[1, :] += -a * A[0, :]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & a & 1\\0 & 1 - a^{2} & 1 - a\\1 & 1 & a\end{matrix}\right]\end{split}\]
A[2, :] += -1 * A[0, :]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & a & 1\\0 & 1 - a^{2} & 1 - a\\0 & 1 - a & a - 1\end{matrix}\right]\end{split}\]
未知の変数があって最終的なランクが変わりうる → 場合分けする
もし\(a=1\)なら
\[\begin{split}
\begin{pmatrix}
1 & a & 1\\
0 & 1 - a^{2} & 1 - a\\
0 & 1 - a & a - 1
\end{pmatrix}
=
\begin{pmatrix}
1 & 1 & 1\\
0 & 1 - 1^{2} & 1 - 1\\
0 & 1 - 1 & 1 - 1
\end{pmatrix}
=
\begin{pmatrix}
1 & 1 & 1\\
0 & 0 & 0\\
0 & 0 & 0
\end{pmatrix}
\end{split}\]
列基本変形(列で引き算)して
\[\begin{split}
\begin{pmatrix}
1 & 0 & 0\\
0 & 0 & 0\\
0 & 0 & 0
\end{pmatrix}
\end{split}\]
→ rank=1
もし\(a \neq 1\)なら
\[\begin{split}
\begin{pmatrix}
1 & a & 1\\
0 & 1 - a^{2} & 1 - a\\
0 & 1 - a & a - 1
\end{pmatrix}
\end{split}\]
A[:, 2] += 1 * A[:, 1]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & a & a + 1\\0 & 1 - a^{2} & - a^{2} - a + 2\\0 & 1 - a & 0\end{matrix}\right]\end{split}\]
A[:, 1] += -1 * A[:, 2]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & -1 & a + 1\\0 & a - 1 & - a^{2} - a + 2\\0 & 1 - a & 0\end{matrix}\right]\end{split}\]
A[1, :] += A[2, :]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & -1 & a + 1\\0 & 0 & - a^{2} - a + 2\\0 & 1 - a & 0\end{matrix}\right]\end{split}\]
a1 = A[1, :].copy()
a2 = A[2, :].copy()
A[1, :] = a2
A[2, :] = a1
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & -1 & a + 1\\0 & 1 - a & 0\\0 & 0 & - a^{2} - a + 2\end{matrix}\right]\end{split}\]
A[1, :] += A[2, :]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & -1 & a + 1\\0 & 1 - a & - a^{2} - a + 2\\0 & 0 & - a^{2} - a + 2\end{matrix}\right]\end{split}\]
A[:, 2] += 1 * A[:, 1]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & -1 & a\\0 & 1 - a & - a^{2} - 2 a + 3\\0 & 0 & - a^{2} - a + 2\end{matrix}\right]\end{split}\]
A[:, 1] += -a * A[:, 0]
A[:, 2] += -1 * A[:, 0]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & - a - 1 & a - 1\\0 & 1 - a & - a^{2} - 2 a + 3\\0 & 0 & - a^{2} - a + 2\end{matrix}\right]\end{split}\]
A[1, :] += -1 * A[2, :]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & - a - 1 & a - 1\\0 & 1 - a & 1 - a\\0 & 0 & - a^{2} - a + 2\end{matrix}\right]\end{split}\]
A[1, :] = (1/a) * A[1, :]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & - a - 1 & a - 1\\0 & \frac{1 - a}{a} & \frac{1 - a}{a}\\0 & 0 & - a^{2} - a + 2\end{matrix}\right]\end{split}\]
A[1, 1] = -a + 1
A[1, 2] = (2/a) - 2
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & - a - 1 & a - 1\\0 & 1 - a & -2 + \frac{2}{a}\\0 & 0 & - a^{2} - a + 2\end{matrix}\right]\end{split}\]
A[2, :] - A[1, :]
\[\displaystyle \left[\begin{matrix}0 & a - 1 & - a^{2} - a + 4 - \frac{2}{a}\end{matrix}\right]\]
A[:, 1] += 1 * A[:, 2]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & -2 & a - 1\\0 & - a - 1 + \frac{2}{a} & -2 + \frac{2}{a}\\0 & - a^{2} - a + 2 & - a^{2} - a + 2\end{matrix}\right]\end{split}\]
A[2, :] += -((1-a)/(1-a**2)) * A[1, :]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & -2 & a - 1\\0 & - a - 1 + \frac{2}{a} & -2 + \frac{2}{a}\\0 & - a^{2} - a - \frac{\left(1 - a\right) \left(- a - 1 + \frac{2}{a}\right)}{1 - a^{2}} + 2 & - a^{2} - a - \frac{\left(-2 + \frac{2}{a}\right) \left(1 - a\right)}{1 - a^{2}} + 2\end{matrix}\right]\end{split}\]
A[2, :] = (1+a)/((-1+a)*(2+a)) * A[2, :]
A
\[\begin{split}\displaystyle \left[\begin{matrix}1 & -2 & a - 1\\0 & - a - 1 + \frac{2}{a} & -2 + \frac{2}{a}\\0 & \frac{\left(a + 1\right) \left(- a^{2} - a - \frac{\left(1 - a\right) \left(- a - 1 + \frac{2}{a}\right)}{1 - a^{2}} + 2\right)}{\left(a - 1\right) \left(a + 2\right)} & \frac{\left(a + 1\right) \left(- a^{2} - a - \frac{\left(-2 + \frac{2}{a}\right) \left(1 - a\right)}{1 - a^{2}} + 2\right)}{\left(a - 1\right) \left(a + 2\right)}\end{matrix}\right]\end{split}\]
Matrix([
[1, 0, 1+a],
[0 ,1, -1],
[0, 0, 2+a]
])
\[\begin{split}\displaystyle \left[\begin{matrix}1 & 0 & a + 1\\0 & 1 & -1\\0 & 0 & a + 2\end{matrix}\right]\end{split}\]
\(a = -2\)のとき
\(a \neq -2\)のとき
4.2#
次の問に答えよ。
2次の正方行列に対する階数標準形をすべて書け
\[\begin{split}
\begin{pmatrix}
0 & 0 \\
0 & 0 \\
\end{pmatrix}
= O_2
, \hspace{1em}
\begin{pmatrix}
1 & 0 \\
0 & 0 \\
\end{pmatrix}
, \hspace{1em}
\begin{pmatrix}
1 & 0 \\
0 & 1 \\
\end{pmatrix}
= E_2
\end{split}\]
2次の正方行列に対する階段行列をすべて書け。なお、任意の数は*を用いて表せ。
\(* = 0\)の状況も考えて1とおくと
\[\begin{split}
\begin{pmatrix}
0 & 0 \\
0 & 0 \\
\end{pmatrix}
, \hspace{1em}
\begin{pmatrix}
1 & * \\
0 & 0 \\
\end{pmatrix}
, \hspace{1em}
\begin{pmatrix}
1 & *\\
0 & 1 \\
\end{pmatrix}
\end{split}\]