OK, now: but the discussion is mathematical and philosophical and maybe belongs
in Chat.
In math the notations { 0, 1, 2 } , { 1, 2, 0 } , and { 1, 0, 2, 1 } all refer
to THE set whose elements are 0 and 1 and 2 . There is no order in this set,
although there is order in notations naming the set. Also, an element cannot
belong to a set more than once, although the same element may be named more
than once in the notation. Once you know the elements are the numbers 0 and 2
and 1 you know what set you are talking about. There are things about this set
we do not care about. Is it blue? Is it left-handed? We don't care. The set
is a unique mathematical object, but as is common in math, we don't care even
what the object IS , we only care that it is a set, whatever that is, and that
its elements are the three numbers 2 and 0 and 1.
In a J implementation we DO care what J object is representing a set, and we
would like the J representation to have properties matching the mathematical
properties. So given my definition
set =: [: < [: /:~ ~.
and the understanding it is to be applied to a list of boxes, we find that the
notations
set 0;1;2 and set 1;2;0 and set 1;0;2;1 all represent the same J object, namely
< 0;1;2 . With my definition < 0;1;2 is THE J object representing THE
mathematical set whose elements are 1 and 2 and 0 .
Why do I have an enclosing box for the set and for each element in the
definitions "a set is a box enclosing a sorted list of boxes", and "an element
is the contents of a box in the sorted list" ?
A fair reason for the outer enclosing box is that in math a list and a set are
different. A mathematical list can have duplicates, a mathematical set cannot.
An order is a required part of a mathematical list, but not of a mathematical
set. Because of the outer enclosing box, my J sets are atoms, not lists.
A good reason (in my opinion) for the outer enclosing box is that with my J
definition the empty set is a normal set, namely set '' , a box enclosing an
empty list. The empty list has no boxes and hence the empty set has no
elements.
A psychological reason is that the outer enclosing box comfortingly resembles
the enclosing braces in the mathematical notation.
Why are elements boxed? That permits any J array to be an element. The
elements of
set 4 ; i. 2 2 are the number 4 and the 2 by 2 matrix i. 2 2 .
--Kip Murray
Sent from my iPad
> On Nov 16, 2013, at 11:14 AM, greg heil <[email protected]> wrote:
>
> Perhaps now?
> Several times you have asked that revisions including sort be made ...
> yet my understanding of the classical definition of a set is
> _unordered_...?
>
> greg
> ~krsnadas.org
>
> --
>
> from: km <[email protected]>
> to: "[email protected]" <[email protected]>
> date: 16 November 2013 08:57
> subject: Re: [Jprogramming] Powersets (was RE: Sets)
>
>> ...Why do I include Sort /:~ in my proposal? Let's discuss that another
>> time...
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm