MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Determining Linear dependent vectors


> Here is a set of vectors in the rows.
>
> vectors = {{1, 0, 3, 2, 0}, {0, 1, 2, 0, 3}, {1, 1, 5, 2, 3}, {2, -1, 4,
>         4, -3}, {1, 2, 7, 2, 6}};
>
> Here is the null space of the transpose of vectors.
>
> nmat = NullSpace[Transpose@vectors]
> {{-1, -2, 0, 0, 1}, {-2, 1, 0, 1, 0}, {-1, -1, 1, 0, 0}}
>
> Multiplying the null space vectors times vectors gives all zeros.
>
> nmat.vectors
> {{0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}, {0, 0, 0, 0, 0}}
>
> We have three dependent vectors and we can solve for them in terms of the
> first two independent vectors. Label the vectors {v1,v2,v3,v4,v5}. Then
>
> Thread[nmat.{v1, v2, v3, v4, v5} == {0, 0, 0}]
> Solve[%, {v3, v4, v5}]
> {-v1 - 2 v2 + v5 == 0, -2 v1 + v2 + v4 == 0, -v1 - v2 + v3 == 0}
> {{v5 -> v1 + 2 v2, v4 -> 2 v1 - v2, v3 -> v1 + v2}}
>
> David Park
> djmp at earthlink.net
> http://home.earthlink.net/~djmp/
>
>
>
> From: Saurabh [mailto:saurabh911 at gmail.com]
To: mathgroup at smc.vnet.net
> To: mathgroup at smc.vnet.net
>
>
> Am looking for methods to determine linearly dependent vectors out of a
> given set. Any pointers appreciated.
>
> Thanks,
>
>

Hello Sauabh

One another possible approach is to look at the Mac number see below. I 
have seen this before on the group before so this is not completely
original, can't seem to find the link on archives, I am using Mac in my
query so that should explain it :). Basically the mac number will tell you
on a scale of 0 to 1 how dependent your vectors are, 1 being strong
dependence and vice versa. Here is my attempt anyway,


In[46]:=
Clear[mac,vec2,vec1]
mac[vec1_,vec2_]=Dot[vec1,vec2]^2/(Dot[vec1,vec1] Dot[vec2,vec2]);
mac[{1,2,4},{2,4,8}]//N

Out[48]=
1.

Hope this helps

Pratik
Wolfram Research,Inc
Tech Support




  • Prev by Date: Re: Faster Random Walk Simulation ?!?
  • Next by Date: Re: Re: Determining Linear dependent vectors
  • Previous by thread: Re: Determining Linear dependent vectors
  • Next by thread: Re: Determining Linear dependent vectors