BioStart Logo

Matrix Algebra and Definitions: Learning Objectives 1, 2

Question 1: Let  \[A = \begin{bmatrix} 1 & 2 & 3 \\ -1 & 2 & 1 \\ 5 & 5 & 5 \end{bmatrix}, B = \begin{bmatrix} 2 & 4 & 6 \\ 1 & 2 & 2 \\ -1 & 0 & 4 \end{bmatrix}, C = \begin{bmatrix} 1 & 2 & 3 \\ 9 & 8 & 7 \end{bmatrix} \] Evaluate the following or state whether the operation is undefined:
  1. $A+B$
  2. $A - B$
  3. $A+C$
  4. $5(A+B)$
  5. $AB$
  6. $AC$
  7. $CA$
  8. $ACB$
  9. $CAB$

Addition/subtraction requires matrices of the same dimensions. For a product $XY$ to be defined, the number of columns in $X$ must equal the number of rows in $Y$.

  1. $\begin{bmatrix} 3 & 6 & 9 \\ 0 & 4 & 3 \\ 4 & 5 & 9 \end{bmatrix}$
  2. $\begin{bmatrix} -1 & -2 & -3 \\ -2 & 0 & -1 \\ 6 & 5 & 1 \end{bmatrix}$
  3. Undefined
  4. $\begin{bmatrix} 15 & 30 & 45 \\ 0 & 20 & 15 \\ 20 & 25 & 45 \end{bmatrix}$
  5. $\begin{bmatrix} 1 & 8 & 22 \\ -3 & 0 & 2 \\ 20 & 30 & 60 \end{bmatrix}$
  6. Undefined
  7. $\begin{bmatrix} 14 & 21 & 20 \\ 1 & 34 & 56 \end{bmatrix}$
  8. Undefined
  9. $\begin{bmatrix} 29 & 98 & 206 \\ 71 & 282 & 634 \end{bmatrix}$

a) $A+B = \begin{bmatrix} 1+2 & 2+4 & 3+6 \\ -1+1 & 2+2 & 1+2 \\ 5-1 & 5+0 & 5+4 \end{bmatrix} = \begin{bmatrix} 3 & 6 & 9 \\ 0 & 4 & 3 \\ 4 & 5 & 9 \end{bmatrix}$
b) $A-B = \begin{bmatrix} 1-2 & 2-4 & 3-6 \\ -1-1 & 2-2 & 1-2 \\ 5-(-1) & 5-0 & 5-4 \end{bmatrix} = \begin{bmatrix} -1 & -2 & -3 \\ -2 & 0 & -1 \\ 6 & 5 & 1 \end{bmatrix}$
c) $A+C$ is undefined ($3 \times 3$ cannot be added to $2 \times 3$).
d) $5(A+B) = 5\begin{bmatrix} 3 & 6 & 9 \\ 0 & 4 & 3 \\ 4 & 5 & 9 \end{bmatrix} = \begin{bmatrix} 15 & 30 & 45 \\ 0 & 20 & 15 \\ 20 & 25 & 45 \end{bmatrix}$
e) $AB = \begin{bmatrix} 1 & 2 & 3 \\ -1 & 2 & 1 \\ 5 & 5 & 5 \end{bmatrix}\begin{bmatrix} 2 & 4 & 6 \\ 1 & 2 & 2 \\ -1 & 0 & 4 \end{bmatrix} = \begin{bmatrix} 2+2-3 & 4+4+0 & 6+4+12 \\ -2+2-1 & -4+4+0 & -6+4+4 \\ 10+5-5 & 20+10+0 & 30+10+20 \end{bmatrix} = \begin{bmatrix} 1 & 8 & 22 \\ -1 & 0 & 2 \\ 10 & 30 & 60 \end{bmatrix}$
f) $AC$ is undefined (inner dimensions $3 \neq 2$).
g) $CA = \begin{bmatrix} 1 & 2 & 3 \\ 9 & 8 & 7 \end{bmatrix}\begin{bmatrix} 1 & 2 & 3 \\ -1 & 2 & 1 \\ 5 & 5 & 5 \end{bmatrix} = \begin{bmatrix} 1-2+15 & 2+4+15 & 3+2+15 \\ 9-8+35 & 18+16+35 & 27+8+35 \end{bmatrix} = \begin{bmatrix} 14 & 21 & 20 \\ 36 & 69 & 70 \end{bmatrix}$
h) $ACB$ is undefined because $AC$ is undefined.
i) $CAB = (CA)B = \begin{bmatrix} 14 & 21 & 20 \\ 36 & 69 & 70 \end{bmatrix}\begin{bmatrix} 2 & 4 & 6 \\ 1 & 2 & 2 \\ -1 & 0 & 4 \end{bmatrix} = \begin{bmatrix} 28+21-20 & 56+42+0 & 84+42+80 \\ 72+69-70 & 144+138+0 & 216+138+280 \end{bmatrix} = \begin{bmatrix} 29 & 98 & 206 \\ 71 & 282 & 634 \end{bmatrix}$

Question 2: Let $A = \begin{bmatrix} 2 & -1 \\ 3 & 6 \end{bmatrix}$. Find the matrix $B$ such that $2A+3B = -4A$.

Use matrix algebra to solve for $B$. First, isolate the term with $B$, then multiply by the scalar inverse.

$B = \begin{bmatrix} -4 & 2 \\ -6 & -12 \end{bmatrix}$

1. Solve for B algebraically: \[ 2A+3B = -4A \] \[ 3B = -4A - 2A \] \[ 3B = -6A \] \[ B = -2A \] 2. Calculate B: \[ B = -2 \begin{bmatrix} 2 & -1 \\ 3 & 6 \end{bmatrix} = \begin{bmatrix} -2(2) & -2(-1) \\ -2(3) & -2(6) \end{bmatrix} = \begin{bmatrix} -4 & 2 \\ -6 & -12 \end{bmatrix} \]

Question 3: Let $A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}$, $B = \begin{bmatrix} 1 & -1 & 0 \\ 2 & 2 & -1 \end{bmatrix}$.
  1. What are the dimensions of $A$ and $B$?
  2. Without multiplying the matrices, state whether $AB$ and/or $BA$ are defined. If defined, state the dimensions of the product.
  3. Find $AB$ and $BA$ if defined.

For a matrix product $XY$ to be defined, the number of columns in $X$ must equal the number of rows in $Y$. If $X$ is $m \times n$ and $Y$ is $n \times p$, the product $XY$ is $m \times p$.

  1. $A$ is $2 \times 2$, $B$ is $2 \times 3$.
  2. $AB$ is defined and will be a $2 \times 3$ matrix. $BA$ is not defined.
  3. $AB = \begin{bmatrix} 5 & 3 & -2 \\ 11 & 5 & -4 \end{bmatrix}$.

a) $A$ has 2 rows and 2 columns ($2 \times 2$). $B$ has 2 rows and 3 columns ($2 \times 3$).

b) For $AB$: The inner dimensions are $A (2 \times \textbf{2})$ and $B (\textbf{2} \times 3)$. Since they match (2=2), $AB$ is defined. The resulting dimension will be the outer dimensions, $2 \times 3$.
For $BA$: The inner dimensions are $B (2 \times \textbf{3})$ and $A (\textbf{2} \times 2)$. Since they do not match ($3 \neq 2$), $BA$ is not defined.

c) $AB = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix} \begin{bmatrix} 1 & -1 & 0 \\ 2 & 2 & -1 \end{bmatrix}$ \[ = \begin{bmatrix} (1)(1)+(2)(2) & (1)(-1)+(2)(2) & (1)(0)+(2)(-1) \\ (3)(1)+(4)(2) & (3)(-1)+(4)(2) & (3)(0)+(4)(-1) \end{bmatrix} \] \[ = \begin{bmatrix} 1+4 & -1+4 & 0-2 \\ 3+8 & -3+8 & 0-4 \end{bmatrix} = \begin{bmatrix} 5 & 3 & -2 \\ 11 & 5 & -4 \end{bmatrix} \]

Question 4: Let $ A= \begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \end{bmatrix}$ and $B = \begin{bmatrix} b_{11} & b_{12} & b_{13} \\ b_{21} & b_{22} & b_{23} \\ b_{31} & b_{32} & b_{33}\end{bmatrix}$. Find $AB$.

The element in the $i$-th row and $j$-th column of the product matrix $AB$ is the dot product of the $i$-th row of $A$ and the $j$-th column of $B$.

$AB = \begin{bmatrix} a_{11}b_{11} +a_{12}b_{21}+a_{13}b_{31} & a_{11}b_{12} +a_{12}b_{22}+a_{13}b_{32} & a_{11}b_{13} +a_{12}b_{23}+a_{13}b_{33} \\a_{21}b_{11} +a_{22}b_{21}+a_{23}b_{31} & a_{21}b_{12} +a_{22}b_{22}+a_{23}b_{32} & a_{21}b_{13} +a_{22}b_{23}+a_{23}b_{33} \end{bmatrix}$

Question 5: Let $A$, $B$, $C$, and $D$ be $n \times n$ matrices. For each of the following equalities, state whether the given property is true or provide a counterexample.
  1. $A+B = B+A$
  2. $AB = BA$
  3. $c(A+B) = cA+cB$, where $c$ is some scalar value
  4. $(AB)C = A(BC)$
  5. $C(AB) = A(CB)$
  6. $C(A+B) = CA +CB$
  7. $(A +B)(C+D) = AC +AD +BC +BD$

Remember the fundamental properties of matrix operations. Addition is commutative, but multiplication is not. Both are associative, and multiplication distributes over addition.

  1. True (Commutative Property of Addition)
  2. False (Matrix multiplication is not commutative)
  3. Let $A = \begin{bmatrix} 0 & 1 \\ 0 & 2 \end{bmatrix}$ and $B = \begin{bmatrix} 3 & 4 \\ 0 & 0 \end{bmatrix}$ $$ AB = \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix} \neq \begin{bmatrix} 0 & 11 \\ 0 & 0 \end{bmatrix} = BA $$
  4. True (Distributive Property of Scalar Multiplication)
  5. True (Associative Property of Multiplication)
  6. False (Matrix multiplication is not commutative)
  7. Let $A = \begin{bmatrix} 0 & 0 \\ 1 & 2 \end{bmatrix}$, $B = \begin{bmatrix} 1 & 0 \\ 1 & 0 \end{bmatrix}$, $C = \begin{bmatrix} 5 & -1 \\ 1 & 3 \end{bmatrix}$ $$ C(AB) = \begin{bmatrix} 3 & 0 \\ 9 & 0 \end{bmatrix} \neq \begin{bmatrix} 0 & 0 \\ 10 & 0 \end{bmatrix} = A(CB) $$
  8. True (Left Distributive Property)
  9. True (Distributive Property)

Question 6: Let $A$ and $B$ be $n \times n$ matrices. Explain why $(A+B)^2 \neq A^2 + 2AB +B^2$ in general.

Expand the left side, $(A+B)(A+B)$, using the distributive property. What property of real number multiplication does not hold for matrix multiplication?

The identity fails because matrix multiplication is not commutative, meaning that in general, $AB \neq BA$.

Let's expand the left side using the distributive property: \[ (A+B)^2 = (A+B)(A+B) \] \[ = A(A+B) + B(A+B) \] \[ = A^2 + AB + BA + B^2 \] The expression $A^2 + 2AB + B^2$ implies that $AB+BA = 2AB$. This would only be true if $AB = BA$. However, matrix multiplication is not commutative in general, so we cannot assume $AB=BA$. Therefore, the identity $(A+B)^2 = A^2 + 2AB +B^2$ does not hold for all matrices.
©