The span of a set of vectors is every linear combination of them: every point you can reach by scaling and adding.
- Two vectors pointing in different directions span the whole plane.
- Two vectors on the same line (like above) span only that line.
There, was linearly dependent: a combination of the others, adding no new direction. A set where no vector is a combination of the rest is linearly independent.
A basis is an independent set that spans the space, and its size is the dimension. The standard basis of is but any two independent vectors work.
Finding a basis. Write the vectors as the rows of a matrix and eliminate: subtract multiples of one row from the others to create zeros. Rows that become all zero were dependent; the nonzero rows that remain are a basis, and their count is the dimension. For row 2 minus 2 × row 1 gives row 3 minus 3 × row 1 gives and subtracting those leaves So is a basis and the dimension is 2.
Why ML cares: if one feature is a combination of others (height in cm and in inches), the data live in fewer dimensions than there are features. Regression then has no unique answer, and PCA (see Dimensionality reduction) is about finding the dimensions that matter.