• Foundation
  • About 18 min
  • 5 practice questions

What a matrix is: order, elements and types

Read the order and the (i, j)th element of a matrix, build a matrix from a rule for aᵢⱼ, recognise the main types of matrices and use equality of matrices to find unknowns.

If something looks wrong, please tell us.

By the end of this lesson you can

  • State the order of a matrix and find its (i, j)th element.
  • Construct a matrix whose entries are given by a formula in i and j.
  • Name row, column, square, diagonal, scalar, identity and zero matrices, and solve for unknowns using equality.

Whenever data is naturally arranged in rows and columns, such as marks of students in several subjects or stock of items in several shops, a matrix stores it compactly. Matrices were developed to handle systems of linear equations, and today they also describe rotations and reflections in computer graphics, coding of messages and spreadsheet calculations. This chapter builds the algebra of matrices that the next chapter (Determinants) relies on.

How matrices are written in these lessons: entries in a row are separated by spaces and rows by semicolons, so [2 −1; 3 0] is the 2 × 2 matrix with first row 2, −1 and second row 3, 0.

Definition and order

A matrix is an ordered rectangular array of numbers or functions, called its elements or entries. A matrix with m rows and n columns has order m × n (read 'm by n') and contains mn elements. We write A = [aᵢⱼ]ₘ×ₙ, where aᵢⱼ is the element in the i-th row and j-th column, called the (i, j)th element.

Worked example 1 (made-up data). Three shops P, Q and R stock rice and wheat bags: P has 20 rice and 15 wheat, Q has 12 rice and 30 wheat, R has 25 rice and 10 wheat. As a matrix with shops as rows and items as columns: S = [20 15; 12 30; 25 10], of order 3 × 2. The element s₃₂ = 10 is the number of wheat bags in shop R.

Worked example 2. What orders can a matrix with 12 elements have? Working: we need natural numbers m, n with mn = 12: (1, 12), (12, 1), (2, 6), (6, 2), (3, 4), (4, 3). So there are six possible orders: 1 × 12, 12 × 1, 2 × 6, 6 × 2, 3 × 4 and 4 × 3. A matrix with 7 elements (a prime) can only be 1 × 7 or 7 × 1.

Worked example 3. Construct the 2 × 3 matrix with aᵢⱼ = 2i − j. Working: a₁₁ = 2 − 1 = 1, a₁₂ = 2 − 2 = 0, a₁₃ = 2 − 3 = −1, a₂₁ = 4 − 1 = 3, a₂₂ = 4 − 2 = 2, a₂₃ = 4 − 3 = 1. So A = [1 0 −1; 3 2 1]. Keep i for the row and j for the column; swapping them gives a different matrix.

Types of matrices

The main types of matrix
TypeConditionExample
Column matrixOnly one column (order m × 1)[4; −1; 7]
Row matrixOnly one row (order 1 × n)[2 0 −3 5]
Square matrixNumber of rows = number of columns[1 2; 3 4]
Diagonal matrixSquare, with aᵢⱼ = 0 whenever i ≠ j[3 0; 0 −2]
Scalar matrixDiagonal, with all diagonal entries equal to one number k[5 0; 0 5]
Identity matrix IₙScalar matrix with k = 1I₂ = [1 0; 0 1]
Zero (null) matrix OEvery entry is 0 (any order)[0 0 0; 0 0 0]

In a square matrix of order n, the entries a₁₁, a₂₂, …, aₙₙ form the (leading) diagonal. Every identity matrix is a scalar matrix and every scalar matrix is a diagonal matrix, but not the other way round.

How the square-matrix types nest

  • Square matrix rows = columns
  • Diagonal matrix square, zeros off the diagonal
  • Scalar matrix diagonal, equal diagonal entries k
  • Identity matrix scalar with k = 1
Each type below is a special case of the one above it.

Equality of matrices

Two matrices A = [aᵢⱼ] and B = [bᵢⱼ] are equal if (i) they have the same order and (ii) aᵢⱼ = bᵢⱼ for every i and j. So [1 2] ≠ [1; 2] (different orders), even though the numbers are the same. Equality gives one equation per position, which lets us find unknowns.

Worked example 4. Find x and y if [x + y 2; 5 x − y] = [7 2; 5 1]. Working: comparing corresponding entries, x + y = 7 and x − y = 1. Adding, 2x = 8, so x = 4; then y = 3. The other entries (2 = 2 and 5 = 5) agree, so the solution is consistent.

A = [aᵢⱼ]ₘ×ₙ has mn elements; aᵢⱼ sits in row i, column j. Equal matrices: same order and equal corresponding entries.

— Remember

Key takeaways: order is rows × columns; aᵢⱼ means row i, column j. Build a matrix from a rule by substituting each pair (i, j). Diagonal ⊃ scalar ⊃ identity among square matrices. Equal matrices give one equation per entry.

Check your understanding

  1. 1. A matrix has 18 elements. How many different orders can it have?

    1. 4
    2. 6
    3. 3
    4. 9
    Show answer

    Answer: B. We need mn = 18: (1, 18), (18, 1), (2, 9), (9, 2), (3, 6), (6, 3). That is 6 orders.

  2. 2. For the 3 × 2 matrix with aᵢⱼ = i + 3j, what is a₃₁?

    1. 10
    2. 9
    3. 6
    4. 7
    Show answer

    Answer: C. a₃₁ means i = 3, j = 1: 3 + 3 × 1 = 6. (10 would come from swapping i and j: 1 + 3 × 3.)

  3. 3. Which matrix is a scalar matrix?

    1. [2 0; 0 3]
    2. [4 4; 4 4]
    3. [0 1; 1 0]
    4. [−3 0; 0 −3]
    Show answer

    Answer: D. A scalar matrix is diagonal with equal diagonal entries. [−3 0; 0 −3] has zeros off the diagonal and both diagonal entries −3. [2 0; 0 3] is diagonal but not scalar; the other two have non-zero off-diagonal entries.

  4. 4. If [2a b; 3 a − b] = [8 −1; 3 5], what are a and b?

    1. a = 4, b = −1
    2. a = 4, b = 1
    3. a = 3, b = −1
    4. a = −4, b = −1
    Show answer

    Answer: A. Comparing entries: 2a = 8 gives a = 4; b = −1. Check the last entry: a − b = 4 − (−1) = 5 ✓.

  5. 5. Assertion (A): Every identity matrix is a diagonal matrix.
    Reason (R): In an identity matrix every entry off the diagonal is 0.

    1. Both A and R are true, and R is the correct explanation of A
    2. Both A and R are true, but R is not the correct explanation of A
    3. A is true but R is false
    4. A is false but R is true
    Show answer

    Answer: A. A diagonal matrix is a square matrix whose off-diagonal entries are all 0. An identity matrix is square and its off-diagonal entries are 0 (R), which is exactly why it is diagonal (A).

Privacy · Terms · Refunds · Delivery