# Matrix

### What is a Matrix?

A matrix is a rectangular array of numbers (or symbols) arranged in rows and columns. It's commonly denoted by a capital letter. For instance:

$A=\left[\begin{array}{cccc}{a}_{11}& {a}_{12}& \cdots & {a}_{1n}\\ {a}_{21}& {a}_{22}& \cdots & {a}_{2n}\\ & & \ddots & \\ {a}_{m1}& {a}_{m2}& \cdots & {a}_{mn}\end{array}\right]$

Where ${a}_{ij}$ refers to the element in the $i$th row and $j$th column.

### 1. Row Matrix:

• Definition: A matrix with a single row and multiple columns.
• Representation: $\left[{a}_{1},{a}_{2},{a}_{3},\mathrm{.}\mathrm{.}\mathrm{.},{a}_{n}\right]$
• Example: $\left[3,7,5\right]$

### 2. Column Matrix:

• Definition: A matrix with a single column and multiple rows.
• Representation: $\left[\begin{array}{c}{a}_{1}\\ {a}_{2}\\ {a}_{3}\\ \\ {a}_{n}\end{array}\right]$

• Example: $\left[\begin{array}{c}4\\ 8\\ 2\end{array}\right]$

### 3. Square Matrix:

• Definition: A matrix where the number of rows is equal to the number of columns.
• Representation: $n×n$ matrix.
• Example:
$\left[\begin{array}{ccc}2& 5& 7\\ 1& 3& 0\\ 6& 4& 8\end{array}\right]$

### 4. Diagonal Matrix:

• Definition: A square matrix where all elements outside the main diagonal are zero.
• Representation: ${a}_{ij}=0$ for $i\mathrm{\ne }j$.
• Example:
$\left[\begin{array}{ccc}4& 0& 0\\ 0& 9& 0\\ 0& 0& 2\end{array}\right]$

### 5. Identity Matrix:

• Definition: A special diagonal matrix where all diagonal elements are 1 and all other elements are zero.
• Representation: Denoted by $I$ or ${I}_{n}$ for an $n×n$ matrix.
• Example (for a $3×3$ matrix):
$I=\left[\begin{array}{ccc}1& 0& 0\\ 0& 1& 0\\ 0& 0& 1\end{array}\right]$

### 6. Zero Matrix:

• Definition: A matrix where all elements are zero.
• Representation: Denoted by $O$ or ${O}_{m×n}$ for an $m×n$ matrix.
• Example:
$\left[\begin{array}{ccc}0& 0& 0\\ 0& 0& 0\\ 0& 0& 0\end{array}\right]$

### 7. Symmetric Matrix:

• Definition: A square matrix where the transpose of the matrix is equal to itself.
• Representation: $A={A}^{T}$.
• Example:
$\left[\begin{array}{ccc}1& 4& 6\\ 4& 2& 5\\ 6& 5& 3\end{array}\right]$

### 8. Skew-Symmetric Matrix:

• Definition: A square matrix where its transpose is equal to the negative of the matrix.
• Representation: $A=-{A}^{T}$.
• Example:
$\left[\begin{array}{ccc}0& -3& 4\\ 3& 0& -5\\ -4& 5& 0\end{array}\right]$

### 9. Upper Triangular Matrix:

• Definition: A square matrix where all elements below the main diagonal are zero.
• Representation: ${a}_{ij}=0$ for $i>j$.
• Example:
$\left[\begin{array}{ccc}2& 4& 5\\ 0& 9& 1\\ 0& 0& 3\end{array}\right]$

### 10. Lower Triangular Matrix:

• Definition: A square matrix where all elements above the main diagonal are zero.
• Representation: ${a}_{ij}=0$ for $i.
• Example:
$\left[\begin{array}{ccc}1& 0& 0\\ 6& 4& 0\\ 3& 7& 9\end{array}\right]$

### Matrix Operations:

1. Addition: Matrices can be added if they have the same dimensions (same number of rows and columns).

2. Subtraction: Similar to addition, matrices are subtracted element-wise if they have the same dimensions.

3. Scalar Multiplication: Multiplying a matrix by a scalar multiplies each element of the matrix by that scalar.

4. Matrix Multiplication: Not commutative (Order matters). The number of columns in the first matrix must be equal to the number of rows in the second matrix. If $A$ is an $m×n$ matrix and $B$ is an $n×p$ matrix, their product $C=AB$ will be an $m×p$matrix.

5. Transpose: Switches the rows and columns of a matrix.

${A}^{T}=\left[\begin{array}{cc}{a}_{11}& {a}_{21}\\ {a}_{12}& {a}_{22}\end{array}\right]$

### Applications:

• Linear Transformations: Matrices are used to represent and perform transformations in computer graphics, physics, and engineering.

• Solving Systems of Equations: Matrices are used to efficiently solve systems of linear equations.

• Data Representation: Matrices are fundamental in representing and analyzing data in various fields like statistics, machine learning, and image processing.

### Properties:

• Associative: $\left(AB\right)C=A\left(BC\right)$
• Distributive: $A\left(B+C\right)=AB+AC$
• Not Commutative: $AB\mathrm{\ne }BA$ in most cases