Basic Examples
Basic Examples
Test some two-dimensional vectors for linear independence:
In[]:=
Out[]=
True
Test some three-dimensional vectors for linear independence :
In[]:=
Out[]=
True
This set of vectors is linearly dependent:
In[]:=
Out[]=
False
Confirm that the third vector can be written as a linear combination of the first two:
In[]:=
2a-bc
Out[]=
True
LinearlyIndependent
In[]:=
Out[]=
True
Scope
Scope
For vectors with symbolic parameters, may return a :
LinearlyIndependent
In[]:=
Out[]=
ConditionalExpression[True,h≠6]
In[]:=
Out[]=
ConditionalExpression[True,-ceg+bfg+cdh-afh-bdi+aei≠0]
A / result may be obtained by giving values to the parameters:
In[]:=
Out[]=
ConditionalExpression[True,x≠0]
In[]:=
%/.{x->2}
Out[]=
True
LinearlyIndependent accepts vectors with complex components:
In[]:=
Out[]=
True
Properties and Relations
Properties and Relations
A set of vectors is linearly independent if and only if the rank of the row matrix composed of the vectors equals the length of the vectors:
In[]:=
mat=IdentityMatrix[5];[mat]
Out[]=
True
In[]:=
MatrixRank[mat]Dimensions[mat]〚2〛
Out[]=
True
A set of vectors is linearly independent if and only if the rank of the row matrix composed of the vectors has a zero-dimensional null space:
In[]:=
mat=HilbertMatrix[3];[mat]
Out[]=
True
In[]:=
ResourceFunction["Nullity"][mat]
Out[]=
0
Or, alternatively:
In[]:=
Length[NullSpace[mat]]
Out[]=
0
A set of vectors is linearly independent if and only if the rank of the row matrix composed of the vectors has a non-zero determinant:
In[]:=
mat=ToeplitzMatrix[4];[mat]
Out[]=
True
In[]:=
Det[mat]0
Out[]=
False
A set of vectors is linearly independent if and only if its row-reduced form has a no zeros along its diagonal:
In[]:=
mat={{1,2,3},{4,5,6},{7,8,9}};res=RowReduce[mat];res//MatrixForm
Out[]//MatrixForm=
1 | 0 | -1 |
0 | 1 | 2 |
0 | 0 | 0 |
In[]:=
Diagonal[res]
Out[]=
{1,1,0}
In[]:=
Out[]=
False
The zero vector is linearly dependent on every other vector:
In[]:=
Out[]=
False
LinearlyIndependent
In[]:=
Out[]=