# Matrices and its Types | Class 12 Maths

A rectangular array in structure with entries is known as Matrix. A matrix has one or more than one number of rows and columns. Each entry in the matrix may contain numbers, alphabets, symbols, etc. Entries in horizontal lines are known as rows and entries in vertical lines are known as columns. Each entry belongs to a row and a column. A matrix is represented by [A]_{m×n} where m is the no of rows and n is the no of columns present in a matrix. and an element of the matrix can be represented as a_{ij} where i and j are the ith row and jth column to which an element belongs. elements where i and j are equal (that is row number and column number is equal) is known as a diagonal element. **Matrix A can be written as:**

**Example of a Matrix **

**Types of T**he M**atrix**

There are many types of matrix. We will discuss one by one:

**Row Matrix**

A matrix that contains only one row and any no of columns is known as a row matrix.

**Example:**

**Column Matrix**

A matrix that contains only one column and any no of rows is known as a column matrix.

**Example:**

**Singleton Matrix**

A matrix which has only one element is known as singleton matrix. In this type of matrix number of columns and the number of rows is equal to 1.

**Example:**

**Rectangular Matrix**

A matrix that does not have an equal number of rows and columns is known as a rectangular matrix. A rectangular matrix can be represented as [A]_{m×n}

**Example:**

**Square Matrix**

A matrix that has an equal number of rows and an equal number of columns is known as a square matrix. Generally, the representation used for the square matrix is [A]_{n×n}.

**Example:**

**Null Matrix**

A matrix having all elements as 0 is known as null matrix.

**Example:**

**Diagonal Matrix**

A matrix that has all elements as 0 except diagonal elements is known as a diagonal matrix.

**Example:**

**Scalar Matrix **

A matrix that has all elements as 0 except diagonal elements and all diagonal elements are the same is known as a scalar matrix. It is a kind of diagonal matrix where all diagonal elements are the same.

**Example:**

**Identity Matrix**

It is a kind of scalar matrix where all the diagonal elements are 1 and all non-diagonal elements are 0. The identity matrix always has an equal number of rows and columns.

**Example:**

**Upper Triangular Matrix**

This matrix is a kind of square matrix that has all elements as 0 below the diagonal.

**Example:**

**Lower Triangular Matrix**

This matrix is a kind of square matrix in which all the elements above the diagonal are 0.

**Example:**

**Trace of a Matrix**

The sum of diagonal elements of a matrix is known as the trace of a matrix. Trace of a matrix A can be represented as tr(A). Trace of a matrix can be calculated for square matrix only.

**Example:**

tr(A)= 15 + 6 + 0 = 21

**Properties of a Trace of Matrix**

**i) Trace of the** **sum of two matrices is equal to sum of trace of individual matrix.**

**Explanation:**

Mathematically it can be written as

tr(A+B) = tr(A) + tr(B)

tr(A)= 15 + 6 + 0 = 21

tr(B)= 4 + 1 + 1 = 6

Now, tr(A)+tr(B)= 21+6 = 27

tr(A + B)= 19 + 7 + 1 = 27You can see,

tr(A) + tr(B) = tr(A + tr(B)Similarly,

tr(A – B) = tr(A) – tr(B)

**ii) Trace of a matrix that is multiplied by some scalar is equal to the multiplication of trace of matrix and scalar.**

**Explanation:**

Mathematically it can be represented as

tr(kA) = k tr(A)

tr(2 × A)= 2 + 14 + 16 = 32

2 × tr(A)= 2 * (1 + 7 + 8)= 32

You can see

tr(2 × A) = 2 × tr(A)

Attention reader! Don’t stop learning now. Join the **First-Step-to-DSA Course for Class 9 to 12 students ****, **specifically designed to introduce data structures and algorithms to the class 9 to 12 students