Vectors & Matrices

The fundamental building blocks of linear algebra and modern computation.

Vectors

A vector is an ordered list of numbers representing magnitude and direction. In ℝⁿ, vectors can represent points, displacements, or abstract data.

Vector: v = (v₁, v₂, …, vₙ)
Magnitude: ‖v‖ = √(v₁² + v₂² + … + vₙ²)
Dot product: u·v = u₁v₁ + u₂v₂ + … + uₙvₙ
cos θ = (u·v)/(‖u‖·‖v‖)

The magnitude formula generalizes the distance formula from coordinate geometry. The dot product connects to trigonometric functions via the angle between vectors.

Matrices

A matrix is a rectangular array of numbers. An m×n matrix has m rows and n columns.

Identity matrix: I (1s on diagonal, 0s elsewhere)
Transpose: (Aᵀ)ᵢⱼ = Aⱼᵢ
Symmetric: A = Aᵀ

Special matrices: diagonal, upper/lower triangular, symmetric, orthogonal (QᵀQ = I). The identity matrix I acts like 1 in matrix multiplication — similar to how 1 is the multiplicative identity.

Matrix Operations

  1. Addition: (A + B)ᵢⱼ = Aᵢⱼ + Bᵢⱼ (same dimensions required)
  2. Scalar multiplication: (cA)ᵢⱼ = c·Aᵢⱼ
  3. Matrix multiplication: (AB)ᵢⱼ = Σₖ Aᵢₖ·Bₖⱼ (inner dimensions must match)
  4. Inverse: AA⁻¹ = A⁻¹A = I (only for square, non-singular matrices)
Matrix multiplication is not commutative: AB ≠ BA in general. However, it is associative: (AB)C = A(BC). This algebraic structure is fundamental to linear transformations.

Solving Linear Systems

Linear systems Ax = b can be solved via:

  • Gaussian elimination: Row reduce to echelon form
  • pMnGqdfhN+GgXu8gi/tqBkaIBa334JMuyZoCa+uPeJ4Gdp0qRrA8bPWyRqAPbvYvCukfio7k9piJeHYSnGvE59M5fftKopQvHhPYw/Sd22NuNB/+XBPAa+n/w5kxizIZZ3cIH+hRMGDDba1KxelK+HblVVqtGOJhFIawzY1youC0QhS/Y/d+WXs3dD4NCzVQEpi6sDiH7S0lJXH70oeDr+6FeCW4W2/46UkfXYDKcW3dmEhp52a9VefkldUButKPkVP2Bm1ENpT/cqX0au0kKo1KVanrmGzhjqmb1S1PxDFivMp7bBYlp3tKoFVWqpOU9MrzrQporkIouMUOWDO7/KjPQ8zBdHhaulFjIG86p+8ynmASASLpw04OBIyThvNCIsQbbRJIjSdAcNeZivS80Hk2SxPoL4GVVIjDsKlSHlnJFOiJchm/lGT01WW27uDxQk96vZCvGtVaT00zQTEgmvVmULlC8Xyq1N/UQkTttC29QRQPKVkrd+kEqe1YTA0BgvasaVOD6cGlbGPYxU98yxIAdcxa22/e9dIvfCtEemoe/4K4l93liDYb7qE2uHzmW5ray0Db7SuuUsnZTcxh4qpWTXr6m/D6IgFzhiyqjU0DHSLclF/nccZ6ftA6o4HoJ84KVUFUuS2Z0RcIKKy715KYh142PFzA3au1hcleWkQ4ZVlCrOeaao3mBozR3P+6aoW7YY+fKGDU0JKnlQVj/qL3dtpZPOA5AlWRCSLr7IGuWul5pYC4
  • Matrix inverse: x = A⁻¹b (when A is invertible)
  • Cramer's rule: xᵢ = det(Aᵢ)/det(A)

These generalize the methods for solving systems of equations to any number of variables. In regression analysis, the normal equations have the form b = (XᵀX)⁻¹Xᵀy.

FU9mA1qSpAfD6T+veDbChNEDiVvU8Exoa2sa2Tm2g151MZMguPBImD90BdsmkCfPqFz/Asgimuthqaytggk2HDLvai13jrvbsFYEUHnw6tHPYxwQz5IAlVWWKPQmDQTAmaoxzGEcxrf+7UO59KtkZJ9C/euKbReILmp1OL+PefsX01XTP0B/EE2LHQmJH8DIJ7VbiF8aB5UCGy+7TCXXj3aKpH9fPHQMDgHTQMkxqVwQ54GOGZnGxsVie26Ea12edbfHViKyd3FMioZTKArqtQ9yi2wcWH1GTIGRNPWFZF0TGfeVv9PPnad9otuZZ72XYj/xMDStbgJNXxmBInGXE1u1N2ddbo0E4/guoTvA3LebNGc0Wm/FP0k4SU+28bf/9orgn6vyr4IiS7E/Vv0U4fI7XwKK+Snzc1qKEXy2kg0VKbgCaX+rycWmKFjYVZCcwHdk8X5ilxXVleO43cu7KtFy84daFLmGJbgqJ6cMlpOcqID/QU4zhY9flMqz4Wy02Ciw80raZxxH0cAytQy0oe2ZD3NsjuF6P8a257AUjNkxQNoG8ZLubnsjsXkRkhFsigy7DqBA5/SHn6ZY+D2Yq/4kn2CrMwvzgwZKUYwTo78r9aq32/g4PDH6z66ZrSIAnbVaYLWnQW1Hjh0AKbz8rhu6cPvZAhN09Uq97DF5vPcqp+dKkwAktgIZyfkkMOlRLucQG7Bz7ntBywOIk3giKN2TyWXNpgiSRq9fDB7DRXo+5otrjH1

Determinants

2×2: det(A) = ad − bc
3×3: cofactor expansion along any row/column
Properties: det(AB) = det(A)·det(B), det(Aᵀ) = det(A)

The determinant encodes whether a matrix is invertible (det ≠ 0), the scaling factor of the associated transformation, and the signed volume of the parallelepiped formed by column vectors.

xBZqdZD2quD3xeOW7ViknHBLzDfNWWdsS5wiT0MoGARxJsm+fkMNmy96s2M+W3yBt8r2mgZ+8kK9TR71rw9T6BeOjvqVAPsG8DkbHZKU6dUvYz9+J3ADL2VHZ94Z4J4aL4CQ5TKoVAqCsPLmSamFd+mtMYCMIrNWSqEJ3xs7W+Lk4FmLdCJnryR02X700fz6Wz/kavnfPt7NeQpduxeWwYyyEdwU54xCi+Dbvt98YN0ADnEGQYUBZCUH/6deXiYlg4soY3osNkZkhaAoP587LVxomFFNpe2DZ2BnwnAxavK/9FND+m/3e6DivVlCcOlw1FWlXQ/8QVr82NQgmSvMen5/sIDNn9vO9xD8Z8lH0GXzZZFbeJBJl/0kCkbXMGgFh4s44yqaMFK7iGd6a0z+PrFZLAa5KILVjxbnsvSWOQLD5P6vzQQ0LXyErCRLaClXqt0a5oqGccvPeADHMRO16GtNcUPj20vq6fmDYkKUcfAz2QfjTLUBZIHF/bgz4dSh4TD2HFSkLylqJbqnVePHklWZKUURNkXGTtsh8Apw9wM6JiRSQjHM1IB3LRexThjqiuC8ADxwahSlRQu2nKvykA5WqUsSqbqxOa3VGKgiQVev95d1JxMwECM7NZKny7ROPH3qIcvxz8U3/oR2HKdi9GHbejvr6GQsmu3SVIB87Su5mIy0gUcykTJ4o8MXWFWN3dexqe/uiRT8LVfvLtUR640dwhbRu9DPZEfg0WDDdE+cchUX0aPC