Processing math: 100%
Skip to main content

1.6 Linear Independence and Dependence of vectors,Linear combination

Occasionally we have a set of vectors and we need to determine whether the vectors are linearly independent of each other. This may be necessary to determine if the vectors form a basis, or to determine how many independent equations there are.In order to define linear dependence and independence let farther clarify what is a linear combination.

Linear Combination

Consider a vector space V and a finite number of vectors x1,x2,,xkV. Then every vV of the form.
v=λ1x1++λkxk=ki=1λixiV

with λ1,,λkR is a linear combination of vectors x1,,xk.


For example, if V={[1,2],[2,1]}, then 2x1x2=2([1,2])[2,1]=[0,3]
is linear combination of the vectors in V.

Linear Independence
Let us consider a vector space V with kN and x1,,xkV. If there is a non trivial linear combination such that 0=ki=1λixi with at least one λi0, the vectors x1,,xk are linearly dependent.

If only the trivial solution exist, i.e; λ1==λk=0, the vectors x1,,xk are linearly independent.

A set V of k-dimensional vectors is linearly independent if the only linear combination of vectors in V that equals 0 is the trivial linear combination.

The set of vectors
V={[1,0],[0,1]}

is linearly independent. Let prove this claim. We need to find constants λ1 and λ1 satisfying
λ1([1,0])+λ2([0,1])=[0,0]

solving this system of equations gives that [λ1,λ2]=[0,0]λ1=λ2=0, in turn this implies that the set of vectors is linearly independent.

Linear independence is one of the most important concepts in linear algebra. Intuitively, a set of linearly independent vectors consists of vectors that have no redundancy, i.e., if we remove any of those vectors from the set, we will lose something.

A set V of k-dimensional vectors is linearly dependent if there is a nontrivial linear combination of the vectors in V that adds up to 0

The set of vectors
V={[1,2],[2,4]}

is linearly dependent set of vectors. Let see how.
λ1([1,2])+λ2([2,4])=[0,0]
There is a nontrivial linear combination with λ1=2 and λ2=1 that yields 0. This implies that they are linearly dependent set of vectors. It's easy in this case to spot linear dependence by first glance, as the second vector is 2 times the first vector, which indicates linear dependence.

The following properties are useful to find out whether vectors are linearly independent
  • k vectors are either linearly dependent or linearly independent.There is no third option.
  • if at least one of the vectors x1,,xk is 0 then they are linearly dependent.The same holds if two vectors are identical.
  • The vectors {x1,,xk:xi0,i=1,,k},k2 are linearly dependent if and only if(at least) one of them is a linear combination of others.In particular, if one vector is a multiple of another vector i.e, xi=λxj,λR then the set {x1,,xk:xi0,i=1,,k} is  linearly dependent.
A practical way of checking whether vectors x1,,xkV are linearly independent is to use Gaussian elimination: Write all vectors as columns of a matrix A and perform Gaussian elimination until the matrix  is in row echelon form.
-The pivot columns indicate the vectors, which are linearly independent of the vectors on the left.  
     Note   that there is an ordering of vectors when the matrix is built.
- The non-pivot columns can be expressed as linear combinations of the pivot columns on their left. For instance, the row-echelon form

tells us that  the first and third columns are pivot columns. The second column is a non-pivot column because it is three times the first column.All column vectors are linearly independent if and only if all columns are pivot columns. If there is at least one non-pivot column, the columns (and, therefore, the corresponding vectors) are linearly dependent.

Eg: Lets consider three vectors x1=[2,1,3]x2=[1,1,2]x3=[3,3,8]
Use sympy Matrix to store these vectors as columns of the matrix and find row reduced echelon form.

import sympy as sp
import numpy as np
row1=[2,1,3]
row2=[-1,1,-3]
row3=[3,-2,8]
M = sp.Matrix((row1,row2,row3))
display(M)
print("Row reduced echelon form")
display(M.rref())
o/p
Row reduced echelon form
(Matrix([
 [1, 0,  2],
 [0, 1, -1],
 [0, 0,  0]]),
 (0, 1))
The pivot column represent linearly independent vectors.The output clearly shows that the first two vectors are linearly independent and the third vector is a linear combination of first two( 2x1-x2).

consider a set of linearly independent vectors b1,b2,b3,b4Rn and
x1=b12b2+b3b4
x2=4b12b2+4b4
x3=2b1+3b2+b33b4
x4=17b110b2+11b3+b4
To check whether the vectors x1,x2,x3 and x4 are linearly independent, we can form a matrix with coefficients of each vector b1b4 as column vectors and check whether they are linearly independent.

The following program will illustrate this
import sympy as sp
import numpy as np
row1=[1,-4,2,17]
row2=[-2,-2,3,-10]
row3=[1,0,-1,11]
row4=[-1,4,-3,1]
M = sp.Matrix((row1,row2,row3,row4))
print("Coefficient Matrix")
display(M)
print("Reduced Echelon Form")
display(M.rref())

O/p
Coefficient Matrix
[1421722310101111431]
Reduced Echelon Form
(Matrix([
 [1, 0, 0,  -7],
 [0, 1, 0, -15],
 [0, 0, 1, -18],
 [0, 0, 0,   0]]),
 (0, 1, 2))
It is noted that the last column is not a pivot column and x4=7x115x218x3. Therefore x1,,x4 are linearly dependent as x4 can be expressed as a linear combination of x1,,x3.

Example : (University question)
Are the following vectors linearly independent
x1=[213] x2=[112] x3=[338]

create a matrix with columns as x1,x2 and x3. Then we can use Gauss Jordan elimination to find pivot columns
[213113328]
R1=R1+R2
[120113328]

R2=R2+R1,R3=R33R1
[120033088]

R2=R2/3,R3=R3/8
[120011011]

R3=R3R2,R1=R12R2
[102011000]

This how that the first two columns are pivot columns and the third column is not
So the vectors x1 and x2 are linearly independent .How ever the third vector x3 is 2x1x2, which you can verify.

Example University Question
Check whether the polynomials x(t)=1+t+𝑡2; y(t)=2+3t7𝑡2; z(t)=4+8t over R are linearly independent or not.

The coefficient matrix is
[111237480]

R3=R22+R3
[11123701414]

R3=R3/14

[111237011]

R2=R12+R2

[111055011]

R2=R2/5
[111011011]

R3=R3R2
[111011000]

The last column is a non pivot column which indicates that they are linearly dependent.

Example: ( University question)
Are the following set of vectors linearly independent
X1=[123]X2=[256]X3=[579]
create a matrix with columns as X1,X2 and X3. Then we can use Gauss Jordan elimination to find pivot columns
[125257369]

After row reductions we will end up with an identity matrix, which shows that the vectors are linearly independent.

[100010001]
Note: All columns are pivot columns

Example:
Represent the vector 
b=[2136] as a linear combination of 
v1=[151]v2=[121]v3=[143]
Here We need to find numbers x1,x2,x3 satisfying
x1v1+x2v2+x3v3=b.
This vector equation is equivalent to the following matrix equation.[v1v2v3]x=b

[111524113][x1x2x3]=[2136]

Thus the problem is to find the solution of this matrix equation.Let us consider the augmented matrix for this system to apply Gauss-Jordan elimination.

The augmented matrix is

[111|2524|13113|6]

We apply elementary row operations and obtain a matrix in reduced row echelon form as follows.

Therefore the solution for the system is

x1=1,x2=2, and x3=3 and we obtain the linear combination

b=v12v2+3v3

Note:Any set of vectors which contains the zero vector is linearly dependent.

Let 0 be the zero vector, and v1,,vk are the other vectors in the set.

Then we have the non-trivial linear combination

10+0.v1+0.v2++0.vk=0
This is a non-trivial linear combination because one of the coefficients is non-zero.

Thus by definition, the set  {0,v1,,vk} is linearly dependent.

Comments

Popular posts from this blog

Mathematics for Machine Learning- CST 284 - KTU Minor Notes - Dr Binu V P

  Introduction About Me Syllabus Course Outcomes and Model Question Paper University Question Papers and Evaluation Scheme -Mathematics for Machine learning CST 284 KTU Overview of Machine Learning What is Machine Learning (video) Learn the Seven Steps in Machine Learning (video) Linear Algebra in Machine Learning Module I- Linear Algebra 1.Geometry of Linear Equations (video-Gilbert Strang) 2.Elimination with Matrices (video-Gilbert Strang) 3.Solving System of equations using Gauss Elimination Method 4.Row Echelon form and Reduced Row Echelon Form -Python Code 5.Solving system of equations Python code 6. Practice problems Gauss Elimination ( contact) 7.Finding Inverse using Gauss Jordan Elimination  (video) 8.Finding Inverse using Gauss Jordan Elimination-Python code Vectors in Machine Learning- Basics 9.Vector spaces and sub spaces 10.Linear Independence 11.Linear Independence, Basis and Dimension (video) 12.Generating set basis and span 13.Rank of a Matrix 14.Linear Mapping...

4.3 Sum Rule, Product Rule, and Bayes’ Theorem

 We think of probability theory as an extension to logical reasoning Probabilistic modeling  provides a principled foundation for designing machine learning methods. Once we have defined probability distributions corresponding to the uncertainties of the data and our problem, it turns out that there are only two fundamental rules, the sum rule and the product rule. Let p(x,y) is the joint distribution of the two random variables x,y. The distributions p(x) and p(y) are the corresponding marginal distributions, and p(y|x) is the conditional distribution of y given x. Sum Rule The addition rule states the probability of two events is the sum of the probability that either will happen minus the probability that both will happen. The addition rule is: P(AB)=P(A)+P(B)P(AB) Suppose A and B are disjoint, their intersection is empty. Then the probability of their intersection is zero. In symbols:  P(AB)=0  The addition law then simplifies to: $P(...

5.1 Optimization using Gradient Descent

Since machine learning algorithms are implemented on a computer, the mathematical formulations are expressed as numerical optimization methods.Training a machine learning model often boils down to finding a good set of parameters. The notion of “good” is determined by the objective function or the probabilistic model. Given an objective function, finding the best value is done using optimization algorithms. There are two main branches of continuous optimization constrained and unconstrained. By convention, most objective functions in machine learning are intended to be minimized, that is, the best value is the minimum value. Intuitively finding the best value is like finding the valleys of the objective function, and the gradients point us uphill. The idea is to move downhill (opposite to the gradient) and hope to find the deepest point. For unconstrained optimization, this is the only concept we need,but there are several design choices. For constrained optimization, we need to intr...