Class 12 Maths, Worked in Full Past papersGet updates
Chapter 3 · Matrices

Example 12: Find ABAB

ExamplesMultiplication of matrices · Section 3.4.5
The question

Find AB, if

A=[6923]A = \begin{bmatrix} 6 & 9 \\ 2 & 3 \end{bmatrix}

and

B=[260798].B = \begin{bmatrix} 2 & 6 & 0 \\ 7 & 9 & 8 \end{bmatrix}.
Exam answer

AA is 2×22\times2 and BB is 2×32\times3⁠, so ABAB is defined and is of order 2×32\times3⁠.

Let AB=[cij]AB = [c_{ij}]⁠.

c11=6⋅2+9⋅7=75c12=6⋅6+9⋅9=117c13=6⋅0+9⋅8=72c21=2⋅2+3⋅7=25c22=2⋅6+3⋅9=39c23=2⋅0+3⋅8=24\begin{aligned} c_{11} &= 6{\cdot} 2 + 9{\cdot} 7 = 75 \\ c_{12} &= 6{\cdot} 6 + 9{\cdot} 9 = 117 \\ c_{13} &= 6{\cdot} 0 + 9{\cdot} 8 = 72 \\ c_{21} &= 2{\cdot} 2 + 3{\cdot} 7 = 25 \\ c_{22} &= 2{\cdot} 6 + 3{\cdot} 9 = 39 \\ c_{23} &= 2{\cdot} 0 + 3{\cdot} 8 = 24 \end{aligned}

∴ AB=[7511772253924]\therefore\ AB = \begin{bmatrix} 75 & 117 & 72 \\ 25 & 39 & 24 \end{bmatrix}

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Each entry of a product is one row of the first matrix times one column of the second: pair the entries up in order, multiply each pair, and add. The entry in row ii⁠, column kk of ABAB uses row ii of AA and column kk of BB⁠, and nothing else. For this to work, a row of AA and a column of BB must have the same length, which is why the number of columns of AA must equal the number of rows of BB⁠.

Given, to find, and the plan
Given
AA of order 2×22\times2 and BB of order 2×32\times3⁠.
To find
The product ABAB⁠.
Plan
Check the product is defined and find its order. Then compute the six entries one at a time, each as a row-times-column sum, and assemble them. Finally note why the reverse product BABA does not exist.

Basics you need

1Order of a matrix

"m×nm\times n" means mm rows and nn columns, in that order. AA has 2 rows and 2 columns; BB has 2 rows and 3 columns. Basics: rows, columns and the address

2When a product is defined

ABAB is defined exactly when (columns of AA⁠) = (rows of BB⁠). If AA is m×nm\times n and BB is n×pn\times p⁠, then ABAB is m×pm\times p⁠: the inner sizes must match and the outer sizes give the answer's order.

3Row times column

If A=[aij]A=[a_{ij}] is m×nm\times n and B=[bjk]B=[b_{jk}] is n×pn\times p⁠, the (i,k)(i,k) entry of ABAB is cik=ai1b1k+ai2b2k+⋯+ainbnkc_{ik}=a_{i1}b_{1k}+a_{i2}b_{2k}+\dots+a_{in}b_{nk}⁠. Basics: pair up, multiply, add

Solution

  1. Check that ABAB is defined and find its order

    AA is 2×22\times2 and BB is 2×32\times3⁠. Columns of AA = 2 and rows of BB = 2. These are equal, so ABAB is defined, and its order is (rows of AA⁠) ×\times (columns of BB⁠) =2×3=2\times3⁠.

    Each row of AA has 2 entries and each column of BB has 2 entries, so they pair up exactly with nothing left over. The answer has one entry for every choice of a row of AA (2 choices) and a column of BB (3 choices): 2×3=62\times3=6 entries.
    Definition of the product, Section 3.4.5: A=[aij]m×nA=[a_{ij}]_{m\times n}⁠, B=[bjk]n×pB=[b_{jk}]_{n\times p} gives AB=[cik]m×pAB=[c_{ik}]_{m\times p}⁠. Lesson: matrix multiplication
  2. Row 1 of AA with each column of BB

    Row 1 of AA is [6  9][6\ \ 9]⁠. The columns of BB are (2,7)(2,7)⁠, (6,9)(6,9) and (0,8)(0,8) read from top to bottom. Pair, multiply, add:

    c11=6⋅2+9⋅7=12+63=75c12=6⋅6+9⋅9=36+81=117c13=6⋅0+9⋅8=0+72=72\begin{aligned} c_{11} &= 6\cdot 2 + 9\cdot 7 = 12 + 63 = 75\\ c_{12} &= 6\cdot 6 + 9\cdot 9 = 36 + 81 = 117\\ c_{13} &= 6\cdot 0 + 9\cdot 8 = 0 + 72 = 72 \end{aligned}
    The first entry of the row always pairs with the first (top) entry of the column, and the second with the second. That is why we read each column of BB from top to bottom.
    c1k=a11b1k+a12b2kc_{1k}=a_{11}b_{1k}+a_{12}b_{2k} for k=1,2,3k=1,2,3⁠. Basics: pair up, multiply, add
  3. Row 2 of AA with each column of BB

    Row 2 of AA is [2  3][2\ \ 3]⁠:

    c21=2⋅2+3⋅7=4+21=25c22=2⋅6+3⋅9=12+27=39c23=2⋅0+3⋅8=0+24=24\begin{aligned} c_{21} &= 2\cdot 2 + 3\cdot 7 = 4 + 21 = 25\\ c_{22} &= 2\cdot 6 + 3\cdot 9 = 12 + 27 = 39\\ c_{23} &= 2\cdot 0 + 3\cdot 8 = 0 + 24 = 24 \end{aligned}
    Same columns of BB⁠, new row of AA⁠. The second row of ABAB is built entirely from the second row of AA⁠.
  4. Assemble the product

    Placing each cikc_{ik} in row ii⁠, column kk⁠:

    AB=[7511772253924]AB = \begin{bmatrix} 75 & 117 & 72 \\ 25 & 39 & 24 \end{bmatrix}

    This is 2×32\times3⁠, as Step 1 predicted.

    Checking the order of the finished answer against the prediction is a quick test that no entry has been lost or misplaced.
    6 9 2 3 2 6 0 7 9 8 75 117 72 25 39 24 A (2 × 2) B (2 × 3) AB (2 × 3) Row 1 of A meets column 2 of B: 6 × 6 + 9 × 9 = 36 + 81 = 117, the entry in row 1, column 2
    The product laid out so that each entry sits where its row and column meet: row 1 of AA (gold) and column 2 of BB (blue) give the entry c12=117c_{12}=117 (green). Every other entry is found the same way.
  5. Why BABA is not defined

    For BABA the first factor is BB (2×32\times3⁠) and the second is AA (2×22\times2⁠). Columns of BB = 3 but rows of AA = 2. These differ, so BABA is not defined: a row of BB has 3 entries but a column of AA has only 2, so they cannot be paired.

    This is the textbook's Remark after the example: if ABAB is defined, BABA need not be. In general, for AA of order m×nm\times n and BB of order k×lk\times l⁠, both products exist exactly when n=kn=k and l=ml=m⁠. Here n=k=2n=k=2⁠, but l=3≠m=2l=3\ne m=2⁠.
    The order of the factors matters in matrix multiplication, unlike multiplication of numbers. Lesson: matrix multiplication
Result AB=[7511772253924]AB = \begin{bmatrix} 75 & 117 & 72 \\ 25 & 39 & 24 \end{bmatrix}

a 2×32\times3 matrix, matching the textbook's solution. The product BABA is not defined.

Check it with numbers

Row 1 of AA⁠, [6  9][6\ \ 9]⁠, is exactly 3 times row 2, [2  3][2\ \ 3]⁠. Since row ii of ABAB is made only from row ii of AA⁠, row 1 of ABAB must be 3 times row 2 of ABAB⁠. Indeed 3×25=753\times25=75⁠, 3×39=1173\times39=117 and 3×24=723\times24=72⁠.

Common mistakes
  1. Multiplying entry by entry. ABAB is not [aijbij][a_{ij}b_{ij}]⁠; the two matrices here are not even the same shape. Each entry is a row-times-column sum.
  2. Using a row of BB instead of a column. Always run along the row of the first matrix and down the column of the second.
  3. Getting the order backwards. The order of ABAB is (rows of AA⁠) ×\times (columns of BB⁠), here 2×32\times3⁠, not 3×23\times2⁠.
  4. Assuming BABA exists because ABAB does. It does not here (Step 5).
What to take away
  1. Before multiplying, write the orders side by side: (2×2‾)(2‾×3)(2\times\underline{2})(\underline{2}\times3)⁠. Inner sizes equal means defined; outer sizes give the order of the answer.
  2. Entry (i,k)(i,k) of ABAB = row ii of AA times column kk of BB⁠. There is one such sum for every entry.
  3. Row ii of ABAB depends only on row ii of AA⁠, which gives a quick check whenever rows of AA are related.

Every fact used, and where it comes from

FactUsed inSource
Order m×nm\times n⁠: rows first, then columnsStep 1Section 3.2.1 (Lesson: what a matrix is)
ABAB defined when columns of AA = rows of BB⁠; order m×pm\times pSteps 1 and 5Section 3.4.5 (Lesson: matrix multiplication)
cik=∑jaijbjkc_{ik}=\sum_j a_{ij}b_{jk}Steps 2 and 3Section 3.4.5, definition of the product
Both ABAB and BABA defined iff n=kn=k and l=ml=mStep 5Remark after Example 12, Section 3.4.5
Found an error, or want more?

Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →