For a set of vectors { v(1),v(2),...,v(n)} and a set of scalars {α1,α2,...,αn}, where vi∈Rm and αi∈A , linear combination is given by:
i∑αiv(i),αiisscalar=α1v1+α2v2+...+αnvn
For example
v3=v1+2v2=>v3=[v1v2][12]
Matrix multiplications can be interpreted in terms of linear combinations of columns. For example,
v=[v1v2]A=[1234]v×A=[v1+2v23v1+4v2]
Cost
An AXPY opeartion is a linear combination:
w:=α1v1+α2v2+...+αnvn
We note that the linear combination can implemented as n AXPY operations. This suggests that the cost is n times the cost of an AXPY operation with vectors of size m: n×2m=2mn flops and approximately n×3m=3mn memops.
However, one can actually do better. The vector w in the above equation is updated repeatedly. If this vector stays in the L1 cache of a computer, then it need not be repeatedly loaded from memory, and the cost becomes m memops (to load winto cache), and then for each AXPY operation approximately m memops (to read vj, ignoring the cost of reading αj). Then, once w has been completely updated, it can be written back to memory. So, the total cost related to accessing memory becomes m+n×m+m=(n+2)m≈mn memops.
Linear Combination of Unit Basis Vector
Given any x∈Rn, this vector can always be written as the linear combination of the unit basis vectors.
A linear combination of vectors scales the individual vectors and then adds them. Linear combinations are foundational to linear algebra.
Span
Span of a set of vectors is the set of all vectors obtainable by a linear combination of the original vectors. For example, for v1=(1,0)&v2=(0,1), span is given by α1v1+α2v2.
The span of all the columns of a matrix is called the columns space. For example,
123203⟶α1(1,2,3)+α2(2,0,3)
Further, note that, for the equation Ax=b has a solution only if b lies in the columns space of A.
Linear Independence
A set of vectors is linearly independent if none of these vectors can be written as a linear combination of the other vectors.
For example,
v1=(1,0),v2=(0,1) are linearly independent.
v1=(1,0),v2=(0,1),v3=(3,4) are linearly dependent as v3=3v1+4v2.
Mathematically, S={v1,v2,...,vn}is linearly independent if for the following linear combination: