Re: Determining Linear dependent vectors
- To: mathgroup at smc.vnet.net
- Subject: [mg66259] Re: Determining Linear dependent vectors
- From: "ben" <benjamin.friedrich at gmail.com>
- Date: Sat, 6 May 2006 01:54:29 -0400 (EDT)
- References: <e3f5s6$sac$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi Saurabh
The easiest way is to apply Gram-Schmidt,
though no need to normalize your vectors.
To account for round-off errors,
maybe replace != by sth. like "norm<2 machine precison".
The following code tells you which vectors to keep,
in order to get a linearly independent set.
All vectors M[[m]] that end up as {0,0,0}
are linearly dependent from all M[[n]], n<m
with M[[m]].M[[n]] != 0.
Bye
Ben
(* some vectors *)
M = Table[Random[Integer], {i, 10}, {j, 3}]
(* Gram - Schmidt *)
Do[
Do[If[M[[n]] != {0, 0, 0},
M[[m]] = (M[[n]].M[[n]]) M[[m]] - (M[[n]].M[[m]])M[[n]]], {n, 1,
m - 1}], {m, 2, 10}]
(* result *)
Map[If[# != {0, 0, 0}, "keep", "discard"] &, M]
Saurabh schrieb:
> Am looking for methods to determine linearly dependent vectors out of a given set. Any pointers appreciated.
>
> Thanks,