MatricesTopic #6 of 30

Matrix Basics

Matrix notation, types of matrices (square, diagonal, identity, zero), and basic terminology.

Overview

A matrix is a rectangular array of numbers arranged in rows and columns. Matrices are fundamental tools in linear algebra for representing linear transformations and systems of equations.

Definition

An m×nm \times n matrix AA has mm rows and nn columns:

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}

Entry aija_{ij} is in row ii and column jj.

Matrix Notation

NotationMeaning
A=[aij]A = [a_{ij}]Matrix with entries aija_{ij}
Am×nA_{m \times n}m×nm \times n matrix
A(i,j)A(i,j) or aija_{ij}Entry in row ii, column jj
AiA_{i\cdot}ii-th row of AA
AjA_{\cdot j}jj-th column of AA

Types of Matrices

Square Matrix

Number of rows equals number of columns (n×nn \times n).

A=[1234]A = \begin{bmatrix} 1 & 2 \\ 3 & 4 \end{bmatrix}

Row Matrix

Single row (1×n1 \times n):

A=[1234]A = \begin{bmatrix} 1 & 2 & 3 & 4 \end{bmatrix}

Column Matrix

Single column (m×1m \times 1):

A=[123]A = \begin{bmatrix} 1 \\ 2 \\ 3 \end{bmatrix}

Zero Matrix

All entries are zero:

O=[0000]O = \begin{bmatrix} 0 & 0 \\ 0 & 0 \end{bmatrix}

Identity Matrix

Square matrix with 1s on main diagonal, 0s elsewhere:

I2=[1001]I3=[100010001]I_2 = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix} \qquad I_3 = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1 \end{bmatrix}

Property: AI=IA=AAI = IA = A

Diagonal Matrix

Non-zero entries only on main diagonal:

D=[d1000d2000d3]D = \begin{bmatrix} d_1 & 0 & 0 \\ 0 & d_2 & 0 \\ 0 & 0 & d_3 \end{bmatrix}

Main Diagonal

The main diagonal consists of entries aiia_{ii}:

[a11a22a33]\begin{bmatrix} \boxed{a_{11}} & \cdot & \cdot \\ \cdot & \boxed{a_{22}} & \cdot \\ \cdot & \cdot & \boxed{a_{33}} \end{bmatrix}

Trace

For a square matrix AA, the trace is the sum of diagonal entries:

tr(A)=a11+a22++ann=i=1naii\text{tr}(A) = a_{11} + a_{22} + \cdots + a_{nn} = \sum_{i=1}^{n} a_{ii}

Properties of Trace

  • tr(A+B)=tr(A)+tr(B)\text{tr}(A + B) = \text{tr}(A) + \text{tr}(B)
  • tr(cA)=ctr(A)\text{tr}(cA) = c \cdot \text{tr}(A)
  • tr(AB)=tr(BA)\text{tr}(AB) = \text{tr}(BA)

Matrix Equality

Two matrices AA and BB are equal if:

  1. They have the same dimensions (m×nm \times n)
  2. All corresponding entries are equal: aij=bija_{ij} = b_{ij}

Examples

Example 1: Identify Matrix Type

A=[100020003]A = \begin{bmatrix} 1 & 0 & 0 \\ 0 & 2 & 0 \\ 0 & 0 & 3 \end{bmatrix}

This is a:

  • 3×33 \times 3 matrix (square)
  • Diagonal matrix
  • Has trace =1+2+3=6= 1 + 2 + 3 = 6

Example 2: Extract Elements

For matrix:

A=[257413]A = \begin{bmatrix} 2 & 5 & 7 \\ 4 & 1 & 3 \end{bmatrix}

  • a12=5a_{12} = 5
  • a23=3a_{23} = 3
  • First row: [257]\begin{bmatrix} 2 & 5 & 7 \end{bmatrix}
  • Second column: [51]\begin{bmatrix} 5 \\ 1 \end{bmatrix}