MathGroup Archive 2002

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

Search the Archive

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


  • Prev by Date: Re: random matrix initialisation...
  • Next by Date: RE: random matrix initialisation...
  • Previous by thread: Re: How to get the linear independent subset of a list? (Newbie Question)
  • Next by thread: Fourier Transforms for Idiots?