# Chapter 1 Introduction

## 1.1 Learning Objectives

After reading this chapter, you should be able to

(1). define what a matrix is.

(2). identify special types of matrices, and

(3). identify when two matrices are equal.

## 1.2 What does a matrix look like?

Matrices are everywhere. If you have used a spreadsheet such as Excel or written numbers in a table, you have used a matrix. Matrices make presentation of numbers clearer and make calculations easier to program. Look at the matrix below about the sale of tires in a Blowoutr’us store – given by quarter and make of tires.

$\begin{matrix} Tirestone\\ Michigan\\ Copper\\ \end{matrix} \stackrel{\mbox{Q1. Q2. Q3. Q4}}{\begin{bmatrix} 25 & 20 & 3 & 2 \\ 5 & 10 &15 &25 \\ 6 & 16 &7 & 27 \\ \end{bmatrix}}$

If one wants to know how many Copper tires were sold in Quarter 4, we go along the row Copper and column Q4 and find that it is 27.

## 1.3 So, what is a matrix?

A matrix is a rectangular array of elements. The elements can be symbolic expressions or/and numbers. Matrix $$\lbrack A\rbrack$$ is denoted by

$\lbrack A\rbrack = \begin{bmatrix} a_{11} & a_{12} & {.......} & a_{1n} \\ a_{21} & a_{22} & {.......} & a_{2n} \\ \vdots & & & \vdots \\ a_{m1} & a_{m2} & {.......} & a_{{mn}} \\ \end{bmatrix}$

Row $$i$$ of $$\lbrack A\rbrack$$ has $$n$$ elements and is

$\left\lbrack a_{i1}a_{i2}{....}a_{{in}} \right\rbrack$

and column $$j$$ of $$\lbrack A\rbrack$$ has $$m$$ elements and is

$\begin{bmatrix} a_{1j} \\ a_{2j} \\ \vdots \\ a_{{mj}} \\ \end{bmatrix}$

Each matrix has rows and columns and this defines the size of the matrix. If a matrix $$\lbrack A\rbrack$$ has $$m$$ rows and $$n$$ columns, the size of the matrix is denoted by $$m \times n$$. The matrix $$\lbrack A\rbrack$$ may also be denoted by $$\lbrack A\rbrack_{m \times n}$$ to show that $$\lbrack A\rbrack$$ is a matrix with $$m$$ rows and $$n$$ columns.

Each entry in the matrix is called the entry or element of the matrix and is denoted by $$a_{{ij}}$$ where $$i$$ is the row number and $$j$$ is the column number of the element.

The matrix for the tire sales example could be denoted by the matrix [A] as

$\ \lbrack A\rbrack = \begin{bmatrix} 25 & 20 & 3 & 2 \\ 5 & 10 & 15 & 25 \\ 6 & 16 & 7 & 27 \\ \end{bmatrix}$

There are 3 rows and 4 columns, so the size of the matrix is $$3 \times 4$$. In the above $$\lbrack A\rbrack$$ matrix, $$a_{34} = 27$$.

## 1.4 What are the special types of matrices?

Vector: A vector is a matrix that has only one row or one column. There are two types of vectors – row vectors and column vectors.

## 1.5 Row Vector:

If a matrix $$\lbrack B\rbrack$$ has one row, it is called a row vector $$\lbrack B\rbrack = \lbrack b_{1} \;b_{2}\ldots\ldots b_{n}\rbrack\ \$$and $$n$$ is the dimension of the row vector.

### 1.5.1 Example 1

Give an example of a row vector.

Solution

$\lbrack B\rbrack = \lbrack 25\ \ \ 20\ \ \ 3\ \ \ 2\ \ \ 0\rbrack\ \$

is an example of a row vector of dimension 5.

## 1.6 Column vector:

If a matrix $$\lbrack C\rbrack$$ has one column, it is called a column vector

$\lbrack C\rbrack = \begin{bmatrix} c_{1} \\ \vdots \\ \vdots \\ c_{m} \\ \end{bmatrix}$

and $$m$$ is the dimension of the vector.

### 1.6.1 Example 2

Give an example of a column vector.

Solution

$\lbrack C\rbrack = \begin{bmatrix} 25 \\ 5 \\ 6 \\ \end{bmatrix}$

is an example of a column vector of dimension 3.

## 1.7 Submatrix:

If some row(s) or/and column(s) of a matrix $$\lbrack A\rbrack$$ are deleted (no rows or columns may be deleted), the remaining matrix is called a submatrix of $$\lbrack A\rbrack$$.

### 1.7.1 Example 3

Find some of the submatrices of the matrix

$\lbrack A\rbrack = \begin{bmatrix} 4 & 6 & 2 \\ 3 & - 1 & 2 \\ \end{bmatrix}$

Solution

$\begin{bmatrix} 4 & 6 & 2 \\ 3 & - 1 & 2 \\ \end{bmatrix},\ \ \begin{bmatrix} 4 & 6 \\ 3 & - 1 \\ \end{bmatrix},\ \ \begin{bmatrix} 4 & 6 & 2 \\ \end{bmatrix},\left\lbrack 4 \right\rbrack,\begin{bmatrix} 2 \\ 2 \\ \end{bmatrix}$

are some of the submatrices of $$\lbrack A\rbrack$$. Can you find other submatrices of $$\lbrack A\rbrack$$?

## 1.8 Square matrix:

If the number of rows $$m$$ of a matrix is equal to the number of columns $$n$$ of a matrix $$\lbrack A\rbrack$$, that is, $$m = n$$, then $$\lbrack A\rbrack$$ is called a square matrix. The entries $$a_{11},a_{22},...,a_{{nn}}$$ are called the diagonal elements of a square matrix. Sometimes the diagonal of the matrix is also called the principal or main of the matrix.

### 1.8.1 Example 4

Give an example of a square matrix.

Solution

$\lbrack A\rbrack = \begin{bmatrix} 25 & 20 & 3 \\ 5 & 10 & 15 \\ 6 & 15 & 7 \\ \end{bmatrix}$

is a square matrix as it has the same number of rows and columns, that is, 3. The diagonal elements of $$\lbrack A\rbrack$$ are $$a_{11} = 25,\ \ a_{22} = 10,\ \ a_{33} = 7$$.

## 1.9 Upper triangular matrix:

A $$n \times n$$ matrix for which $$a_{{ij}} = 0,\ \ i > j$$ for all $$i,j$$ is called an upper triangular matrix. That is, all the elements below the diagonal entries are zero.

### 1.9.1 Example 5

Give an example of an upper triangular matrix.

Solution

$\lbrack A\rbrack = \begin{bmatrix} 10 & - 7 & 0 \\ 0 & - 0.001 & 6 \\ 0 & 0 & 15005 \\ \end{bmatrix}$

is an upper triangular matrix.

## 1.10 Lower triangular matrix:

A $$n \times n$$ matrix for which $$a_{{ij}} = 0,\ \ j > i$$ for all $$i,j$$ is called a lower triangular matrix. That is, all the elements above the diagonal entries are zero.

### 1.10.1 Example 6

Give an example of a lower triangular matrix.

Solution

$\lbrack A\rbrack = \begin{bmatrix} 1 & 0 & 0 \\ 0.3 & 1 & 0 \\ 0.6 & 2.5 & 1 \\ \end{bmatrix}$

is a lower triangular matrix.

## 1.11 Diagonal matrix:

A square matrix with all non-diagonal elements equal to zero is called a diagonal matrix, that is, only the diagonal entries of the square matrix can be non-zero, ($$a_{{ij}} = 0,\ \ i \neq j$$).

### 1.11.1 Example 7

Give examples of a diagonal matrix.

Solution

$\lbrack A\rbrack = \begin{bmatrix} 3 & 0 & 0 \\ 0 & 2.1 & 0 \\ 0 & 0 & 5 \\ \end{bmatrix}$

is a diagonal matrix.

Any or all the diagonal entries of a diagonal matrix can be zero. For example

$\lbrack A\rbrack = \begin{bmatrix} 3 & 0 & 0 \\ 0 & 2.1 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix}$

is also a diagonal matrix.

## 1.12 Identity matrix:

A diagonal matrix with all diagonal elements equal to 1 is called an identity matrix, ($$a_{{ij}} = 0,\ \ i \neq j$$ for all $$i,j$$ and $$a_{{ii}} = 1$$ for all $$i$$).

### 1.12.1 Example 8

Give an example of an identity matrix.

Solution

$$\lbrack A\rbrack = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ \end{bmatrix}$$

is an identity matrix.

## 1.13 Zero matrix:

A matrix whose all entries are zero is called a zero matrix, ($$a_{{ij}} = 0$$ for all $$i$$ and $$j$$).

### 1.13.1 Example 9

Give examples of a zero matrix.

Solution

$\lbrack A\rbrack = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ \end{bmatrix}$

$\lbrack B\rbrack = \begin{bmatrix} 0 & 0 & 0 \\ 0&0&0 \\ \end{bmatrix}$

$\lbrack C\rbrack = \begin{bmatrix} 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0 \\ \end{bmatrix}$

$\lbrack D\rbrack = \begin{bmatrix} 0 & 0 & 0 \\ \end{bmatrix}$

are all examples of a zero matrix.

## 1.14 Tridiagonal matrices:

A tridiagonal matrix is a square matrix in which all elements not on the following are zero - the major diagonal, the diagonal above the major diagonal, and the diagonal below the major diagonal.

### 1.14.1 Example 10

Give an example of a tridiagonal matrix.

Solution

$\lbrack A\rbrack = \begin{bmatrix} 2 & 4 & 0 & 0 \\ 2 & 3 & 9 & 0 \\ 0 & 0 & 5 & 2 \\ 0 & 0 & 3 & 6 \\ \end{bmatrix}$

is a tridiagonal matrix.

## 1.15 Do non-square matrices have diagonal entries?

Yes, for a $$m \times n$$ matrix $$\lbrack A\rbrack$$ , the diagonal entries are $$a_{11},a_{22}...,a_{k - 1,k - 1},a_{{kk}}$$ where $$k = min\{ m,\ n\}$$.

### 1.15.1 Example 11

What are the diagonal entries of

$\lbrack A\rbrack = \begin{bmatrix} 3.2 & 5 \\ 6 & 7 \\ 2.9 & 3.2 \\ 5.6 & 7.8 \\ \end{bmatrix}$

Solution

The diagonal elements of $$\lbrack A\rbrack$$ are $$a_{11} = 3.2\ and\ a_{22} = 7.$$

## 1.16 Diagonally Dominant Matrix:

A $$n \times n$$ square matrix $$\lbrack A\rbrack$$ is a diagonally dominant matrix if

$$\left| a_{{ii}} \right| \geq \sum_{\begin{matrix} j = 1 \\ i \neq j \\ \end{matrix}}^{n}{|a_{{ij}}|}$$ for $$i = 1,2,.....,n$$ and

$$\left| a_{{ii}} \right| > \sum_{\begin{matrix} j = 1 \\ i \neq j \\ \end{matrix}}^{n}{|a_{{ij}}|}$$ for at least one $$i$$,

that is, for each row, the absolute value of the diagonal element is greater than or equal to the sum of the absolute values of the rest of the elements of that row, and that the inequality is strictly greater than for at least one row. Diagonally dominant matrices are important in ensuring convergence in iterative schemes of solving simultaneous linear equations.

### 1.16.1 Example 12

Give examples of diagonally dominant matrices and not diagonally dominant matrices.

Solution

$\lbrack A\rbrack = \begin{bmatrix} 15 & 6 & 7 \\ 2 & - 4 & - 2 \\ 3 & 2 & 6 \\ \end{bmatrix}$

is a diagonally dominant matrix as

$\left| a_{11} \right| = \left| 15 \right| = 15 \geq \left| a_{12} \right| + \left| a_{13} \right| = \left| 6 \right| + \left| 7 \right| = 13$

$\left| a_{22} \right| = \left| - 4 \right| = 4 \geq \left| a_{21} \right| + \left| a_{23} \right| = \left| 2 \right| + \left| - 2 \right| = 4$

$\left| a_{33} \right| = \left| 6 \right| = 6 \geq \left| a_{31} \right| + \left| a_{32} \right| = \left| 3 \right| + \left| 2 \right| = 5$

and for at least one row, that is Rows 1 and 3 in this case, the inequality is a strictly greater than inequality.

$\lbrack B\rbrack = \begin{bmatrix} - 15 & 6 & 9 \\ 2 & - 4 & 2 \\ 3 & - 2 & 5.001 \\ \end{bmatrix}$

is a diagonally dominant matrix as

$\left| b_{11} \right| = \left| - 15 \right| = 15 \geq \left| b_{12} \right| + \left| b_{13} \right| = \left| 6 \right| + \left| 9 \right| = 15$

$\left| b_{22} \right| = \left| - 4 \right| = 4 \geq \left| b_{21} \right| + \left| b_{23} \right| = \left| 2 \right| + \left| 2 \right| = 4$

$\left| b_{33} \right| = \left| 5.001 \right| = 5.001 \geq \left| b_{31} \right| + \left| b_{32} \right| = \left| 3 \right| + \left| - 2 \right| = 5$

The inequalities are satisfied for all rows and it is satisfied strictly greater than for at least one row (in this case it is Row 3).

$$\left\lbrack C \right\rbrack = \begin{bmatrix} 25 & 5 & 1 \\ 64 & 8 & 1 \\ 144 & 12 & 1 \\ \end{bmatrix}$$

is not diagonally dominant as

$\left| c_{22} \right| = \left| 8 \right| = 8 \leq \left| c_{21} \right| + \left| c_{23} \right| = \left| 64 \right| + \left| 1 \right| = 65$

When are two matrices considered to be equal?

Two matrices [A] and [B] are equal if the size of [A] and [B] is the same (number of rows and columns of [A] are same as that of [B]) and $$a_{{ij}} = b_{{ij}}$$ for all i and j.

### 1.16.2 Example 13

What would make

$\lbrack A\rbrack = \begin{bmatrix} 2 & 3 \\ 6 & 7 \\ \end{bmatrix}$

to be equal to

$\lbrack B\rbrack = \begin{bmatrix} b_{11} & 3 \\ 6 & b_{22} \\ \end{bmatrix}$

Solution

The two matrices $$\lbrack A\rbrack$$and $$\lbrack B\rbrack$$ would be equal if $$b_{11} = 2$$ and $$b_{22} = 7$$.

## 1.18 Introduction Quiz

(1). For an $$n \times n$$ upper triangular matrix $$\left\lbrack A \right\rbrack$$,

(A) $$a_{{ij}} = 0,i > j$$

(B) $$a_{{ij}} = 0,j > i$$

(C) $$a_{{ij}} \neq 0,i > j$$

(D) $$a_{{ij}} \neq 0,j > i$$

(2). Which one of these square matrices is strictly diagonally dominant?

(A) $$\begin{bmatrix} 5 & 7 & 0 \\ 3 & - 6 & 2 \\ 2 & 2 & 9 \\ \end{bmatrix}$$

(B) $$\begin{bmatrix} 7 & - 5 & - 2 \\ 6 & - 13 & - 7 \\ 6 & - 7 & - 13 \\ \end{bmatrix}$$

(C) $$\begin{bmatrix} 8 & - 5 & - 2 \\ 6 & - 14 & - 7 \\ 6 & - 7 & - 13 \\ \end{bmatrix}$$

(D) $$\begin{bmatrix} 8 & 5 & 2 \\ 6 & 14 & 7 \\ 6 & 7.5 & 14 \\ \end{bmatrix}$$

(3). The order of the following matrix is

$\begin{bmatrix} 4 & - 6 & - 7 & 2 \\ 3 & 2 & - 5 & 6 \\ \end{bmatrix}$

(A) $$4 \times 2$$

(B) $$2 \times 4$$

(C) $$8 \times 1$$

(D) not defined

(4). To make the following two matrices equal

$\left\lbrack A \right\rbrack = \begin{bmatrix} 5 & - 6 & 7 \\ 3 & 2 & 5 \\ \end{bmatrix}$

$\left\lbrack B \right\rbrack = \begin{bmatrix} 5 & p & 7 \\ 3 & 2 & 5 \\ \end{bmatrix}$ the value of $$p$$ is

(A) $$- 6$$

(B) $$6$$

(C) $$0$$

(D) $$7$$

(5). For a square $$n \times n$$ matrix $$\left\lbrack A \right\rbrack$$ to be an identity matrix,

(A) $$a_{{ij}} \neq 0,i = j;a_{{ij}} = 0,i = j$$

(B) $$a_{{ij}} = 0,i \neq j;a_{{ij}} = 1,i = j$$

(C) $$a_{{ij}} = 0,i \neq j;a_{{ij}} = i,i = j$$

(D) $$a_{{ij}} = 0,i \neq j;a_{{ij}} > 0,i = j$$

(6). To make the following square matrix to be diagonally dominant, the value of $$p$$needs to be

$\begin{bmatrix} 6 & - 2 & - 4 \\ 7 & 9 & 1 \\ 8 & - 5 & p \\ \end{bmatrix}$

(A) greater than or equal to 13

(B) greater than 3

(C) greater than or equal to 3

(D) greater than 13

## 1.19 Introduction Exercise

(1). Write an example of a row vector of dimension 4.

Answer: $$\begin{bmatrix} 5 & 6 & 2 & 3 \\ \end{bmatrix}$$

(2). Write an example of a column vector of dimension 4.

Answer:$$\ \begin{bmatrix} 5 \\ - 7 \\ 3 \\ 2.5 \\ \end{bmatrix}$$

(3). Write an example of a square matrix of order $$4 \times 4$$.

Answer:$$\ \begin{bmatrix} 9 & 0 & - 2 & 3 \\ - 2 & 3 & 5 & 1 \\ 1.5 & 6 & 7 & 8 \\ 1.1 & 2 & 3 & 4 \\ \end{bmatrix}$$

(4). Write an example of a tri-diagonal matrix of order $$4 \times 4$$.

Answer:$$\ \begin{bmatrix} 6 & 3 & 0 & 0 \\ 2.1 & 2 & 2.2 & 0 \\ 0 & 6.2 & - 3 & 3.5 \\ 0 & 0 & 2.1 & 4.1 \\ \end{bmatrix}$$

(5). Write an example of a identity matrix of order $$5 \times 5$$.

Answer:$$\ \begin{bmatrix} 1 & 0 & 0 & 0 & 0 \\ 0 & 1 & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \\ \end{bmatrix}$$

(6). Write an example of a upper triangular matrix of order $$4 \times 4$$.

Answer:$$\ \begin{bmatrix} 6 & 2 & 3 & 9 \\ 0 & 1 & 2 & 3 \\ 0 & 0 & 4 & 5 \\ 0 & 0 & 0 & 6 \\ \end{bmatrix}$$

(7). Write an example of a lower triangular matrix of order $$4 \times 4$$.

Answer:$$\ \begin{bmatrix} 2 & 0 & 0 & 0 \\ 3 & 1 & 0 & 0 \\ 4 & 2 & 4 & 0 \\ 5 & 3 & 5 & 6 \\ \end{bmatrix}$$

(8). Which of these matrices are strictly diagonally dominant?

1. $$\left\lbrack A \right\rbrack = \begin{bmatrix} 15 & 6 & 7 \\ 2 & - 4 & 2 \\ 3 & 2 & 6 \\ \end{bmatrix}$$

2. $$\left\lbrack A \right\rbrack = \begin{bmatrix} 5 & 6 & 7 \\ 2 & - 4 & 2 \\ 3 & 2 & - 5 \\ \end{bmatrix}$$

3. $$\left\lbrack A \right\rbrack = \begin{bmatrix} 5 & 3 & 2 \\ 6 & - 8 & 2 \\ 7 & - 5 & 12 \\ \end{bmatrix}$$

Answer: (A) Yes (B) No (C) No

(9). Find all the submatrices of

$\lbrack A\rbrack = \begin{bmatrix} 10 & - 7 & 0 \\ 0 & - 0.001 & 6 \\ \end{bmatrix}$

Answer: $$\left\lbrack 10 \right\rbrack$$ $$\left\lbrack - 7 \right\rbrack$$ , $$\left\lbrack 0 \right\rbrack$$, $$\left\lbrack - 0.001 \right\rbrack$$, $$\left\lbrack 6 \right\rbrack$$ $$\begin{bmatrix} 10 \\ 0 \\ \end{bmatrix}$$, $$\begin{bmatrix} - 7 \\ - .001 \\ \end{bmatrix}$$, $$\begin{bmatrix} 0 \\ 6 \\ \end{bmatrix}$$, $$\begin{bmatrix} 10 & - 7 & 0 \\ \end{bmatrix}$$, $$\begin{bmatrix} 0 & - 0.001 & 6 \\ \end{bmatrix}$$, $$\begin{bmatrix} 10 & - 7 \\ 0 & - 0.001 \\ \end{bmatrix}$$,$$\begin{bmatrix} 10 & 0 \\ 0 & 6 \\ \end{bmatrix}$$, $$\begin{bmatrix} - 7 & 0 \\ - 0.001 & 6 \\ \end{bmatrix}$$, $$\left\lbrack 10, - 7 \right\rbrack$$ , $$\left\lbrack 10,0 \right\rbrack$$, $$\left\lbrack - 7,0 \right\rbrack$$ , $$\left\lbrack 0,6 \right\rbrack$$ , $$\left\lbrack 0, - 0.001 \right\rbrack$$, $$\left\lbrack - 0.001,6 \right\rbrack$$.

(10). If

$\lbrack A\rbrack = \begin{bmatrix} 4 & - 1 \\ 0 & 2 \\ \end{bmatrix},$

what are $$b_{11}$$ and $$b_{12}$$ in

$\lbrack B\rbrack = \begin{bmatrix} b_{11} & b_{12} \\ 0 & 4 \\ \end{bmatrix}$

if $$\lbrack B\rbrack = 2\lbrack A\rbrack$$.

Answer:$$\ 8, - 2$$

(11). Are matrix

$\lbrack A\rbrack = \begin{bmatrix} 10 & - 7 & 0 \\ 0 & - 0.001 & 6 \\ \end{bmatrix}$

and matrix

$\lbrack B\rbrack = \begin{bmatrix} 10 & 0 \\ - 7 & - 0.001 \\ 0 & 6 \\ \end{bmatrix}$

equal?

(12). A square matrix $$\lbrack A\rbrack$$ is lower triangular if

1. $$a_{{ij}} = 0$$ for $$i > j$$

2. $$a_{{ij}} = 0$$ for $$j > i$$

3. $$a_{{ij}} = 0$$ for $$i = j$$

4. $$a_{{ij}} = 0$$ for $$i + j = odd\ integer$$

(13). A square matrix $$\lbrack A\rbrack$$ is upper triangular if
1. $$a_{{ij}} = 0$$ for $$i > j$$
2. $$a_{{ij}} = 0$$ for $$j > i$$
3. $$a_{{ij}} = 0$$ for $$i = j$$
$$a_{{ij}} = 0$$ for $$i + j = odd\ integer$$