このページでは、2×2、3×3、4×4などの次元の行列を乗算する方法を見ていきます。行列の乗算の手順を例を使って段階的に説明し、解決済みの練習問題も用意されているので、練習することもできます。最後に、2 つの行列を乗算できない場合と、この行列演算のすべてのプロパティを学習します。
2 つの行列を乗算するにはどうすればよいですか?
例を使用して 2 つの行列の乗算を実行する手順を見てみましょう。

行列の乗算を計算するには、左側の行列の行を右側の行列の列で乗算する必要があります。
したがって、最初に最初の行と最初の列を乗算する必要があります。これを行うには、最初の行の各要素と最初の列の各要素を 1 つずつ乗算し、結果を加算します。したがって、これらすべてが結果の配列の最初の行の最初の要素になります。手順を見てください。

1 ⋅ 3 + 2 ⋅ 4 = 3 + 8 = 11。つまり、次のようになります。
次に、最初の行と 2 番目の列を乗算する必要があります。したがって、この手順を繰り返します。最初の行の各要素と 2 番目の列の各要素を 1 つずつ乗算し、その結果を加算します。これらはすべて、結果の配列の最初の行の 2 番目の要素になります。
1 ⋅ 5 + 2 ⋅ 1 = 5 + 2 = 7。つまり、次のようになります。
結果の行列の最初の行を埋めたら、2 番目の行に移動します。したがって、次の手順を繰り返して、2 行目と1 列目を乗算します。2 行目の各要素と 1 列目の各要素を 1 つずつ乗算し、その結果を加算します。
-3 ⋅ 3 + 0 ⋅ 4 = -9 + 0 = -9。まだ:
最後に、 2 番目の行と 2 番目の列を乗算します。常に同じ手順で、2 行目の各要素と 2 列目の各要素を 1 つずつ乗算し、その結果を加算します。
-3 ⋅ 5 + 0 ⋅ 1 = -15 + 0 = -15。まだ:
そしてここで 2 つの行列の乗算が終了します。これまで見てきたように、行と列を乗算する必要があります。常に同じ手順を繰り返す必要があります。行の各要素と列の各要素を 1 つずつ乗算し、その結果を加算します。
行列乗算の演習を解決しました
演習 1
次の行列積を解きます。

これは次数 2 の行列の積です。
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 1 & 2 \\[1.1ex] 3 & 4 \end{pmatrix} \cdot \begin{pmatrix} 3 & -2 \\[1.1ex] 1 & 5 \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-747926b92c1d388c1150613b0f471d7e_l3.png)
行列の積を解くには、左の行列の行と右の行列の列を乗算する必要があります。
したがって、最初に最初の行と最初の列を乗算します。これを行うには、最初の行の各要素と最初の列の各要素を 1 つずつ乗算し、結果を加算します。これらはすべて、結果の配列の最初の行の最初の要素になります。
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 1 & 2 \\[1.1ex] 3 & 4 \end{pmatrix} \cdot \begin{pmatrix} 3 & -2 \\[1.1ex] 1 & 5 \end{pmatrix} = \begin{pmatrix} 1\cdot 3 +2 \cdot 1 & \\[1.1ex] & \end{pmatrix} = \begin{pmatrix} 5 & \\[1.1ex] & \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-eff23eaf91738d6ffb383949e4b70856_l3.png)
次に、最初の行と 2 番目の列を乗算して、結果の行列の最初の行の 2 番目の要素を取得しましょう。
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 1 & 2 \\[1.1ex] 3 & 4 \end{pmatrix} \cdot \begin{pmatrix} 3 & -2 \\[1.1ex] 1 & 5 \end{pmatrix} = \begin{pmatrix} -1 & 1\cdot (-2) +2 \cdot 5 \\[1.1ex] & \end{pmatrix} = \begin{pmatrix}5 & 8 \\[1.1ex] & \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-558838bcc38efc1aeeaf298d3e7151dc_l3.png)
2 行目に移動するので、 2 行目に最初の列を乗算します。
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 1 & 2 \\[1.1ex] 3 & 4 \end{pmatrix} \cdot \begin{pmatrix} 3 & -2 \\[1.1ex] 1 & 5 \end{pmatrix} = \begin{pmatrix} -1 & 8 \\[1.1ex] 3\cdot 3 +4 \cdot 1 & \end{pmatrix}= \begin{pmatrix}5 & 8 \\[1.1ex] 13 & \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-daab54a49cc53c320bb2965f691fd7ed_l3.png)
最後に、 2 番目の行と 2 番目の列を乗算して、テーブルの最後の要素を計算します。
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 1 & 2 \\[1.1ex] 3 & 4 \end{pmatrix} \cdot \begin{pmatrix} 3 & -2 \\[1.1ex] 1 & 5 \end{pmatrix}= \begin{pmatrix} -1 & 8 \\[1.1ex]1 & 3\cdot (-2) +4 \cdot 5 \end{pmatrix}=\begin{pmatrix} 5 & 8 \\[1.1ex] 13 & 14 \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-a85e0d62a0db18c7712fd1b354f92bd5_l3.png)
したがって、行列乗算の結果は次のようになります。
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} \bm{5} & \bm{8} \\[1.1ex]\bm{13} & \bm{14} \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-76f1283db0175bc1a95b0a10c8961761_l3.png)
演習 2
次の 2×2 正方行列の乗算の結果を求めます。

これは 2×2 次元の行列の積です。
乗算を解くには、左の行列の行と右の行列の列を乗算する必要があります。
![Rendered by QuickLaTeX.com \displaystyle \begin{aligned} \begin{pmatrix} 4 & -1 \\[1.1ex] -2 & 3 \end{pmatrix} \cdot \begin{pmatrix} -2 & 5 \\[1.1ex] 6 & -3 \end{pmatrix} & = \begin{pmatrix} 4\cdot (-2)+(-1) \cdot 6 & 4\cdot 5+(-1) \cdot (-3) \\[1.1ex](-2)\cdot (-2)+3 \cdot 6 & (-2)\cdot 5+3 \cdot (-3)\end{pmatrix} \\[2ex] & =\begin{pmatrix} \bm{-14} & \bm{23} \\[1.1ex]\bm{22} & \bm{-19} \end{pmatrix} \end{aligned}](https://mathority.org/wp-content/ql-cache/quicklatex.com-fc7217dab49f67df2a9d2abc561baf9d_l3.png)
演習 3
次の 3×3 行列の乗算を計算します。

3×3 行列の乗算を実行するには、左の行列の行と右の行列の列を乗算する必要があります。
![Rendered by QuickLaTeX.com \displaystyle \begin{array}{l} \begin{pmatrix} 1 & 2 & 0 \\[1.1ex] 3 & 2 & -1 \\[1.1ex] 5 & 1 & -2 \end{pmatrix} \cdot \begin{pmatrix} 3 & 4 & 0 \\[1.1ex] 1 & 0 & -2 \\[1.1ex] -1 & 2 & 1 \end{pmatrix} = \\[7.5ex] =\begin{pmatrix} 1 \cdot 3+2 \cdot 1+ 0 \cdot (-1) & 1 \cdot 4+2 \cdot 0+ 0 \cdot 2 & 1 \cdot 0+2 \cdot (-2)+ 0 \cdot 1 \\[1.1ex] 3 \cdot 3+2 \cdot 1+ (-1) \cdot (-1) & 3 \cdot 4+2 \cdot 0+ (-1) \cdot 2 & 3 \cdot 0+2 \cdot (-2)+ (-1) \cdot 1 \\[1.1ex] 5 \cdot 3+1 \cdot 1+ (-2) \cdot (-1) & 5 \cdot 4+1 \cdot 0+ (-2) \cdot 2 & 5 \cdot 0+1 \cdot (-2)+ (-2) \cdot 1 \end{pmatrix} = \\[7.5ex] =\begin{pmatrix} \bm{5} & \bm{4} & \bm{-4} \\[1.1ex] \bm{12} & \bm{10} & \bm{-5} \\[1.1ex] \bm{18} & \bm{16} & \bm{-4} \end{pmatrix}\end{array}](https://mathority.org/wp-content/ql-cache/quicklatex.com-ef6ee7bb6e4ac095a9fd51a545b163b0_l3.png)
演習 4
行列が与えられると
![]()
:
![Rendered by QuickLaTeX.com \displaystyle A= \begin{pmatrix} 3 & 1 & -2 \\[1.1ex] 4 & 2 & -1 \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-27365f9993caf4fcdb747352e4ae539d_l3.png)
計算します:
![]()
まず、次の転置行列を計算します。
![]()
乗算を行うために。転置行列を作成するには、行を列に変更する必要があります。つまり、行列の 1 行目は行列の 1 列目になり、行列の 2 行目は行列の 2 列目になります。まだ:
![Rendered by QuickLaTeX.com \displaystyle A^t= \begin{pmatrix} 3 & 4 \\[1.1ex] 1 & 2 \\[1.1ex] -2 & -1 \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-ac4785c47f2e48e15b3d98ba426848b6_l3.png)
したがって、行列演算はそのまま残ります。
![Rendered by QuickLaTeX.com \displaystyle 2A\cdot A^t = 2 \begin{pmatrix} 3 & 1 & -2 \\[1.1ex] 4 & 2 & -1 \end{pmatrix} \cdot \begin{pmatrix} 3 & 4 \\[1.1ex] 1 & 2 \\[1.1ex] -2 & -1 \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-9513fa8cc6996e18e3cf287f0210817a_l3.png)
これで計算ができるようになりました。まず計算します
![]()
(ただし、最初に計算することもできます
![]()
):
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 2 \cdot 3 & 2 \cdot 1 & 2 \cdot (-2) \\[1.1ex] 2 \cdot 4 & 2 \cdot 2 & 2 \cdot (-1) \end{pmatrix} \cdot \begin{pmatrix} 3 & 4 \\[1.1ex] 1 & 2 \\[1.1ex] -2 & -1 \end{pmatrix} =](https://mathority.org/wp-content/ql-cache/quicklatex.com-ae5e95f09aedac8f0861bf13fb9c78a4_l3.png)
![Rendered by QuickLaTeX.com \displaystyle =\begin{pmatrix} 6 & 2 & -4 \\[1.1ex] 8 & 4 & -2 \end{pmatrix} \cdot \begin{pmatrix} 3 & 4 \\[1.1ex] 1 & 2 \\[1.1ex] -2 & -1 \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-24c003b8da1081d6ca494adc3356b06b_l3.png)
そして最後に、行列の積を解きます。
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 6 \cdot 3 +2 \cdot 1 + (-4) \cdot (-2) & 6 \cdot 4 +2 \cdot 2 + (-4) \cdot (-1) \\[1.1ex] 8 \cdot 3 +4 \cdot 1 + (-2) \cdot (-2) & 8 \cdot 4 +4 \cdot 2 + (-2) \cdot (-1) \end{pmatrix} =](https://mathority.org/wp-content/ql-cache/quicklatex.com-0eb8f1817f0163a82ae39cc6c81d478e_l3.png)
![Rendered by QuickLaTeX.com \displaystyle = \begin{pmatrix} \bm{28} & \bm{32} \\[1.1ex]\bm{32} & \bm{42} \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-33533be747b72497915048e486d16541_l3.png)
演習 5
次の行列を考えてみましょう。
![Rendered by QuickLaTeX.com \displaystyle A=\begin{pmatrix} 2 & 4 \\[1.1ex] -3 & 5 \end{pmatrix} \qquad B=\begin{pmatrix} -1 & -2 \\[1.1ex] 3 & -3 \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-6e26aec2eee6bcae0e344682d20038f2_l3.png)
計算します:
![]()
これは、減算と次数 2 の行列乗算を組み合わせた演算です。
![Rendered by QuickLaTeX.com \displaystyle A\cdot B - B \cdot A= \begin{pmatrix} 2 & 4 \\[1.1ex] -3 & 5 \end{pmatrix}\cdot \begin{pmatrix} -1 & -2 \\[1.1ex] 3 & -3 \end{pmatrix} - \begin{pmatrix} -1 & -2 \\[1.1ex] 3 & -3 \end{pmatrix} \cdot \begin{pmatrix} 2 & 4 \\[1.1ex] -3 & 5 \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-43f79f2d970bb02caaeddec34d5ad2a1_l3.png)
まず左側の乗算を計算します。
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 2\cdot (-1) + 4 \cdot 3 & 2\cdot (-2) + 4 \cdot (-3) \\[1.1ex] (-3)\cdot (-1) + 5 \cdot 3 & (-3)\cdot (-2) + 5 \cdot (-3) \end{pmatrix} - \begin{pmatrix} -1 & -2 \\[1.1ex] 3 & -3 \end{pmatrix} \cdot \begin{pmatrix} 2 & 4 \\[1.1ex] -3 & 5 \end{pmatrix} =](https://mathority.org/wp-content/ql-cache/quicklatex.com-05ff586671fb0af274884169c54e5817_l3.png)
![Rendered by QuickLaTeX.com \displaystyle= \begin{pmatrix} 10 & -16 \\[1.1ex] 18 & -9 \end{pmatrix} - \begin{pmatrix} -1 & -2 \\[1.1ex] 3 & -3 \end{pmatrix} \cdot \begin{pmatrix} 2 & 4 \\[1.1ex] -3 & 5 \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-43c234a2d7aa4f9dcaf3140f617480f1_l3.png)
ここで、右側の乗算を解きます。
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 10 & -16 \\[1.1ex] 18 & -9 \end{pmatrix} - \begin{pmatrix} -1 \cdot 2 +(-2) \cdot (-3) & -1 \cdot 4 +(-2) \cdot 5 \\[1.1ex]3 \cdot 2 +(-3) \cdot (-3) & 3 \cdot 4 +(-3) \cdot 5 \end{pmatrix} =](https://mathority.org/wp-content/ql-cache/quicklatex.com-552309dd1be2f69bb72633539809283b_l3.png)
![Rendered by QuickLaTeX.com \displaystyle =\begin{pmatrix} 10 & -16 \\[1.1ex] 18 & -9 \end{pmatrix} - \begin{pmatrix} 4 &-14 \\[1.1ex]15 & -3 \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-eeac84965cc522402e869234a841ba67_l3.png)
そして最後に行列を減算します。
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 10-4 & -16 -(-14) \\[1.1ex] 18-15 & -9-(-3) \end{pmatrix} =](https://mathority.org/wp-content/ql-cache/quicklatex.com-faefbc14fc49439616b3d131243eba79_l3.png)
![Rendered by QuickLaTeX.com \displaystyle =\begin{pmatrix} \bm{6} & \bm{-2} \\[1.1ex] \bm{3} & \bm{-6} \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-50bac6ac99e1cf6e4b77a1a8718f9fe4_l3.png)
2 つの行列を乗算できないのはどのような場合ですか?
すべての行列を乗算できるわけではありません。 2 つの行列を乗算するには、最初の行列の列数が 2 番目の行列の行数と一致する必要があります。
たとえば、最初の行列には 3 列があり、2 番目の行列には 2 行があるため、次の乗算は実行できません。
![Rendered by QuickLaTeX.com \displaystyle\begin{pmatrix} 1 & 3 & -2 \\[1.1ex] 4 & 0 & 5 \end{pmatrix} \cdot \begin{pmatrix} 2 & 1 \\[1.1ex] 3 & -1 \end{pmatrix} \ \longleftarrow \ \color{red} \bm{\times}](https://mathority.org/wp-content/ql-cache/quicklatex.com-b8314f9238afb3676bee5c9000c02752_l3.png)
しかし、順序を逆にすると、それらを乗算することができます。最初の行列には 2 つの列があり、2 番目の行列には 2 つの行があるため、次のようになります。
![Rendered by QuickLaTeX.com \displaystyle \begin{aligned} \begin{pmatrix} 2 & 1 \\[1.1ex] 3 & -1 \end{pmatrix} \cdot \begin{pmatrix} 1 & 3 & -2 \\[1.1ex] 4 & 0 & 5 \end{pmatrix} & = \begin{pmatrix} 2\cdot 1 + 1 \cdot 4 & 2\cdot 3 + 1 \cdot 0 & 2\cdot (-2) + 1 \cdot 5 \\[1.1ex] 3\cdot 1 + (-1) \cdot 4 & 3\cdot 3 + (-1) \cdot 0 & 3\cdot (-2) + (-1) \cdot 5 \end{pmatrix} \\[2ex] & = \begin{pmatrix} \bm{6} & \bm{6} & \bm{1} \\[1.1ex]\bm{-1} & \bm{9} & \bm{-11} \end{pmatrix} \end{aligned}](https://mathority.org/wp-content/ql-cache/quicklatex.com-37d01cc99b578d3756312c3e6ff12cae_l3.png)
行列乗算のプロパティ
このタイプの行列演算には次の特徴があります。
- 行列の乗算は結合的です。
![]()
- 行列乗算には次のような分配特性もあります。
![]()
- 行列の積は可換ではありません。
![]()
たとえば、次の行列乗算の結果は次のようになります。
![Rendered by QuickLaTeX.com \displaystyle \begin{aligned} \begin{pmatrix} 1 & -1 \\[1.1ex] 2 & 3 \end{pmatrix} \cdot \begin{pmatrix} -2 & 5 \\[1.1ex] 0 & 1 \end{pmatrix} & = \begin{pmatrix} 1\cdot (-2) + (-1) \cdot 0 & 1\cdot 5 + (-1) \cdot 1 \\[1.1ex] 2\cdot (-2) + 3 \cdot 0 & 2\cdot 5 + 3 \cdot 1 \end{pmatrix} \\[2ex] & = \begin{pmatrix} \bm{-2} & \bm{4} \\[1.1ex] \bm{-4} & \bm{13} \end{pmatrix}\end{aligned}](https://mathority.org/wp-content/ql-cache/quicklatex.com-3e780b321b160ad4a612e608199a374b_l3.png)
しかし、行列の乗算の順序を逆にすると、積の結果は異なります。
![Rendered by QuickLaTeX.com \displaystyle \begin{aligned}\begin{pmatrix} -2 & 5 \\[1.1ex] 0 & 1 \end{pmatrix} \cdot \begin{pmatrix} 1 & -1 \\[1.1ex] 2 & 3 \end{pmatrix} & = \begin{pmatrix} -2 \cdot 1 + 5\cdot 2 & -2 \cdot (-1) + 5\cdot 3 \\[1.1ex] 0 \cdot 1 + 1\cdot 2 & 0 \cdot (-1) + 1\cdot 3 \end{pmatrix} \\[2ex] & = \begin{pmatrix} \bm{8} & \bm{17} \\[1.1ex] \bm{2} & \bm{3} \end{pmatrix}\end{aligned}](https://mathority.org/wp-content/ql-cache/quicklatex.com-177d78a209e5d9e18828617e4913176d_l3.png)
- さらに、行列に単位行列を乗算すると、結果は同じ行列になります。これは乗法恒等性プロパティと呼ばれます。
![]()
![]()
例えば:
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 2 & 7 \\[1.1ex] -6 & 5 \end{pmatrix} \cdot \begin{pmatrix} 1 & 0 \\[1.1ex] 0 & 1 \end{pmatrix} = \begin{pmatrix} \bm{2} & \bm{7} \\[1.1ex] \bm{-6} & \bm{5} \end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-9c1e72173419eb76554256cf6ccd0d2f_l3.png)
- 最後に、すでにご想像のとおり、行列にゼロ行列を乗算すると、行列はゼロ行列に等しくなります。これはゼロの乗法的性質と呼ばれます。
![]()
![]()
例えば:
![Rendered by QuickLaTeX.com \displaystyle \begin{pmatrix} 6 & -4 \\[1.1ex] 3 & 8 \end{pmatrix} \cdot \begin{pmatrix} 0 & 0 \\[1.1ex] 0 & 0 \end{pmatrix} = \begin{pmatrix} \bm{0} & \bm{0} \\[1.1ex] \bm{0} & \bm{0}\end{pmatrix}](https://mathority.org/wp-content/ql-cache/quicklatex.com-3152d82054a80d61d548e969290aea4c_l3.png)