PROJECTENGRAM

MATRIX MULTIPLICATION

Matrix Multiplication

Tags: #◇CSMATH2 #◇Linear Algebra #◇Computational Mathematics #◇Matrices #◇Matrix Operations #◇Computer Science #◇Vector Spaces #◇Linear Transformations


◇Overview

Definition: If A=[aij]A=[a_{ij}] is an m×nm \times n matrix and B=[bij]B=[b_{ij}] is an n×pn \times p matrix, their product ABAB is an m×pm \times p matrix C=[cij]C=[c_{ij}]

◇Key Concepts

Size Compatibility Condition Non-Commutativity

◇Details / Theory

Definition: If A=[aij]A=[a_{ij}] is an m×nm \times n matrix and B=[bij]B=[b_{ij}] is an n×pn \times p matrix, their product ABAB is an m×pm \times p matrix C=[cij]C=[c_{ij}], where the entry cijc_{ij} (in the i-th row, j-th column of CC) is calculated by taking the dot product of the i-th row of AA with the j-th column of BB:
cij=(i-th row of A)⋅(j-th column of B)=∑k=1naikbkjc_{ij}=(\text{i-th row of } A) \cdot (\text{j-th column of } B)=\sum_{k=1}^{n}a_{ik}b_{kj}
cij=ai1b1j+ai2b2j+⋯+ainbnjc_{ij}=a_{i1}b_{1j}+a_{i2}b_{2j}+\cdots+a_{in}b_{nj}
(Handout 1, Page 21) Size Compatibility Condition: The number of columns of AA (n) must equal the number of rows of BB (n). If AA is m×nm \times n and BB is n×pn \times p, then ABAB is defined and has size m×pm \times p. (Handout 1, Page 21)
PN: This is the most complex standard operation. It's NOT element-wise multiplication! Always check dimensions first: (m×n)×(n×p)→(m×p)(m \times n) \times (n \times p) \rightarrow (m \times p). The inner dimensions nn must match. Non-Commutativity: Matrix multiplication is generally NOT commutative, meaning AB≠BAAB \neq BA even if both products are defined (which requires AA and BB to be square matrices of the same size). (Handout 1, Page 25)
Example: Let A=[3−225]A=\begin{bmatrix} 3 & -2 \\ 2 & 5 \end{bmatrix} and B=[0134]B=\begin{bmatrix} 0 & 1 \\ 3 & 4 \end{bmatrix}.
AB=[3(0)+(−2)(3)3(1)+(−2)(4)2(0)+5(3)2(1)+5(4)]=[−6−51522]AB=\begin{bmatrix} 3(0)+(-2)(3) & 3(1)+(-2)(4) \\ 2(0)+5(3) & 2(1)+5(4) \end{bmatrix}=\begin{bmatrix} -6 & -5 \\ 15 & 22 \end{bmatrix}

『』
TEXT
    $$BA=\begin{bmatrix} 0(3)+1(2) & 0(-2)+1(5) \\ 3(3)+4(2) & 3(-2)+4(5) \end{bmatrix}=\begin{bmatrix} 2 & 5 \\ 17 & 14 \end{bmatrix}$$

    Clearly, $AB \neq BA$. (Handout 1, Page 25)

PN: This is a critical difference from scalar arithmetic. The order of multiplication matters significantly.

◇Common Pitfalls

Multiplication is NOT commutative: AB≠BAAB \neq BA in general. Inner dimensions must match: Am×n⋅Bn×pA_{m \times n} \cdot B_{n \times p} — if cols of A≠A \neq rows of BB, undefined. AB=OAB = O does not mean A=OA = O or B=OB = O.

◇Summary

TL;DR — (AB)ij=∑kaikbkj(AB)_{ij} = \sum_k a_{ik} b_{kj}. Requires inner dimensions to match. Not commutative. Associative and distributive over addition.

Related: Source / Reference:

◇References & Navigation

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

To multiply matrix AA of size m×nm \times n by matrix BB of size p×qp \times q, what dimensional condition must be met?

Q2

If AA is an m×nm \times n matrix and BB is an n×pn \times p matrix, what is the size of the resulting product matrix ABAB?

Q3

How is the specific entry cijc_{ij} computed in the product matrix C=ABC = AB?

Q4

Which of the following is a true statement regarding the commutativity of standard matrix multiplication?

Q5

What is the fundamental difference between matrix multiplication and element-wise scalar multiplication?

Q6

If the matrix product ABAB equals the zero matrix OO, what can be definitively concluded about matrices AA and BB?

Q7

What formal summation formula represents the calculation for entry cijc_{ij} in the matrix product C=ABC = AB?

Q8

For two square matrices AA and BB of the exact same size, is the product ABAB always equal to BABA?

Q9

According to the properties of operations, matrix multiplication is distributive over which other matrix operation?

Q10

Which of the following best describes the "inner dimensions" that must match in matrix multiplication A⋅BA \cdot B?

Matrix Multiplication | PROJECT ENGRAM