Linear Algebra Basics

Math January 15, 2024
linear-algebra fundamentals vectors matrices

Introduction

Linear algebra is the branch of mathematics concerning linear equations, linear maps, and their representations in vector spaces and through matrices.

Vectors

A vector is a mathematical object that has both magnitude and direction. In n-dimensional space, a vector can be represented as:

\[\vec{v} = \begin{pmatrix} v_1 \\ v_2 \\ \vdots \\ v_n \end{pmatrix}\]

Vector Operations

  1. Addition: For vectors $\vec{u}$ and $\vec{v}$: \(\vec{u} + \vec{v} = \begin{pmatrix} u_1 + v_1 \\ u_2 + v_2 \\ \vdots \\ u_n + v_n \end{pmatrix}\)

  2. Scalar Multiplication: For scalar $c$ and vector $\vec{v}$: \(c\vec{v} = \begin{pmatrix} cv_1 \\ cv_2 \\ \vdots \\ cv_n \end{pmatrix}\)

  3. Dot Product: \(\vec{u} \cdot \vec{v} = u_1v_1 + u_2v_2 + \ldots + u_nv_n\)

Matrices

A matrix is a rectangular array of numbers arranged in rows and columns. An $m \times n$ matrix has $m$ rows and $n$ columns.

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

Matrix Operations

  1. Matrix Addition: Matrices must have the same dimensions
  2. Matrix Multiplication: For $A_{m \times n}$ and $B_{n \times p}$, the product $AB$ is an $m \times p$ matrix

Special Matrices

  • Identity Matrix: $I_n$ with 1s on diagonal, 0s elsewhere
  • Zero Matrix: All entries are 0
  • Diagonal Matrix: Non-zero entries only on the main diagonal

Determinants

The determinant is a scalar value that can be computed from a square matrix. For a $2 \times 2$ matrix:

\[\det(A) = \begin{vmatrix} a & b \\ c & d \end{vmatrix} = ad - bc\]

Eigenvalues and Eigenvectors

For a square matrix $A$, a non-zero vector $\vec{v}$ is an eigenvector if:

\[A\vec{v} = \lambda\vec{v}\]

where $\lambda$ is the corresponding eigenvalue.

Applications

Linear algebra has numerous applications:

  • Computer graphics and transformations
  • Machine learning and data science
  • Physics and engineering
  • Economics and optimization

Practice Problems

  1. Find the dot product of $\vec{u} = (3, 4)$ and $\vec{v} = (1, 2)$
  2. Calculate the determinant of $\begin{pmatrix} 2 & 3 \ 1 & 4 \end{pmatrix}$
  3. Verify if $\vec{v} = (1, 1)$ is an eigenvector of $A = \begin{pmatrix} 3 & 1 \ 1 & 3 \end{pmatrix}$