A matrix is a rec­tan­gu­lar arrange­ment of num­bers in rows and columns. It is a com­pact way to store infor­ma­tion that comes in a grid, such as the prices of sev­eral items in sev­eral shops, and it is also a pow­er­ful tool for solv­ing sys­tems of lin­ear equa­tions, which is where this course ends. This first les­son explains what a matrix is, how to describe its size, how to name its entries, and how to build a matrix from a rule.

What a matrix is

Sup­pose two shops in Vijayawada sell rice, dal and oil. The price per kg (in rupees) can be set out in a grid:

Rice Dal Oil
Shop 1 52 110 180
Shop 2 60 104 170

If every­one agrees that the rows are shops and the columns are items, the labels can be dropped, leav­ing just the num­bers in brack­ets:

[5211018060104170]\begin{bmatrix} 52 & 110 & 180 \\ 60 & 104 & 170 \end{bmatrix}

Def­i­n­i­tion. A matrix is a rec­tan­gu­lar array of num­bers arranged in rows and columns and enclosed in brack­ets. The num­bers are called the ele­ments or entries of the matrix.

Matri­ces are usu­ally named with cap­i­tal let­ters: AA, BB, PP, and so on.

  • A row is a hor­i­zon­tal line of entries. Rows are counted from the top.
  • A col­umn is a ver­ti­cal line of entries. Columns are counted from the left.

The order of a matrix

A matrix with mm rows and nn columns is said to have order m×nm \times n (read "mm by nn"). It has m×nm \times n ele­ments in all.

The price matrix above has 22 rows and 33 columns, so its order is 2×32 \times 3, and it has 66 ele­ments.

The order always gives rows first, then columns. A 2×32 \times 3 matrix and a 3×23 \times 2 matrix are dif­fer­ent shapes:

[140−275] is 2×3,[1−24705] is 3×2\begin{bmatrix} 1 & 4 & 0 \\ -2 & 7 & 5 \end{bmatrix} \text{ is } 2 \times 3, \qquad \begin{bmatrix} 1 & -2 \\ 4 & 7 \\ 0 & 5 \end{bmatrix} \text{ is } 3 \times 2

Exam­ple 1

A matrix has 1212 ele­ments. What are its pos­si­ble orders?

The order m×nm \times n must have m×n=12m \times n = 12, with mm and nn pos­i­tive inte­gers. The fac­tor pairs of 1212 give six orders:

1×12,2×6,3×4,4×3,6×2,12×11 \times 12, \quad 2 \times 6, \quad 3 \times 4, \quad 4 \times 3, \quad 6 \times 2, \quad 12 \times 1

Nam­ing the ele­ments

The ele­ment in row ii and col­umn jj of a matrix AA is writ­ten aija_{ij}. The first sub­script is the row, the sec­ond is the col­umn. So a 2×32 \times 3 matrix looks like

A=[a11a12a13a21a22a23]A = \begin{bmatrix} a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \end{bmatrix}

In short, we write A=[aij]m×nA = [a_{ij}]_{m \times n}.

Exam­ple 2

For A=[2−1405738−6]A = \begin{bmatrix} 2 & -1 & 4 \\ 0 & 5 & 7 \\ 3 & 8 & -6 \end{bmatrix}, write the order and the ele­ments a12a_{12}, a23a_{23}, a31a_{31} and a33a_{33}.

AA has 33 rows and 33 columns, so its order is 3×33 \times 3.

  • a12a_{12}: row 11, col­umn 22, which is −1-1.
  • a23a_{23}: row 22, col­umn 33, which is 77.
  • a31a_{31}: row 33, col­umn 11, which is 33.
  • a33a_{33}: row 33, col­umn 33, which is −6-6.

Build­ing a matrix from a rule

Some­times a matrix is described by a for­mula for aija_{ij}. To build it, work out each entry from its row num­ber ii and col­umn num­ber jj.

Exam­ple 3

Con­struct the 2×32 \times 3 matrix with aij=i+2ja_{ij} = i + 2j.

There are 22 rows (i=1,2i = 1, 2) and 33 columns (j=1,2,3j = 1, 2, 3).

Row 1: a11=1+2=3a_{11} = 1 + 2 = 3, a12=1+4=5a_{12} = 1 + 4 = 5, a13=1+6=7a_{13} = 1 + 6 = 7.

Row 2: a21=2+2=4a_{21} = 2 + 2 = 4, a22=2+4=6a_{22} = 2 + 4 = 6, a23=2+6=8a_{23} = 2 + 6 = 8.

A=[357468]A = \begin{bmatrix} 3 & 5 & 7 \\ 4 & 6 & 8 \end{bmatrix}

Exam­ple 4

Con­struct the 3×23 \times 2 matrix with aij=2i−ja_{ij} = 2i - j.

Row 1 (i=1i = 1): 2−1=12 - 1 = 1 and 2−2=02 - 2 = 0.

Row 2 (i=2i = 2): 4−1=34 - 1 = 3 and 4−2=24 - 2 = 2.

Row 3 (i=3i = 3): 6−1=56 - 1 = 5 and 6−2=46 - 2 = 4.

A=[103254]A = \begin{bmatrix} 1 & 0 \\ 3 & 2 \\ 5 & 4 \end{bmatrix}

Read­ing a matrix in con­text

Exam­ple 5

Sita runs a sta­tionery stall. Her stock at the start of the week is: 4040 pens, 2525 note­books and 1010 geom­e­try boxes in her first stall; 3535 pens, 3030 note­books and 1212 geom­e­try boxes in her sec­ond stall. Write this as a matrix with stalls as rows, and say what a23a_{23} means.

S=[402510353012]S = \begin{bmatrix} 40 & 25 & 10 \\ 35 & 30 & 12 \end{bmatrix}

The order is 2×32 \times 3. The entry a23=12a_{23} = 12 is in row 22 (the sec­ond stall) and col­umn 33 (geom­e­try boxes): the sec­ond stall has 1212 geom­e­try boxes.

Prac­tice

  1. Write the order of [123456]\begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix} and the num­ber of its ele­ments.
  2. For A=[2−1405738−6]A = \begin{bmatrix} 2 & -1 & 4 \\ 0 & 5 & 7 \\ 3 & 8 & -6 \end{bmatrix}, write a21a_{21}, a32a_{32} and a13a_{13}.
  3. Write all the pos­si­ble orders of a matrix with 88 ele­ments.
  4. Write all the pos­si­ble orders of a matrix with 1313 ele­ments.
  5. Con­struct the 2×22 \times 2 matrix with aij=ija_{ij} = ij.
  6. Con­struct the 2×32 \times 3 matrix with aij=i−ja_{ij} = i - j.
  7. Con­struct the 3×23 \times 2 matrix with aij=(i+j)22\displaystyle a_{ij} = \frac{(i + j)^2}{2}.
  8. Con­struct the 3×33 \times 3 matrix with aij=2i+ja_{ij} = 2i + j.
  9. In Exam­ple 5, which entry gives the num­ber of note­books in the first stall, and what is it?

Answers

Show answers
  1. Order 2×32 \times 3; 66 ele­ments.
  2. a21=0a_{21} = 0, a32=8a_{32} = 8, a13=4a_{13} = 4.
  3. 1×81 \times 8, 2×42 \times 4, 4×24 \times 2, 8×18 \times 1.
  4. 1313 is prime, so only 1×131 \times 13 and 13×113 \times 1.
  5. [1224]\begin{bmatrix} 1 & 2 \\ 2 & 4 \end{bmatrix}.
  6. [0−1−210−1]\begin{bmatrix} 0 & -1 & -2 \\ 1 & 0 & -1 \end{bmatrix}.
  7. [2929288252]\displaystyle \begin{bmatrix} 2 & \frac{9}{2} \\ \frac{9}{2} & 8 \\ 8 & \frac{25}{2} \end{bmatrix}. For exam­ple, a32=(3+2)22=252\displaystyle a_{32} = \frac{(3 + 2)^2}{2} = \frac{25}{2}.
  8. [345567789]\begin{bmatrix} 3 & 4 & 5 \\ 5 & 6 & 7 \\ 7 & 8 & 9 \end{bmatrix}.
  9. a12=25a_{12} = 25.