Skip to content
uencoder

Matrix

A matrix is a rectangular array of numbers supporting addition, subtraction, multiplication, transposition, and inversion; it is the foundation of linear algebra and computer graphics.

Purpose

To represent and manipulate linear transformations and linear systems, central to scientific and engineering computing.

Mechanism

An m×n matrix has m rows and n columns. Multiplication: (AB)[i][j]=ΣA[i][k]B[k][j]. Transposition swaps rows and columns. The inverse A^(-1) satisfies AA^(-1)=I. The determinant det measures invertibility. The Strassen algorithm accelerates multiplication.

Use cases

  • 3D graphics transformations
  • Linear system solving
  • Machine learning (weight matrices)
  • PageRank computation

Examples

  • Input
    [[1,2],[3,4]] × [[5,6],[7,8]]
    Output
    [[19,22],[43,50]]

    Matrix multiplication

Common errors

Assuming matrix multiplication commutes
AB ≠ BA; mind the order

Related terms

Related tools

References