MathGroup Archive 2011

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

Search the Archive

Re: reliably sort?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg123773] Re: reliably sort?
  • From: David Bailey <dave at removedbailey.co.uk>
  • Date: Sun, 18 Dec 2011 04:37:26 -0500 (EST)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • References: <jca06e$a35$1@smc.vnet.net> <201112150956.EAA23025@smc.vnet.net> <op.v6js80k5tgfoz2@bobbys-imac.local> <jcf8et$6v2$1@smc.vnet.net>

On 16/12/2011 11:01, Nasser M. Abbasi wrote:
> On 12/15/2011 2:44 PM, DrMajorBob wrote:
>> Michael,
>>
>> Sorry, but no. Union always sorts.
>>
>> Bobby
>>
>
> You mean Mathematica's Union[] always sorts, right? Because
> at school the teacher kept telling us that a set has no
> implied order between its elements. It is just a collection
> of elements. But a sequence has an order.
>
> Result of a Union is a set. Hence one can not talk about
> a set being sorted.  The result is not a set then, but a
> sequence, but the result of a Union should be a set.
>
> --Nasser
>
>
>
Lists can mean many things in Mathematica:

Vectors (nested lists represent matrices or tensors)

Actual lists

Sets

Anything else you want to represent as a list

You know what any particular list means, but Mathematica doesn't care.

Mathematica functions that operate on any of these, are defined as 
operations on lists.

David Bailey
http://www.dbaileyconsultancy.co.uk




  • Prev by Date: legend in a combined plot
  • Next by Date: How to define a localized indexed object in Manipulate?
  • Previous by thread: Re: reliably sort?
  • Next by thread: Re: Does Union[] reliably sort?