Vectors and Matrices

A vector is an ordered list of numbers used as a point, direction, feature row, coefficient set, or embedding. A matrix is a rectangular array that can store a dataset, a batch of vectors, or a linear map applied through matrix multiplication.

Defining math

A vector has entries . A matrix has entries and maps to :

The dot product

turns vectors into geometry: it defines angles, orthogonality, projections, and many norms and distances. In machine learning, the same object can be read as either data or parameters; a row of is a sample, while a column of in a neural layer is a learned direction.

Worked example

Let and . The self-dot product is the squared Euclidean length,

the matrix-vector product compresses three coordinates into two,

and the first row of the outer product is . That same linear-map view underlies linear algebra, dense layers in neural network fundamentals, and low-dimensional embeddings.

Caveats

Shape errors are semantic errors, not just syntax errors: a feature vector stored as shape can behave differently from a row matrix or column matrix . Units matter too; adding a price feature and an age feature before scaling can make distances meaningless.

References