emptyset take 5 
Author Message
 emptyset take 5

     Would someone be so kind as to explain to me why

     5 = emptyset take 5?

     Or why

     1 = emptyset belongsto 'abcdef'

     Or why

     1 = and / emptyset

     Thank you.


Sat, 13 Jan 1996 23:57:59 GMT  
 emptyset take 5

:      Would someone be so kind as to explain to me why
:      5 = emptyset take 5?
:      1 = emptyset belongsto 'abcdef'
:      1 = and / emptyset
:      Thank you.
:      Homer

Let's take the second question.  If I have a string in a computer and I
start to search in that string, the logical place to start is the first
character.  This is simple.  Where do I (the computer) stop and say "It
just ain't there boss..."?  Most computers will use the null character
to represent the end of the string; so 'abcdef' is 61 62 63 64 65 66 00
in hexidecimal representation.  Now, if I ask if a set that has no ele-
ments (ie: 00 in hex) is in the above string, I *SHOULD* get a yes (ie:
a 1) in response.

Expanding on this logic, the others are obvious (...left as an exercise
for the reader...).

W. LeRoy Davis

Sun, 14 Jan 1996 02:08:29 GMT  
 emptyset take 5

   As for

                   emptyset take 5

   '' {. y is y for all y.

   I suppose it's set up this way for the implementation of recursive
   verbs and for extenstions to many-at-a-time adverbs.

                   emptyset belongsto 'abcdef'

   I am confused by what you mean. What is the spelling for belongsto?
   The verbs e. and E. are closest to what you describe, but :

   '' e. 'abcdef'

   '' E. 'abcdef'
1 1 1 1 1 1
   '' i. 'abcdef'
0 0 0 0 0 0

    Do you want :

   *./ ''&E. 'abcdef'

   ? As for

                    and / emptyset

   Note that

   u/'' returns the identity element for u. For a 'why' explanation
   refer to the documenation for / (insert) in the Dictionary of J. So :

   +/ ''
   %/ ''

   NB. All at once : identity elements for plus, minus, mult, div, and, and or :
   (+/)`(-/)`(*/)`(%/)`(*./)`(+./)`:0 ('')
0 0 1 1 1 0


Sat, 13 Jan 1996 21:05:46 GMT  
 emptyset take 5

        (Homer Wilson Smith) writes:

>     Would someone be so kind as to explain to me why

>     5 = emptyset take 5?

I will try to answer in an informal way, without going into anything
deep.  But first, I must correct something that is implicit in the
question, which may in part be leading to the difficulty.  The data
objects in APL are arrays, some of which may be empty, and not sets.
Now to address the question.

In general, if    R <- A take B , and  A take B is defined,
then A is the shape of R.  For instance, if you do

                V <- 3 take 5

you get a vector with three numbers.  That is,  3 = shape V  .
Now, the shape of all scalars is the empty vector, and that
explains it, because if A is the empty vector, (I think that
is what you meant when you said "emptyset"), _shape_ of A take 5
is the same as the shape of   A reshape 5 , and this gives something
with content 5 whose shape is the empty vector, just like all scalars.

This property is useful for generating elements used for indexing
an array.  For example the sapes of   MAT[,1;] and MAT[1;]  are
not the same.  Sometimes, after a brutish calculation, you might
find that I is a one element vector and you want to use it to
extract a row vector from a matrix.  The form MAT[I;] will
get you a one row matrix, and not a vector.  However,
the form MAT[ (iota 0) rho I ; ] will yield the desired vector.

Question 2.
[why is]

>     1 = emptyset belongsto 'abcdef'

I don't get this result.  Again, I think you mean empty vector, not
emptyset.  Looking at the meaning of  "R  <- A elt B"  the shape
of      R     is the same as the shape of A.  For example, if A
is a matrix, then    A elt B   is a matrix.  Likewise, if A is
an empty array, then R is an empty array, with no elements in it,
and it does not equal 1.

Question 3:
 [why is]


>     1 = and / emptyset

Students in my elementary mathematics courses seem always to find it
easy to accept the idea that the sum of the entries in an empty list
of numbers should be 0.  The answer is because this is the identity
element for the given operation.  But they seem not to have thought
about the analogous question for multiplication:   Why should the
product over the empty list be 1.  The answer (again) is that this is
the identity element for the given operation.  Now think, what is the
identity element for "and" ?  Whatever that element is, let us call it
"i", it has to satisfy the identity

                x   <-->  x and i

for every element in the domain.  In this case the domain has only two
elements, and it is true that both of these identities hold:

                1   <-->  1 and 1
                0   <-->  0 and 1

but it is not true that both these hold,

                1   <-->  1 and 0
                0   <-->  0 and 0

because one of them fails to be true.  This answers your question
then, because 1 is the identity element for "and".  An amusing related
question is "what is the identity element for "min" or "smaller of".
We want the identity:

                x   <-->  x min i

for all numbers x.  So what should the identity i be?

Prof. Leroy J.{*filter*}ey, Faculty of Mathematics, U of Waterloo, Canada  N2L 3G1

Sat, 20 Jan 1996 05:04:02 GMT  
 [ 4 post ] 

 Relevant Pages 

1. Taking an action based on closing a window

2. anybody taken on PC Assembler

3. anybody taken on PC Assembler

4. Why have IBM taken off UML Designer in Version 6 of VAST

5. We have taken the Hassles out of the net

6. Time taken to run a program?

7. We have taken the Hassles out of the net

8. Netscape has TAKEN OUR EXTENSION!

9. replace substring by spaces - taking same space as substring

10. Sprite control takes over..

11. Is there a way on taking the ICON off

12. How much memory and object takes up?


Powered by phpBB® Forum Software