Matrices and Matrix Arithmetic

MAT1503 - Linear Algebra I · SYSTEMS OF LINEAR EQUATIONS AND MATRICES

Matrices and Matrix Arithmetic

What is a Matrix?

An m × n matrix is a rectangular array of numbers with m rows and n columns. The notation for a matrix is A = [a_{ij}], where a_{ij} is the entry in row i and column j. The size of the matrix is given as m × n.

For example, the matrix:

A = [[3, -1, 0], [2, 5, 7]]

is a 2 × 3 matrix. Here, a_{12} = -1, a_{23} = 7, and a_{21} = 2. Two matrices are equal only if they have the same size and every corresponding entry is equal.

Special Matrices

There are several special types of matrices that you should recognise:

NameConditionExample
Squarem = n[[1, 2], [3, 4]]
Row/Column Vector1 × n / m × 1[[1, 4, 2]] or [[1], [4]]
Zero MatrixAll entries 0[[0, 0], [0, 0]]
DiagonalSquare, a_{ij} = 0 for i ≠ j[[2, 0], [0, -5]]
IdentityDiagonal with 1’s on diagonalI_2 = [[1, 0], [0, 1]]
Upper Triangulara_{ij} = 0 for i > j[[1, 4], [0, 3]]
Lower Triangulara_{ij} = 0 for i < j[[1, 0], [4, 3]]
SymmetricA^T = A, i.e. a_{ij} = a_{ji}[[1, 7], [7, 2]]
Skew-SymmetricA^T = -A (diagonal must be 0)[[0, 3], [-3, 0]]

Matrix Operations

Addition and Subtraction

If A and B are both m × n matrices, then:

A ± B = [[a_{ij} ± b_{ij}]]

Scalar multiplication is defined as:

kA = [[k 	imes a_{ij}]]

For example, let:

A = [[2, -1], [1, 3]], B = [[0, 4], [-2, 1]].

To find 2A - 3B:

2A = [[4, -2], [2, 6]], 3B = [[0, 12], [-6, 3]].

Now, compute:

2A - 3B = [[4 - 0, -2 - 12], [2 + 6, 6 - 3]] = [[4, -14], [8, 3]].

Watch out: Matrices of different sizes cannot be added. If the sizes do not match, the operation is undefined.

Matrix Multiplication

Matrix multiplication is defined for an m × n matrix A and an n × p matrix B. The product AB is an m × p matrix where each entry is calculated as follows:

(AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + ... + a_{in}b_{nj} = ∑_{k=1}^{n} a_{ik}b_{kj}.

For example, let:

A = [[2, -1], [1, 3]], B = [[0, 4], [-2, 1]].

To find AB:

AB = [[2(0) + (-1)(-2), 2(4) + (-1)(1)], [1(0) + 3(-2), 1(4) + 3(1)]].

Calculating gives:

AB = [[2, 7], [-6, 7]].

Now, compute BA:

BA = [[0(2) + 4(1), 0(-1) + 4(3)], [-2(2) + 1(1), -2(-1) + 1(3)]].

Calculating gives:

BA = [[4, 12], [-3, 5]].

Watch out: Matrix multiplication is not commutative. That means AB ≠ BA in general.

Properties of Matrix Operations

Here are some important properties of matrix operations:

  • (a) A(BC) = (AB)C (associative)
  • (b) A(B + C) = AB + AC and (B + C)A = BA + CA (distributive)
  • (c) k(AB) = (kA)B = A(kB)
  • (d) I_mA = A = A I_n for A of size m × n
  • (e) AO = O and OA = O

Commutativity of Matrices

Two matrices A and B commute if AB = BA. However, this is not true for all matrices. For example:

AB = [[2, 7], [-6, 7]], BA = [[4, 12], [-3, 5]].

Since AB ≠ BA, we conclude that A and B do not commute.

Self-Check Questions

  1. If A = [[2, 1], [0, 3]] and B = [[1, 0], [4, 2]], what is AB?
  2. If A = [[1, 3], [2, 0]] and B = [[0, 2], [1, 1]], what is BA?
  3. Given AB and BA above, which statement is true?
  4. If A = [[0, 1], [2, 3]] and B = [[1, 2], [1, 0]], what is AB?

Common mistakes explained

Commutative Property of Matrices

Two matrices A and B commute if AB = BA. This means that the order in which you multiply them does not change the result. To find the general form of a matrix that commutes with a given matrix, we can use a specific example.

Let A = [[2, -1], [0, 1]] and let B = [[a, b], [c, d]]. We need to find B such that AB = BA.

Calculating AB:

A * B = [[2, -1], [0, 1]] * [[a, b], [c, d]] = [[2a - c, 2b - d], [0 + c, 0 + d]] = [[2a - c, 2b - d], [c, d]]

Calculating BA:

B * A = [[a, b], [c, d]] * [[2, -1], [0, 1]] = [[2a - b, -a + b], [2c, -c + d]]

Setting these equal gives us two equations. Solving these leads to the conclusion that c must be 0 and d = a + b. Thus, the general form of B is [[a, b], [0, a + b]].

The wrong options do not satisfy the commutative property. For example, [[a, 0], [b, a + b]] fails because the second row does not adhere to the required form. Similarly, the other options do not maintain the necessary relationships between the elements of the matrices.

Matrix Multiplication

Matrix multiplication involves combining two matrices to produce a new matrix. The number of columns in the first matrix must equal the number of rows in the second matrix. The element in the resulting matrix at position (i, j) is calculated by taking the dot product of the i-th row of the first matrix and the j-th column of the second matrix.

For matrices A = [[0, 1], [2, 3]] and B = [[1, 2], [1, 0]], we can find the product AB as follows:

  1. Calculate the element at position (1, 1): (0 × 1) + (1 × 1) = 0 + 1 = 1.
  2. Calculate the element at position (1, 2): (0 × 2) + (1 × 0) = 0 + 0 = 0.
  3. Calculate the element at position (2, 1): (2 × 1) + (3 × 1) = 2 + 3 = 5.
  4. Calculate the element at position (2, 2): (2 × 2) + (3 × 0) = 4 + 0 = 4.

Thus, AB = [[1, 0], [5, 4]].

The wrong options arise from common mistakes:

  • [[4, 7], [0, 1]]: This may result from incorrect addition of products.
  • [[0, 2], [2, 0]]: This shows a misunderstanding of how to calculate the dot products.
  • [[1, 2], [5, 6]]: This option likely miscalculates the second element of the first row.

Understanding the process of matrix multiplication will help avoid these errors.

Solving Matrix Equations

To solve for matrix B in the equation CBT = 3D, we first need to determine the matrix C. Given C = A - I3, where A is the matrix [[2,0,0],[1,2,0],[0,1,2]] and I3 is the 3x3 identity matrix [[1,0,0],[0,1,0],[0,0,1]], we can calculate C as follows:

C = [[2,0,0],[1,2,0],[0,1,2]] - [[1,0,0],[0,1,0],[0,0,1]] = [[1,0,0],[1,1,0],[0,1,1]]

Next, we need to find B such that CBT = 3D. If D is given as [[1,1,0],[0,-1,2]], then 3D = [[3,3,0],[0,-3,6]].

To find B, we can multiply both sides of the equation by the inverse of C (if it exists). After performing the calculations, we find that B = [[3,3,0],[0,-3,6]].

The wrong options can be explained as follows: the first option incorrectly arranges the elements of B. The second option has incorrect signs for the elements. The third option has the correct first row but an incorrect second row, which does not satisfy the equation.

Test yourself

5 quick questions on this lesson. Pick an answer to see if you're right.

  1. 1. Let C=A-I3 where A=. Solve CBᵀ=3D for B (given D).

  2. 2. If A= and B=, what is AB?

  3. 3. If A= and B=, what is AB?

  4. 4. If A= and B=, what is BA?

  5. 5. If A= and B=, what is BA?

    Matrices and Matrix Arithmetic – MAT1503 - Linear Algebra I notes | Tyro Study