# Introduction To Matrices

Go back to  'Determinants and Matrices'

A matrix is a rectangular array of numbers.

$M=\left[ \begin{matrix} {{a}_{11}} & {{a}_{12}} & {{a}_{13}} & \cdots & {{a}_{1n}} \\ {{a}_{21}} & {{a}_{22}} & {{a}_{23}} & \cdots & {{a}_{2n}} \\ \vdots & \vdots & \vdots & {} & \vdots \\ {{a}_{m1}} & {{a}_{m1}} & {{a}_{m3}} & \cdots & {{a}_{mn}} \\\end{matrix} \right]\text{An}\ m\times n\ \text{matrix}$

A matrix with m = n is a sqaure matrix. For square matrices, we can define the corresponding determinants.

In the discussion that follows, an m × n matrix A will be denoted as $$A=\left[ {{a}_{ij}} \right]$$ . The index i will vary from 1 to m, while j will vary from 1 to n. The element $${{a}_{ij}}$$ is the element in the ith row and the jth column.

(a) Sum/Difference of matrices : If we have two matrices A and B of the same order m × n, their sum/ difference is given by adding/subtracting the corre sponding elements:

\begin{align} A\pm B&=\left[ {{a}_{ij}} \right]\ \pm \ \left[ {{b}_{ij}} \right] \\ & =\left[ {{a}_{ij}}\pm {{b}_{ij}} \right] \\ \end{align}

For example,

$\left[ \ \begin{matrix} 1 & -2 \\ 3 & \ \ 4 \\ 5 & -3 \\\end{matrix}\ \right]\ \ +\ \ \left[ \begin{matrix} \ \ 2 & \ 1 \\ -1 & \ 3 \\ \ \ 4 & \ 2 \\\end{matrix}\ \right]\ \ =\ \left[ \ \begin{matrix} 3 & \ -1 \\ 2 & \ \ \ 7 \\ 9 & \ -1 \\\end{matrix}\ \right]\$

(b) Scalar multiplication : If we multiply a matrix $$A=[{{a}_{ij}}]\ \text{by}\ \lambda ,$$ we get the matrix $$\lambda A=[\lambda {{a}_{ij}}].\$$

Example:

$4\left[ \ \begin{matrix} 1 & 3 & \ \ 2 \\ 2 & 1 & -1 \\\end{matrix}\ \right]\ \ =\ \ \left[ \ \begin{matrix} 4 & 12 & \ \ 8 \\ 8 & 4 & -4 \\\end{matrix}\ \right]$

(c) Multiplication of matrices: To  understand how matrices are multiplied, let us first consider a row vector

R=\left[ {{r}_{1}}\ {{r}_{2}}...{{r}_{n}} \right]\ \ \ \ \ \ \left\{ \begin{align} & \text{A row vector is matrix} \\ & \text{with just one row} \\ \end{align} \right\}

and a column vector

C=\left[ \begin{align} \; \ {{c}_{1}} \;\\ \; \ {{c}_{2}} \; \\ \; \ \ \vdots \; \ \\ \; \ {{c}_{n}} \;\ \\ \end{align} \right]\ \ \ \qquad \left\{ \begin{gathered} \text{A column vector is a matrix } \\ \!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\!\text{with just one column} \\ \end{gathered} \right\}

which are both of order n. The product of R and C can be defined as

RC=\left[ {{r}_{1}}\ \ {{r}_{2}}\ \ ...\ {{r}_{n}} \right]\ \left[ \begin{align} & \ {{c}_{1}} \\ & \ {{c}_{2}} \\ & \ \ \vdots \ \\ & \ {{c}_{n}}\ \\ \end{align} \right]\ ={{r}_{1}}{{c}_{1}}+{{r}_{2}}{{c}_{2}}+...+{{r}_{n}}{{c}_{n}}

Therefore, RC is a scalar quantity. For example,

\left[ 1\ \ 3\ \ 2 \right]\ \ \left[ \begin{align} & \ \ 2 \\ & -1 \\ & \ \ 4 \\ \end{align} \right]=7

Now, we will discuss matrix multiplication. It will soon become evident that to multiply two matrices A and B to find AB, the number of columns in A should equal the number of rows in B.

Let A be of order m × n and B be of order n × p. The matrix AB will be of order m × p and will be obtained by multiplying each row vector of A successively with column vectors in B. Let us understand this using a concrete example:

$A=\left[ \begin{matrix} {{a}_{1}} & {{a}_{2}} & {{a}_{3}} \\ {{b}_{1}} & {{b}_{2}} & {{b}_{3}} \\ {{c}_{1}} & {{c}_{2}} & {{c}_{3}} \\\end{matrix} \right]B=\left[ \begin{matrix} {{\alpha }_{1}} & {{\beta }_{1}} \\ {{\alpha }_{1}} & {{\beta }_{2}} \\ {{\alpha }_{3}} & {{\beta }_{3}} \\\end{matrix} \right]$

To obtain the element a11 of AB, we multiply R1 of A with C1 of B :

To obtain the element  $${{a}_{12}}\ \text{of}\ AB,$$ we multiply R1 of A with C2 of B:

To obtain the element $${{a}_{21}}\ \text{of}\ AB,$$ we multiply R2 of A with C1 of B:

Proceeding this way, we obtain all the elements of AB.

Let us generalize this: if A is or order m × n, and B of order n × p, then to obtain the element aij in AB, we multiply Ri in A with Cj in B:

Example - 20

If $$A=\left[ \begin{matrix} 2 & 1 & 4 \\ 3 & 2 & 1 \\\end{matrix} \right]\ \text{and}\ B=\left[ \begin{matrix} \ \ 2 & 0 \\ -1 & 1 \\ \ 4 & 3 \\\end{matrix} \right],\ \text{find}\ AB\ \text{and}\ BA$$

Solution: Since A is of order 2 × 3, and B is of order 3 × 2, AB is defined and will be of order 2 × 2. BA is also defined, and will be of order 3 × 3.

\begin{align} & \mathbf{AB} \\ \\ && \left[ \begin{matrix} 2 & 1 & 4 \\ 3 & 2 & 1 \\\end{matrix} \right]\ \ \left[ \begin{matrix} \ \ 2 & 0 \\ -1 & 1 \\ \ \ 4 & 3 \\\end{matrix} \right]\ \ =\ \ \left[ \begin{matrix} 19 & 13 \\ 8 & 5 \\\end{matrix} \right] \\ \\ \\ & \mathbf{BA} \\ \\ && \left[ \begin{matrix} \ \ 2 & 0 \\ -1 & 1 \\ \ \ 4 & 3 \\\end{matrix} \right]\ \ \left[ \ \begin{matrix} 2 & 1 & 4 \\ 3 & 2 & 1 \\\end{matrix}\ \right]\ \ \ \ =\ \ \left[ \ \begin{matrix} 4 & 2 & \ \ 8 \\ 1 & 1 & -3 \\ 17 & 10 & 19 \\\end{matrix}\ \right] \\ \end{align}

This calculation should have made it clear to you that AB is in general not equal to BA, that is, multiplication of matrices is non-commutative operation

Another fact that is extremely important to note is that for three matrices A, B, C,

$\boxed {AB=AC\ \text{does not imply }B=C}$

As a simple example:

\begin{align} & \left[ \ \begin{matrix} 3 & 1 & 6 \\ 1 & 3 & 2 \\ 2 & 5 & 4 \\\end{matrix}\ \right]\ \ \left[ \ \begin{matrix} 2 \\ 0 \\ 0 \\\end{matrix}\ \right]=\left[ \ \begin{matrix} 6 \\ 2 \\ 4 \\\end{matrix}\ \right] \\ \\ &\qquad \qquad \qquad \text{and} \\ \\ & \left[ \ \begin{matrix} 3 & 1 & 6 \\ 1 & 3 & 2 \\ 2 & 5 & 4 \\\end{matrix}\ \right]\ \ \left[ \ \begin{matrix} 0 \\ 0 \\ 1 \\\end{matrix}\ \right]=\left[ \ \begin{matrix} 6 \\ 2 \\ 4 \\\end{matrix}\ \right] \\ \end{align}

Let us now write matrix multiplication in more fomral notation, something that will help us in proving more advanced properties pertaining to matrix multiplication.

Let \begin{align}A={{[{{a}_{ij}}]}_{m\times n}},B={{[{{b}_{ij}}]}_{n\times p}}\ \text{and}\ C={{[{{c}_{ij}}]}_{m\times p}} \end{align} be such that AB = C. As we have seen earlier, $${{C}_{ij~}}$$ is obtained by multiplying $${{R}_{i}}$$ of A with $${{C}_{j~}}$$ of B :

\begin{align} {{C}_{ij}}&=\left( {{R}_{1}}\ \text{of}\ A \right)\times \left( {{C}_{j}}\ \text{of}\ B \right) \\\\ & =\left[ {{a}_{i1}},{{a}_{i2}}...{{a}_{in}} \right]\ \ \left[ \begin{array} \; {{b}_{ij}}\; \\ \; {{b}_{ij}}\; \\ \ \vdots \\ \; {{b}_{nj}} \; \\ \end{array} \right] \\ \\ & ={{a}_{i1}}{{b}_{ij}}+{{a}_{i2}}{{b}_{ij}}+...+{{a}_{in}}{{b}_{nj}} \\ \\ & =\sum\limits_{k=1}^{n}{{{a}_{ik}}{{b}_{kj}}} \\ \end{align}

Hence, we can write matrix C as

$C=\left[ {{c}_{ij}} \right]=\left[ \sum\limits_{k=1}^{n}{{{a}_{ik}}{{b}_{kj}}} \right]$

Now, consider three matrices

$A={{\left[ {{a}_{ij}} \right]}_{\ m\times n}},B={{\left[ {{b}_{ij}} \right]}_{\ n\times p}},C={{\left[ {{c}_{ij}} \right]}_{\ p\times q}}$

Let us define the product (AB) C :

$\left( AB \right)C=\left[ \sum\limits_{k=1}^{n}{{{a}_{ik}}{{b}_{kj}}} \right]\times C$

Note that in \begin{align}AB,\sum\limits_{k=1}^{n}{{{a}_{ik}}{{b}_{kj}}}\end{align} is just one of the elements, precisely the element at the position $$\left( i,j \right)$$. Since AB is of order $$m\times p$$ and C of order $$\left( m,q \right)$$.

Let us denote the positive in $$\left( AB \right)C$$ using $$\left( x,y \right)$$ to avoid confusion. The element $$\left( x,y \right)$$ at will be obtained by multiplying the $${{x}^{\text{th}}}$$ row in AB with the $${{y}^{\text{th}}}$$ row in C.

The elements of  $${{x}^{\text{th}}}$$ the row in AB are:

\begin{align}\sum\limits_{k=1}^{n}{{{a}_{xk}}{{b}_{k1}}},\ \sum\limits_{k=1}^{n}{{{a}_{xk}}{{b}_{k2}}},\sum\limits_{k=1}^{n}{{{a}_{xk}}{{b}_{k3}}},....\sum\limits_{k=1}^{n}{{{a}_{xk}}{{b}_{kp}}} \end{align}

The elements of $${{y}^{\text{th}}}$$ the column in C are :

\left[ \begin{align} & {{C}_{1y}} \\ & {{C}_{2y}} \\ & \ \ \vdots \\ & {{C}_{py}} \\ \end{align} \right]

Therefore. the term at $$\left( x,y \right)\text{in}\left( AB \right)C$$ is

\begin{align} & {{c}_{iy}}\left( \sum\limits_{k=1}^{n}{{{a}_{xk}}{{b}_{k1}}} \right)+{{c}_{2y}}\left( \sum\limits_{k=1}^{n}{{{a}_{xk}}{{b}_{k2}}} \right)+...+{{c}_{py}}\left( \sum\limits_{k=1}^{n}{{{a}_{xk}}{{b}_{kp}}} \right) \\\\ & =\sum\limits_{k=1}^{n}{\left( {{a}_{xk}}{{b}_{k1}}{{c}_{1y}}+{{a}_{xk}}{{b}_{k2}}{{c}_{2y}}+...+{{a}_{xk}}{{b}_{kp}}{{c}_{py}} \right)} \\\\ & =\sum\limits_{l=1}^{p}{\sum\limits_{k=1}^{n}{\left( {{a}_{xk}}{{b}_{kl}}{{c}_{ly}} \right)}} \\ \end{align}

If $$D=\left( AB \right)C,$$ then

$D={{\left[ {{d}_{xy}} \right]}_{m\times q}}=\left[ \sum\limits_{l=1}^{p}{\sum\limits_{k=1}^{n}{\left( {{a}_{xk}}{{b}_{kl}}{{c}_{ly}} \right)}} \right]$

Note (very) carefully that we can interchanging the order of summation above, by first summing over the index l, and then the index k.

\begin{align} D&=\left[ \sum\limits_{k=1}^{n}{\sum\limits_{l=1}^{p}{\left( {{a}_{xk}}{{b}_{kl}}{{c}_{ly}} \right)}} \right] \\ \\ & =\left[ \sum\limits_{k=1}^{n}{\left( {{a}_{xk}} \right)}\left( \sum\limits_{l=1}^{p}{{{b}_{kl}}{{c}_{ly}}} \right) \right] \\ \\ & =A\left( BC \right) \\ \end{align}

This is an important result : we have shown that matrix multiplication is associative :

$\boxed {D=\left( AB \right)C=A\left( BC \right)}$

It will be a good exercise to verify this fact using a numerical example.

Example - 21

Let

$A=\left[ \begin{matrix} 1 & 2 & 3 \\ 3 & 1 & 0 \\\end{matrix} \right],\ B=\left[ \begin{matrix} 1 & \ \ 4 \\ 3 & -1 \\ 2 & -3 \\\end{matrix} \right],\ C=\left[ \begin{matrix} 2 & 1 & 4 & 3 \\ -1 & 0 & 3 & 1 \\\end{matrix} \right]$

Evaluate (AB) C and A (BC) and verify that they are the same.

Solution: The orders of A, B, C are 2 × 3, 3 × 2 and 2 × 4.

\begin{align}AB&=\left[ \begin{matrix} 1 & 2 & 3 \\ 3 & 1 & 0 \\\end{matrix} \right]\ \ \left[ \begin{matrix} 1 & \ \ 4 \\ 3 & -1 \\ 2 & -3 \\\end{matrix} \right]=\left[ \begin{matrix} 13 & -7 \\ 6 & 11 \\\end{matrix} \right]\\\\ \left( AB \right)C&=\left[ \begin{matrix} 13 & -7 \\ 6 & 11 \\\end{matrix} \right]\ \ \left[ \begin{matrix} 2 & 1 & 4 & 3 \\ -1 & 0 & 3 & 1 \\\end{matrix} \right]=\left[ \begin{matrix} 33 & 13 & 31 & 32 \\ 1 & 6 & 57 & 29 \\\end{matrix} \right]\\\\ BC&=\left[ \begin{matrix} 1 & 4 \\ 3 & -1 \\ 2 & -3 \\\end{matrix} \right]\ \ \left[ \begin{matrix} 2 & 1 & 4 & 3 \\ -1 & 0 & 3 & 1 \\\end{matrix} \right]=\left[ \begin{matrix} -2 & 1 & 16 & 7 \\ \begin{gathered} 7 \\ 7 \\ \end{gathered} & \begin{gathered} 3 \\ 2 \\ \end{gathered} & \begin{gathered} \ \ 9 \\ -1 \\ \end{gathered} & \begin{gathered} 8 \\ 3 \\ \end{gathered} \\\end{matrix} \right]\\\\ A\left( BC \right)&=\left[ \begin{matrix} 1 & 2 & 3 \\ 3 & 1 & 0 \\\end{matrix} \right]\ \ \left[ \begin{matrix} -2 & 1 & 16 & 7 \\ 7 & 3 & 9 & 8 \\ 7 & 2 & -1 & 3 \\\end{matrix} \right]=\left[ \begin{matrix} 33 & 13 & 31 & 32 \\ 1 & 6 & 57 & 29 \\\end{matrix} \right] \end{align}

As expected, (AB) C and A (BC) are the same.

Example - 22

Let $$I$$  be a sqaure matrix of order n × n :

I=\left[ \begin{matrix} 1 & 0 & 0 & \cdots & \cdots \\ 0 & 1 & 0 & \cdots & \cdots \\ 0 & 0 & 1 & \cdots & \cdots \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ \vdots & \vdots & \vdots & {} & \vdots \\\end{matrix} \right] \qquad \left\{ \begin{align} & \text{All elements are zero except the } \\ & \text{diagonal elements which are 1} \\ \end{align} \right\}

Let A be a sqaure matrix of order $$n\times n.$$ Find

$\left( \text{a} \right) \;AI \qquad \qquad \left( \text{b}\right) \;IA$

Solution: (a) Consider an elemnet  $${{a}_{ij}}$$ in A. Let us consider what happens to this element when A is multiplied by $$I$$ . To evaluate the element at  $$\left( i,j \right)$$ in $$AI$$ , we multiply $${{R}_{i}}$$ in A by Cj in $$I$$  :

Therefore, $${{a}_{ij}}$$ is unaltered! This happens for each element in A, and thus $$AI=A$$

(b) Similarly, $$IA=A$$

Since $$AI=IA=A$$ , the matrix $$I$$ is termed the identity matrix (or order n × n) . Multiplying $$I$$ with any matrix (of the same order) leaves that matrix unaltered.

Lets say A is of order m × n. We can still define $$AI$$, but not $$IA$$, when $$I$$  is of order n × n. Note that even now.$$AI$$ is the same as A.

The determinant of  $$I$$  is always 1 verfify. Verify this.

Learn math from the experts and clarify doubts instantly

• Instant doubt clearing (live one on one)
• Learn from India’s best math teachers
• Completely personalized curriculum