# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/mathematics/matrix/matrix-types
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/mathematics/matrix/matrix-types/en.mdx

Learn the main matrix types: row, column, square, triangular, diagonal, identity, zero, and symmetric matrices, with definitions and examples.

---

## Row Matrix

A row matrix is a matrix that consists of only one row.

The order of a row matrix is $$1 \times n$$, where $$n$$ is the number of columns.

Visible text: The order of a row matrix is , where is the number of columns.

Its general form is:

```math
A_{1 \times n} = \begin{bmatrix} a_{11} & a_{12} & \dots & a_{1n} \end{bmatrix}
```

Example:

```math
P = \begin{bmatrix} 3 & -1 & 0 & 7 \end{bmatrix}
```

Matrix $$P$$ is a row matrix of order $$1 \times 4$$.

Visible text: Matrix is a row matrix of order .

## Column Matrix

A column matrix is a matrix that consists of only one column.

The order of a column matrix is $$m \times 1$$, where $$m$$ is the number of rows.

Visible text: The order of a column matrix is , where is the number of rows.

Its general form is:

```math
B_{m \times 1} = \begin{bmatrix} a_{11} \\ a_{21} \\ \vdots \\ a_{m1} \end{bmatrix}
```

Example:

```math
Q = \begin{bmatrix} 2 \\ 5 \\ -4 \end{bmatrix}
```

Matrix $$Q$$ is a column matrix of order $$3 \times 1$$.

Visible text: Matrix is a column matrix of order .

## Square Matrix

A square matrix is a matrix that has the same number of rows and columns.

If $$\text{number of rows} = \text{number of columns} = n$$, then the matrix is of order $$n \times n$$.

Visible text: If , then the matrix is of order .

Its general form is:

```math
A_{n \times n} = \begin{bmatrix}
a_{11} & a_{12} & \dots & a_{1n} \\
a_{21} & a_{22} & \dots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{n1} & a_{n2} & \dots & a_{nn}
\end{bmatrix}
```

In a square matrix, there are:

1. **Main Diagonal** (or Principal Diagonal):

   The elements $$a_{11}, a_{22}, \dots, a_{nn}$$ (i.e., $$a_{ij}$$ where $$i=j$$).

2. **Anti-diagonal** (or Counter-diagonal):

   The elements $$a_{1n}, a_{2,n-1}, \dots, a_{n1}$$ (i.e., $$a_{ij}$$ where $$i+j=n+1$$).

Visible text: 1. **Main Diagonal** (or Principal Diagonal):

 The elements (i.e., where ).

2. **Anti-diagonal** (or Counter-diagonal):

 The elements (i.e., where ).

Example:

```math
M = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9 \end{bmatrix}
```

Matrix $$M$$ is a square matrix of order $$3 \times 3$$. Its main diagonal elements are $$1, 5, 9$$. Its anti-diagonal elements are $$3, 5, 7$$.

Visible text: Matrix is a square matrix of order . Its main diagonal elements are . Its anti-diagonal elements are .

## Rectangular Matrix

A rectangular matrix is a matrix where the number of rows and columns are not equal ($$m \neq n$$).

Visible text: A rectangular matrix is a matrix where the number of rows and columns are not equal ().

General example:

```math
C = \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}
```

Matrix $$C$$ above has $$2$$ rows and $$3$$ columns, so its order is $$2 \times 3$$. Since the number of rows is not equal to the number of columns ($$2 \neq 3$$), matrix $$C$$ is a rectangular matrix.

Visible text: Matrix above has rows and columns, so its order is . Since the number of rows is not equal to the number of columns (), matrix is a rectangular matrix.

Rectangular matrices can be further distinguished into horizontal matrices and vertical matrices.

### Horizontal Matrix

A horizontal matrix is a rectangular matrix with more columns than rows ($$n > m$$).

Visible text: A horizontal matrix is a rectangular matrix with more columns than rows ().

Example:

```math
D = \begin{bmatrix} 1 & 0 & 4 \\ -2 & 3 & 5 \end{bmatrix}
```

Matrix $$D$$ is a horizontal matrix of order $$2 \times 3$$.

Visible text: Matrix is a horizontal matrix of order .

### Vertical Matrix

A vertical matrix is a rectangular matrix with more rows than columns ($$m > n$$).

Visible text: A vertical matrix is a rectangular matrix with more rows than columns ().

Example:

```math
T = \begin{bmatrix} 7 & 1 \\ 0 & -3 \\ 4 & 2 \end{bmatrix}
```

Matrix $$T$$ is a vertical matrix of order $$3 \times 2$$.

Visible text: Matrix is a vertical matrix of order .

## Triangular Matrix

A triangular matrix is a square matrix where the elements below or above the main diagonal are zero.

### Upper Triangular Matrix

An upper triangular matrix is a square matrix where all elements below the main diagonal are zero.

This means $$a_{ij} = 0$$ for every $$i > j$$.

Visible text: This means for every .

Example:

```math
U = \begin{bmatrix} 5 & 2 & -1 \\ 0 & 3 & 7 \\ 0 & 0 & 1 \end{bmatrix}
```

### Lower Triangular Matrix

A lower triangular matrix is a square matrix where all elements above the main diagonal are zero.

This means $$a_{ij} = 0$$ for every $$i < j$$.

Visible text: This means for every .

Example:

```math
L = \begin{bmatrix} 2 & 0 & 0 \\ 4 & 6 & 0 \\ -3 & 1 & 9 \end{bmatrix}
```

## Diagonal Matrix

A diagonal matrix is a square matrix where all elements outside the main diagonal are zero.

This means $$a_{ij} = 0$$ for every $$i \neq j$$. Elements on the main diagonal can be zero or non-zero.

Visible text: This means for every . Elements on the main diagonal can be zero or non-zero.

Example:

```math
X = \begin{bmatrix} 7 & 0 & 0 \\ 0 & -2 & 0 \\ 0 & 0 & 0 \end{bmatrix}
```

Matrix $$X$$ is a diagonal matrix of order $$3 \times 3$$.

Visible text: Matrix is a diagonal matrix of order .

## Identity Matrix

An identity matrix (denoted by $$I$$ or $$I_n$$) is a diagonal matrix where all elements on the main diagonal are $$1$$.

Visible text: An identity matrix (denoted by or ) is a diagonal matrix where all elements on the main diagonal are .

Example:

Component: MathContainer
Children:

```math
I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}
```

```math
I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}
```

The identity matrix acts as the neutral element in matrix multiplication.

## Zero Matrix

A zero matrix (denoted by $$O$$ or $$O_{m \times n}$$) is a matrix where all elements are zero.

Visible text: A zero matrix (denoted by or ) is a matrix where all elements are zero.

Example:

Component: MathContainer
Children:

```math
O_{2 \times 2} = \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}
```

```math
O_{2 \times 3} = \begin{bmatrix} 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix}
```

## Symmetric Matrix

A symmetric matrix is a square matrix that is equal to its transpose ($$A^T = A$$).

Visible text: A symmetric matrix is a square matrix that is equal to its transpose ().

This means the element $$a_{ij} = a_{ji}$$ for all $$i$$ and $$j$$. Its elements are symmetric with respect to the main diagonal.

Visible text: This means the element for all and . Its elements are symmetric with respect to the main diagonal.

Example:

```math
S = \begin{bmatrix} 1 & 7 & -3 \\ 7 & 2 & 0 \\ -3 & 0 & 5 \end{bmatrix}
```

In matrix $$S$$:

Visible text: In matrix :

- $$s_{12} = s_{21} = 7$$
- $$s_{13} = s_{31} = -3$$
- $$s_{23} = s_{32} = 0$$

Visible text: - 
- 
-