Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

Re: Re: Re: Select in Math.

  • To: mathgroup at
  • Subject: [mg18595] Re: [mg18532] Re: [mg16518] Re: Select in Math.
  • From: BobHanlon at
  • Date: Tue, 13 Jul 1999 01:01:27 -0400
  • Sender: owner-wri-mathgroup at


As best as I can interpret the original question, I do not understand your 
result.  However, without a definition of the problem with more clarity than 
the one example, I can't say one way or the other.  

Perhaps, Eugene (kewjoi at can clarify what the desired output 
should be.

Bob Hanlon

In a message dated 7/9/99 4:57:32 AM, arnoldk at writes:

>Regarding your solution on extracting increasing sublists:
>[mg16518]. Consider
>list=Union[Sort /@ list]
>However, the correct output should be  {{5},{2,3},{6,8}}.

Original messages:

In a message dated 3/8/99 6:43:38 PM, kewjoi at writes:

>My question is how can I extract (select) list of lists in increasing
>For example:
>I 'd like to obtain only the parts in increased order, therefore the
>result should be :
>I did try (Cases, Select, and Extract) but definitely not in proper way.


This may be what you want.


The nesting of the lists does not appear to be pertinent to your problem, 
so simplify the structure by eliminating the nesting.  Also, Sort sublists 
and eliminate duplicates:

list = Union[Sort /@ {list //. 
					{x__List} -> Sequence[x]}]

{{5}, {6, 7}, {1, 2, 3}, {1, 2, 3, 4}}

Eliminate subsets

elements = Union[Flatten[list]];

list = Select[list, Not[Union[Flatten[
					Complement[list, {#}]]] == elements]&]

{{5}, {6, 7}, {1, 2, 3, 4}}

Sort by first element

Sort[list, First[#1] < First[#2]&]

{{1, 2, 3, 4}, {5}, {6, 7}}

Bob Hanlon

  • Prev by Date: LaTex for publication
  • Next by Date: Re: Manipulating differential equations
  • Previous by thread: Re: Re: Select in Math.
  • Next by thread: Re: Re: Re: Select in Math.