e.g.
Ax=b
⎣⎢⎡231213101⎦⎥⎤⎣⎢⎡x1x2x3⎦⎥⎤=⎣⎢⎡61418⎦⎥⎤
a1x1+a2x2+a3x3=b
⎣⎢⎡231⎦⎥⎤x1+⎣⎢⎡213⎦⎥⎤x2+⎣⎢⎡101⎦⎥⎤x3=⎣⎢⎡61418⎦⎥⎤
- Solution exists only when b∈Span{a1,a2,a3}
- If a1,a2, and a3 are linearly independent, then unique solution exists
- If a1,a2, and a3 are linearly dependent, then infinitely many solutions exist
Consider x1v1+x2v2+⋯+xpvp=0
Obviously, one solution is x=⎣⎢⎢⎢⎢⎡x1x2⋮xp⎦⎥⎥⎥⎥⎤=⎣⎢⎢⎢⎢⎡00⋮0⎦⎥⎥⎥⎥⎤, which we call a trivial solution
- If trivial solution is the only solution, v1,⋯,vp are linearly independent
- If other non-trivial solution exists, v1,⋯,vp are linearly dependent
Given a set of vectors v1,⋯,vp∈Rn, check if vj can be represented as a linear combination of the previous vectors {v1,v2,⋯,vj−1} for j=1,⋯,p
vj∈Span{v1,v2,⋯,vj−1} for some j=1,⋯,p
- If at least one such vj is found, then {v1,⋯,vp} is linearly dependent
- If no such vj is found, then {v1,⋯,vp} is linearly independent
If v1,⋯,vp are linearly dependent, consider a non-trivial solution
Let's just denote j as the last index then
xjvj=−x1v1−⋯−xj−1vj−1
If xj=0, then vj can be represented as a linear combination of the previous vectors
vj=−xjx1v1−⋯−xjxj−1vj−1∈Span{v1,v2,⋯,vj−1}
If xj=0, then just iterate
x1v1+⋯+xj−1vj−1=0