Re: How to get the linear independent subset of a list? (Newbie Question)
- To: mathgroup at smc.vnet.net
- Subject: [mg37601] Re: How to get the linear independent subset of a list? (Newbie Question)
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 6 Nov 2002 06:53:39 -0500 (EST)
- Organization: Universitaet Leipzig
- References: <aq86qq$e5e$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
the function
LinearIndepend[expr_] :=
expr //. {a___, b_, c___, d_, e___} /; MemberQ[d, _.b + _.] :> {a, b,
c, e}
gives for
In[]:=
LinearIndepend[{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]}]
Out[]={F[x], G[x], Derivative[1][F][x], Derivative[2][G][x]}
and
In[]:=LinearIndepend[{a, b, a + b, c, b - c}]
Out[]={a,b,c}
*and* D[G,x,2] ins nonsense you mean D[G[x],{x,2}]
Regards
Jens
Liguo Song wrote:
>
> Dear Math Group,
>
> 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.
>
> Liguo