Skip to main content

Introduction to Matrices

Matrix

A matrix (plural: matrices) is a rectangular arrangement of numbers, symbols, or expressions organized into rows and columns.

For example,

A=[123456] A= \begin{bmatrix} 1 & 2 & 3 \\ 4 & 5 & 6 \end{bmatrix}
  • It has 2 rows.
  • It has 3 columns.
  • So it is called a 2×32 \times 3 matrix rows×columnsrows × columns.

General form

A matrix with mm rows and nn columns is written as

A=[a11a12a1na21a22a2nam1am2amn] A= \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n}\\ a_{21} & a_{22} & \cdots & a_{2n}\\ \vdots & \vdots & \ddots & \vdots\\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix}

where:

  • mm = number of rows
  • nn = number of columns
  • aija_{ij} is the element in the ii-th row and jj-th column.

Example

Consider

B=[789101112] B= \begin{bmatrix} 7 & 8\\ 9 & 10\\ 11 & 12 \end{bmatrix}
  • Order: 3×23 \times 2
  • b11b_{11}=7
  • b23=, b_{23}=,does not exist (there are only 2 columns)
  • b32=12b_{32}=12

Why are matrices useful?

Matrices are used to:

  • Solve systems of linear equations.
  • Represent and transform geometric objects (e.g., rotate, scale, translate points in computer graphics).
  • Organize and analyze data.
  • Represent networks and graphs.
  • Perform computations in machine learning and artificial intelligence.

Common types of matrices

TypeExample
Row matrix[123]\begin{bmatrix}1 & 2 & 3\end{bmatrix}
Column matrix[123]\begin{bmatrix}1\\2\\3\end{bmatrix}
Square matrix[1234]\begin{bmatrix}1&2\\3&4\end{bmatrix}
Zero matrix[0000]\begin{bmatrix}0&0\\0&0\end{bmatrix}
Identity matrix[1001]\begin{bmatrix}1&0\\0&1\end{bmatrix}
Diagonal matrix[2005]\begin{bmatrix}2&0\\0&5\end{bmatrix}

In simple terms, a matrix is like a table of values. Just as a spreadsheet stores data in rows and columns, a matrix stores numbers in rows and columns, but with mathematical rules that allow you to perform operations such as addition, multiplication, finding inverses, and solving equations.