MathGroup Archive 2007

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

Search the Archive

Re: rule based program for "Deleting repeated members of a list."

  • To: mathgroup at smc.vnet.net
  • Subject: [mg82008] Re: rule based program for "Deleting repeated members of a list."
  • From: sean_incali <sean_incali at yahoo.com>
  • Date: Tue, 9 Oct 2007 05:39:26 -0400 (EDT)
  • References: <fe7j44$qga$1@smc.vnet.net><fecho3$ih9$1@smc.vnet.net>

this is really odd....


In[1]:=s = {a, b, c, c, d, e, e, f, g, g, g, h, a, b} // Intersection

Out[1]=
{a,b,c,d,e,f,g,h}

In[2]:=s = {a, b, c, c, d, e, e, f, g, g, g, h, a, b} // Union

Out[2]=
{a,b,c,d,e,f,g,h}

In[3]:=s = {a, b, c, c, d, e, e, f, g, g, g, h, a, b} // Complement

Out[3]=
{a,b,c,d,e,f,g,h}

I'm guessing it's use of these functions on single list of values that
makes them behave like that...




On Oct 7, 11:12 pm, sean_incali <sean_inc... at yahoo.com> wrote:
> How about a simplests way of using intersection, instead of rule
> based.
>
> s = {a, b, c, c, d, e, e, f, g, g, g, h, a, b} // Intersection
> {a, b, c, d, e, f, g, h}
>
> On Oct 6, 2:05 am, mumat <csar... at gmail.com> wrote:
>
>
>
> > Hi,
>
> > I have a list s={a,b,c,c,d,e,e,f,g,g,g,h,a,b};
>
> > I need to write a program so that it reads the list and ignors
> > repeated elements; so it outputs the following:
>
> > RepeatRemover[s]={a,b,c,d,e,f,g,h,a,b};
>
> > I am looking for a rule-based program to do this!
>
> > Any help would be greatly appreciated.
>
> > C.S.- Hide quoted text -
>
> - Show quoted text -




  • Prev by Date: Re: PlotMarkers alignment problem
  • Next by Date: Re: creating a palette of characters
  • Previous by thread: Re: Re: rule based program for "Deleting repeated members of a list."
  • Next by thread: Re: rule based program for "Deleting repeated members of a list."