Num­bers arranged in a table

A matrix is just num­bers arranged neatly in rows and columns. You have seen such tables many times: the sales of three prod­ucts in two shops, or the coef­fi­cients of a sys­tem of equa­tions. We will name the dif­fer­ent types of matri­ces and learn to add them, mul­ti­ply them by num­bers, mul­ti­ply them together and trans­pose them. Keep one warn­ing in mind through­out: with matri­ces, the order of mul­ti­pli­ca­tion mat­ters.

Matri­ces

A matrix of order m×nm \times n has mm rows and nn columns, and aija_{ij} is the entry sit­ting in row ii, col­umn jj. We write A=[aij]A = [a_{ij}].

The com­mon types. Col­umn (n=1n = 1), row (m=1m = 1), square (m=nm = n), diag­o­nal (square, zero off the diag­o­nal), scalar (diag­o­nal with equal diag­o­nal entries), iden­tity II (scalar with 11s), zero OO.

Exam­ple 1. Con­struct the 2×32 \times 3 matrix with aij=(i+2j)22\displaystyle a_{ij} = \tfrac{(i + 2j)^2}{2}: [4.512.524.581832]\begin{bmatrix} 4.5 & 12.5 & 24.5 \\ 8 & 18 & 32 \end{bmatrix}.

Two matri­ces are equal only when they have the same order and every pair of cor­re­spond­ing entries matches.

Oper­a­tions

  • Sum (same order): add cor­re­spond­ing entries. This is com­mu­ta­tive and asso­cia­tive, and A+O=AA + O = A.
  • Scalar mul­ti­ple: kA=[kaij]kA = [k a_{ij}]; k(A+B)=kA+kBk(A + B) = kA + kB.
  • Prod­uct: for AA of order m×nm \times n and BB of order n×pn \times p, ABAB is m×pm \times p with (AB)ik=∑jaijbjk\displaystyle (AB)_{ik} = \sum_j a_{ij} b_{jk}. In words: run along a row of AA and down a col­umn of BB, mul­ti­ply pairs and add.

Exam­ple 2. A=[2−134]A = \begin{bmatrix} 2 & -1 \\ 3 & 4 \end{bmatrix}, B=[150−2]B = \begin{bmatrix} 1 & 5 \\ 0 & -2 \end{bmatrix}: AB=[21237]AB = \begin{bmatrix} 2 & 12 \\ 3 & 7 \end{bmatrix}, BA=[1719−6−8]BA = \begin{bmatrix} 17 & 19 \\ -6 & -8 \end{bmatrix}. So AB≠BAAB \ne BA. Never assume you can swap the order.

What still works, and what does not. (AB)C=A(BC)(AB)C = A(BC); A(B+C)=AB+ACA(B + C) = AB + AC; AI=IA=AAI = IA = A. But here is a sur­prise: AB=OAB = O can hap­pen even when A,B≠OA, B \ne O. For exam­ple, [1111][1−1−11]=O\begin{bmatrix} 1 & 1 \\ 1 & 1 \end{bmatrix}\begin{bmatrix} 1 & -1 \\ -1 & 1 \end{bmatrix} = O.

Exam­ple 3. If A=[31−12]A = \begin{bmatrix} 3 & 1 \\ -1 & 2 \end{bmatrix}, show A2−5A+7I=OA^2 - 5A + 7I = O. First A2=[85−53]A^2 = \begin{bmatrix} 8 & 5 \\ -5 & 3 \end{bmatrix}, and then entry by entry, 8−15+7=08 - 15 + 7 = 0, 5−5=05 - 5 = 0, −5+5=0-5 + 5 = 0, 3−10+7=03 - 10 + 7 = 0. ✓

Exam­ple 4 (an appli­ca­tion). Two shops sell pens, note­books and bags in quan­ti­ties [2015412256]\begin{bmatrix} 20 & 15 & 4 \\ 12 & 25 & 6 \end{bmatrix} at prices [1040300]\begin{bmatrix} 10 \\ 40 \\ 300 \end{bmatrix} rupees. Mul­ti­ply­ing gives the rev­enues: [200+600+1200120+1000+1800]=[20002920]\begin{bmatrix} 200 + 600 + 1200 \\ 120 + 1000 + 1800 \end{bmatrix} = \begin{bmatrix} 2000 \\ 2920 \end{bmatrix}.

Trans­pose

The trans­pose ATA^T turns rows into columns: (AT)ij=aji(A^T)_{ij} = a_{ji}. Its rules are easy to remem­ber: (AT)T=A(A^T)^T = A, (A+B)T=AT+BT(A + B)^T = A^T + B^T, (kA)T=kAT(kA)^T = kA^T, and, with the order reversed, (AB)T=BTAT(AB)^T = B^T A^T.

Try these your­self

  1. Con­struct the 3×23 \times 2 matrix with aij=∣2i−j∣a_{ij} = \lvert 2i - j \rvert.
  2. Find x,y,zx, y, z: [x+y25xz]=[72512]\begin{bmatrix} x + y & 2 \\ 5 & xz \end{bmatrix} = \begin{bmatrix} 7 & 2 \\ 5 & 12 \end{bmatrix} with x=4x = 4.
  3. A=[12−3041]A = \begin{bmatrix} 1 & 2 & -3 \\ 0 & 4 & 1 \end{bmatrix}, B=[201−135]B = \begin{bmatrix} 2 & 0 & 1 \\ -1 & 3 & 5 \end{bmatrix}. Find 2A−3B2A - 3B.
  4. Find XX if 3X+[120−1]=[7−495]3X + \begin{bmatrix} 1 & 2 \\ 0 & -1 \end{bmatrix} = \begin{bmatrix} 7 & -4 \\ 9 & 5 \end{bmatrix}.
  5. Com­pute [13−20][2−145]\begin{bmatrix} 1 & 3 \\ -2 & 0 \end{bmatrix}\begin{bmatrix} 2 & -1 \\ 4 & 5 \end{bmatrix} and [210][3−17]\begin{bmatrix} 2 & 1 & 0 \end{bmatrix}\begin{bmatrix} 3 \\ -1 \\ 7 \end{bmatrix}.
  6. For A=[2312]A = \begin{bmatrix} 2 & 3 \\ 1 & 2 \end{bmatrix}, show A2−4A+I=OA^2 - 4A + I = O.
  7. Ver­ify (AB)T=BTAT(AB)^T = B^TA^T for A=[1−23]A = \begin{bmatrix} 1 \\ -2 \\ 3 \end{bmatrix}, B=[21]B = \begin{bmatrix} 2 & 1 \end{bmatrix}.
  8. If AA is 3×43 \times 4 and BB is 4×24 \times 2, what is the order of ABAB? Is BABA defined?
  9. A fac­tory makes items X and Y using 22 and 33 hours of labour and 44 and 11 kg of mate­r­ial. Labour costs ₹150150 per hour and mate­r­ial ₹6060 per kg. Use matri­ces to find the cost of each item.
  10. Find two non-zero 2×22 \times 2 matri­ces whose prod­uct is OO.

Answers to check against

Show answers
  1. [103254]\begin{bmatrix} 1 & 0 \\ 3 & 2 \\ 5 & 4 \end{bmatrix}.
  2. y=3y = 3, z=3z = 3.
  3. [−44−93−1−13]\begin{bmatrix} -4 & 4 & -9 \\ 3 & -1 & -13 \end{bmatrix}.
  4. X=[2−232]X = \begin{bmatrix} 2 & -2 \\ 3 & 2 \end{bmatrix}.
  5. [1414−42]\begin{bmatrix} 14 & 14 \\ -4 & 2 \end{bmatrix}; [5][5].
  6. A2=[71247]A^2 = \begin{bmatrix} 7 & 12 \\ 4 & 7 \end{bmatrix}; 7−8+1=07 - 8 + 1 = 0, 12−12=012 - 12 = 0, 4−4=04 - 4 = 0.
  7. AB=[21−4−263]AB = \begin{bmatrix} 2 & 1 \\ -4 & -2 \\ 6 & 3 \end{bmatrix}; both sides equal [2−461−23]\begin{bmatrix} 2 & -4 & 6 \\ 1 & -2 & 3 \end{bmatrix}.
  8. 3×23 \times 2; no.
  9. [2431][15060]=[540510]\begin{bmatrix} 2 & 4 \\ 3 & 1 \end{bmatrix}\begin{bmatrix} 150 \\ 60 \end{bmatrix} = \begin{bmatrix} 540 \\ 510 \end{bmatrix}.
  10. For exam­ple, [1000][0001]=O\begin{bmatrix} 1 & 0 \\ 0 & 0 \end{bmatrix}\begin{bmatrix} 0 & 0 \\ 0 & 1 \end{bmatrix} = O.