Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Re: list equation

  • To: mathgroup at smc.vnet.net
  • Subject: [mg122005] Re: list equation
  • From: DrMajorBob <btreat1 at austin.rr.com>
  • Date: Sat, 8 Oct 2011 05:36:07 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <201110060824.EAA22708@smc.vnet.net>
  • Reply-to: drmajorbob at yahoo.com

Or better yet,

Table[{i, j}, {i, 99}, {j, i + 1, 100}]

Bobby

On Fri, 07 Oct 2011 03:51:02 -0500, Chris Arthur <chris.arthur1 at gmail.com>  
wrote:

> Table[{i,j},{i,1,i},{j,1,100}]
>
> On Thu, Oct 6, 2011 at 3:24 AM, dimitris <dimmechan at yahoo.com> wrote:
>
>> Hello to all.
>>
>> Let
>>
>> lst = Tuples[Range[100], 2];
>>
>> In the previous list appear elements such us {x,y} and {y,x}. (e.g.
>> {3,4} and {4,3}).
>> I want to create a new list with {y,x} dropped (that is, in the new
>> list appears only {3,4}
>> and not {4,3}).
>>
>> I use
>>
>> lstnew = Union[lst, SameTest -> (#1 == Reverse[#2] &)]
>>
>> However it is needed almost 150 sec for this procedure ($Version->5.2
>> for Windows)
>> I know that my laptop is too old but I guess there is a more efficient
>> way to
>> create lstnew.
>>
>> Any ideas?
>>
>> Thanks a lot
>>
>> Dimitris
>>


-- 
DrMajorBob at yahoo.com



  • Prev by Date: Re: importing data into a CDF
  • Next by Date: Re: Baffled by notebook history
  • Previous by thread: Re: list equation
  • Next by thread: Re: list equation