Number Representations & States

"how numbers are stored and used in computers"

Matrices

A matrix is a rectangular array of numbers arranged in rows and columns. Matrices are fundamental structures in linear algebra that can represent linear transformations, systems of equations, and data structures.

Click to add points to the 2D plane, then adjust the slider to rotate your polygon.

Points: 0Rotation: 0.0°

Adjust the angle of the rotation.

-180°180°
0.0°
0.000 radians

Add points to see the matrix multiplication.

Click the 2D plane above to add points to a polygon.

Matrix Representation

An m × n matrix A has m rows and n columns:

Matrix Operations

Addition and Subtraction

For matrices of the same size:

Scalar Multiplication

For a scalar c:

Matrix Multiplication

For matrices A (m × n) and B (n × p):

Special Matrices

  1. Square Matrix: Number of rows equals number of columns
  2. Identity Matrix: Square matrix with 1s on diagonal, 0s elsewhere
  3. Diagonal Matrix: Non-zero elements only on diagonal
  4. Symmetric Matrix: Equal to its transpose (A = Aᵀ)
  5. Triangular Matrix: Upper or lower triangular form

Properties

  • Determinant: A scalar value that provides information about the matrix's invertibility and scaling properties
  • Rank: The dimension of the vector space spanned by the matrix's columns
  • Trace: Sum of diagonal elements in a square matrix
  • Inverse: For a square matrix A, matrix A⁻¹ such that AA⁻¹ = A⁻¹A = I

Applications

Matrices are used extensively in:

  • Solving systems of linear equations
  • Computer graphics (transformations)
  • Machine learning (data representation)
  • Quantum mechanics
  • Network analysis
  • Economics (input-output models)

Computational Considerations

The time complexity for common matrix operations:

  • Matrix Addition: O(mn) for m × n matrices
  • Matrix Multiplication: O(mnp) for m × n and n × p matrices
  • Matrix Determinant: O(n³) for n × n matrices
  • Matrix Inverse: O(n³) for n × n matrices

Space complexity is typically O(mn) for an m × n matrix.