Chapter 8 Quiz — Matrix Operations
Twelve conceptual checks. Answer each before expanding the solution. These test understanding of composition and non-commutativity, not arithmetic speed.
Q1. What single idea is matrix multiplication a representation of?
Answer
**Composition of transformations.** The product $AB$ is the one matrix that does in a single step what "apply $B$, then apply $A$" does in two. Every property of matrix multiplication — the product rule, the shape requirement, the non-commutativity — flows from this. It is *not* fundamentally a row-times-column arithmetic rule; that rule is the consequence.Q2. In the product $AB$, which matrix acts on a vector first?
Answer
**$B$ acts first.** Read $AB\mathbf{x}$ as $A(B\mathbf{x})$: the matrix nearest the vector ($B$) goes first, exactly like $f(g(x))$ evaluates $g$ first. We write $A$ on the left because it acts *last*.Q3. Why is matrix multiplication not commutative? Give the geometric reason in one sentence.
Answer
Because composition is **order-dependent**: doing $B$ then $A$ is generally a different motion of space than doing $A$ then $B$ — just as shearing-then-rotating lands the unit square in a different parallelogram than rotating-then-shearing. Order matters because geometry has order.Q4. Is the entrywise (Hadamard) product $A \odot B$ the same as matrix multiplication?
Answer
**No.** The Hadamard product multiplies matching entries ($(A\odot B)_{ij} = a_{ij}b_{ij}$) and does *not* compose transformations. Matrix multiplication is the row-times-column operation derived from composition. In numpy, `A * B` is the (Hadamard) entrywise product and `A @ B` is matrix multiplication — confusing them is a classic silent bug.Q5. $A$ is $2\times 3$ and $B$ is $3\times 5$. What is the shape of $AB$, and is $BA$ defined?
Answer
$AB$ is $2\times 5$ (the outer dimensions), because the inner dimensions match: $A$'s 3 columns meet $B$'s 3 rows. $BA$ is **not defined**: $B$ outputs 5-vectors, but $A$ expects 3-vectors as input, so the inner dimensions ($5$ and $2$) disagree.Q6. What does the transpose $A^{\mathsf{T}}$ do, and how does it differ from the inverse $A^{-1}$?
Answer
The transpose flips rows and columns; its deep meaning is the **adjoint** — it satisfies $(A\mathbf{x})\cdot\mathbf{y} = \mathbf{x}\cdot(A^{\mathsf{T}}\mathbf{y})$, letting you move $A$ across a dot product. The inverse *undoes* the transformation ($A^{-1}A = I$). The transpose always exists and is free to compute; the inverse exists only when $A$ loses no information. They coincide ($A^{\mathsf{T}} = A^{-1}$) only for orthogonal matrices.Q7. Simplify $(AB)^{\mathsf{T}}$. Is it $A^{\mathsf{T}}B^{\mathsf{T}}$?
Answer
$(AB)^{\mathsf{T}} = B^{\mathsf{T}}A^{\mathsf{T}}$ — the order **reverses**. It is *not* $A^{\mathsf{T}}B^{\mathsf{T}}$. The same reversal holds for inverses, $(AB)^{-1} = B^{-1}A^{-1}$, like the socks-and-shoes rule: to undo "socks then shoes," take off shoes first.Q8. Why does the identity matrix $I$ satisfy $AI = IA = A$ for every conformable $A$?
Answer
Because $I$ is the "do nothing" transformation (its columns are the basis vectors, so $I\mathbf{v} = \mathbf{v}$). Composing with "do nothing" — on either side — changes nothing: "do nothing then $A$" and "do $A$ then do nothing" are both just "do $A$." $I$ is one of the rare matrices that commutes with everything.Q9. Is the identity $(A + B)^2 = A^2 + 2AB + B^2$ valid for matrices?
Answer
**No.** The honest expansion is $(A+B)^2 = A^2 + AB + BA + B^2$. You may *not* merge $AB + BA$ into $2AB$ because $AB \ne BA$ in general. This is a prime example of a scalar reflex that fails for matrices.Q10. Powers $A^n$ are only defined for what kind of matrix, and why?
Answer
Only for **square** matrices. To compose $A$ with itself, $A$'s output must be a valid input to $A$ again, so the output and input spaces must match — forcing $A$ to be $n\times n$. Then $A^n$ means "apply $A$ a total of $n$ times," and associativity makes the grouping irrelevant.Q11. If $A$ is the adjacency matrix of a graph, what does the entry $(A^2)_{ij}$ count?
Answer
The number of **two-step paths** from node $j$ to node $i$. The entry formula $(A^2)_{ij} = \sum_k a_{ik}a_{kj}$ adds a $1$ for every intermediate node $k$ with an edge $j\to k$ and an edge $k\to i$ — i.e., it composes the one-step reachability map with itself. More generally $(A^n)_{ij}$ counts $n$-step paths.Q12. Name two readings of the product $AB$ beyond the row-times-column rule, and say which is most useful for understanding what the product does.