Re: How to get the linear independent subset of a list? (Newbie Question)
- To: mathgroup at smc.vnet.net
- Subject: [mg37590] Re: [mg37581] How to get the linear independent subset of a list? (Newbie Question)
- From: BobHanlon at aol.com
- Date: Wed, 6 Nov 2002 06:53:06 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
In a message dated 11/5/2002 7:04:05 AM, Liguo.Song at vanderbilt.edu writes:
>How can I get the linear independent subset of a list of symbol, function,
>and
>derivative of functions?
>
>Here is a example:
> For {a, b, a+b, c, b-c}, one of the subsets is {a,b,c}. In fact, any
>one of
>the subsets would work for me.
>
> Another example. For {F[x], G[x], D[F,x],D[G,x,2], F[x]+D[F,x],
>D[G,x,2]+D[F,x]+F[x]}, the subset would be {F[x], G[x], D[F,x],D[G,x,2]}.
>
>I have went through the help of Mathematica and did find anything like
>this.
>Help is really appreciated.
>
Here is a start. This works for simple examples such as those that you gave.
comp[x_List] :=
Union[Flatten[x, Infinity, Plus] /. -t_ :> t];
comp[{a, b, a + b, c, b - c}]
{a, b, c}
comp[{F[x], G[x], D[F[x], x],
D[G[x], {x, 2}], F[x] + D[F[x], x],
D[G[x], {x, 2}] + D[F[x], x] + F[x]}]
{EllipticF[x], G[x], Derivative[1][F][x],
Derivative[2][G][x]}
Bob Hanlon