Re: Fast creation of a set (was: Strange machine-level exception)
- Posted by CChris <christian.cuvier at agriculture.gouv.fr> Jun 19, 2007
- 474 views
Juergen Luethje wrote: > <snipped/> > > Mathematically speaking, a set is a "collection of objects in which > order has no significance". <<a > href="http://mathworld.wolfram.com/Set.html">http://mathworld.wolfram.com/Set.html</a>> > So no application should rely on the assumtion that the elements in > a set are in a particular order, shold it? > This is true. However, any bijection between a set and an ordered set gives the source set an ordering. Hence, an application may define any sort of order on a set if it is convenient in any way. After all, there is an order relation on all Euphoria objects, defined by: x < y <===> compare(x,y)=-1 And since all sets we deal with in computer world are finite, hence mappable to some starting section of |N, there is always a natural way to order any set we encounter. It is easy to see that any set of objects can be considered part of a set of cardinality aleph_n, with {\it n} the maximum sequence nesting level in said collection of objects. And there is a natural order relation over such a set, built recursively starting from the natural ordering of integers. (Over |R (n=1), this is the ordering of reals by their continued fraction). CChris