Vectors and Linear Combinations
A vector is a list of numbers that behaves like a direction with a length. Adding two of them and scaling one are the only operations linear algebra is built from, and every later object, a constraint, a cost, a basis, is assembled out of those two moves. The dot product turns that geometry into arithmetic: it measures how much of one direction lies along another, which is what lets an optimiser decide where to move without drawing anything.
Definition
A vector
Formal statement
Assumptions and scope
Addition requires both vectors to have the same number of entries. Vectors of different dimensions cannot be added, and the operation is undefined rather than zero-padded.
The dot product is defined between two vectors of equal dimension and returns a scalar, not a vector. Its result carries the units of the two factors multiplied together.
A dot product of zero means orthogonality, not that either vector is zero. Two nonzero vectors can be perpendicular.
Scaling by zero yields the zero vector, which is a legitimate member of the space and is a linear combination of any set. The independence definition depends on that fact.
The norm is nonnegative and is zero only for the zero vector. It measures length, so a comparison of norms is a comparison of magnitudes and says nothing about direction.
Forms this is expressed in
The same content in several forms. Each makes something visible that the others leave implicit, so moving between them is part of understanding the topic rather than a presentation choice.
geometric
A vector read as an arrow rather than a list. Addition becomes placing the second arrow's tail at the first's head; the sum is the arrow from the original tail to the final head.
Scalar multiplication stretches an arrow without turning it, and a negative scalar reverses it along the same line. The translation is mechanical in both directions, which is what later algorithms assume when they speak of moving in a direction.
What the arrow picture does not carry is the arithmetic itself: the dot product is a single number obtained from the lists, and it is the number, not the picture, that decides whether a direction improves an objective. Here it also reports the right angle between the two arrows, which the drawing shows and the arithmetic confirms.
Worked material
Example
Three quantities, three readings
Take
Addition and scaling.
Each is another vector in
A linear combination. With coefficients
The dot product.
One number, not a vector. Its sign says the two vectors broadly agree in direction; had it come out zero they would be perpendicular.
The norm.
A length, so it is never negative, and it says nothing about which way
Non-example
Undefined vector operations
Adding vectors of different dimensions.
A dot product that returns a vector.
Concluding that a zero dot product means a zero vector.
Reading a larger norm as a better direction. The norm measures length only. Scaling a worsening direction makes it longer and no less worsening.
Treating the zero vector as outside the space. It is a perfectly ordinary member, and it is a linear combination of every set, which is the fact the definition of independence is built on.
Contrast
Two products that are easy to confuse
| Dot product | Entrywise product | |
|---|---|---|
| Result | One scalar | A vector |
| Formula | ||
| Answers | How much of one lies along the other | Nothing geometric |
| Used for | Costs, constraint tests, orthogonality | Rescaling data entry by entry |
| Appears in this subject | Constantly | Almost never |
Why the confusion is common. Both are written as a product of two vectors, and a calculator will happily do either. The notation
The test. Ask what the answer is supposed to be. A cost applied to a plan is money, one number. A constraint applied to a point is a quantity to compare with a bound, one number. If the answer should be a single quantity, it is a dot product.
Where the entrywise product does appear. Rescaling: multiplying each entry of a plan by a per-unit factor. That is a legitimate operation and it is never written
Common errors
Common misconception
The dot product of two vectors is another vector, obtained by multiplying them entry by entry.
Related units
Connected
- Linear Independence, Rank, and Bases (part of)
- Half-Spaces and Hyperplanes (part of)
- Matrices as Operators (suggested next)