MathGroup Archive 1999

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

Search the Archive

Re: harder parts of list

  • To: mathgroup at
  • Subject: [mg15600] Re: [mg15570] harder parts of list
  • From: "Clemens Frey" <Clemens.Frey at>
  • Date: Thu, 28 Jan 1999 04:23:29 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Dear Arnold,
this is not so difficult as it seems at first. Just use one of the
following Maps of pure functions to solve the problem restated below:

 ] /@ lst

 Cases[Rest[sublst],x_/;x<First[sublst]] ] /@ lst

Both of them gives the result you want. If you like it more explicit,
you could write alternatively:

sel[lst_] := Select[Rest[lst],#<First[lst]&]; sel /@ lst

which is the same as above without the use of the outer pure function.
Hope this helped

Clemens Frey
Doctoral Fellow at the
Department of Mathematics/BITOEK
University of Bayreuth(Germany)

clemens.frey at

>This seems to be a harder list parts problem. Given a list like
>I wish to select the elements in each sublist that are smaller than the
>  entry in that sublist.
> So for the above lst the output should be {{2,3,1},{1},{}}. How can I
>do this  with Select or Cases?
>Using pattern matching this works
>rule1={a_,b___,c_,d___}:>{a,b,d} /;c>a
>(# //. rule1)& /@ lst
>Rest /@ %
>Arnold Knopfmacher
>Wiws University
>South Africa

  • Prev by Date: Re: change the solution to a differential equation into a user defined function - question.nb (0/1)
  • Next by Date: D vs. Derivative
  • Previous by thread: Re: harder parts of list
  • Next by thread: Re: harder parts of list