Really stupid question 
Author Message
 Really stupid question

This is, I'm almost sure, a completely stupid question. However it's
been vaguely nagging at me since I started playing with J i.e. this
time last week (though I guess it's equally applicable to APL).

What could it mean if it were possible to have an object x such that
 1 < $$$x
?

I.



Sat, 27 Apr 1996 01:45:59 GMT  
 Really stupid question
Since I there haven't been many J questions I'd be pleased
to even the most stupid questions. But this question, actually
is not stupid at all.

You must have noted that any noun having 3 or more axis has
$$$ equal to 1.

And it turns out than no noun can have $$$ > 1.

If it could then

   $ ((i. 2 2) $ i. 2 2)
2 2 3 2

would instead have to return :

0 1
2 3

Yet another way to look at it is to examine the A struct data type.
From this you can conclude that the result of $ must be a list and
not a table.

-emmett



Sat, 27 Apr 1996 04:00:04 GMT  
 Really stupid question
Emmett McLean:
   You must have noted that any noun having 3 or more axis has
   $$$ equal to 1.

I'm not sure where the '3 or more axis' came from?

   1 = $$$n

for any noun n.

Raul D. Miller



Sat, 27 Apr 1996 07:05:10 GMT  
 Really stupid question
Apologies; I seem to have pushed self-deprecation to the point of
confusion :)

Obviously I am aware that, for J and APL, $$$n (or \rho \rho \rho n --
is that right? It's been years since I looked at APL) must be 1
because $$n has to be a single (non-negative) integer (the number of
dimensions/axes). And that, therefore, $n is a list (the size of each
dimension/axis). As Raul mentions this is not dependent on the number
of axes: e.g. if n is 1, $n is whatever J people call a zero-axis
structure, $$n is the list 0 and $$$n is 1.

I suppose my question was really why the design decision for $$$n to
be 1 had been made, i.e. the decision not to include some sort of
"meta-axis" concept. The reason I suspected this was a stupid question
-- frankly one of my faults is to assume to much context when I ask a
question -- was simply that doing such a this gives no appreciable
additional flexibility to the language. Is this the case?

Oh dear, reading that back I sound terribly bombastic.

I.



Sat, 27 Apr 1996 17:50:44 GMT  
 Really stupid question
Ian Young:
   I suppose my question was really why the design decision for $$$n
   to be 1 had been made, i.e. the decision not to include some sort
   of "meta-axis" concept. The reason I suspected this was a stupid
   question -- frankly one of my faults is to assume to much context
   when I ask a question -- was simply that doing such a this gives no
   appreciable additional flexibility to the language. Is this the
   case?

As Emmett pointed out, there are several ways of looking at this.  One
way is that 1 is an invariant for $$$noun is a property of $ (or
\rho), not a property of any noun.

Another way of looking at this gets into the structure of a noun.  A
multidimensional array can be looked at as a pair of one dimensional
arrays: the shape list and the ravel list.  Here, the invariant
(+/shape)=(*/ravel) holds.  If you looked at an implmentation of J or
APL in terms of the typical scalar/partial-vector machine, you'd find
low-level entities that correspond to each of the shape and ravel
lists.  If you examined further, you'd find entities that correspond
to the shape list (which is a scalar) and ravel list (which is
essentially an identity, except that some information is ignored) of
each of these lists.  These low-level concepts aren't 'directly'
expressed in the language because $ (\rho) and , are adequate to
extract this information from within the language.  The exact manner
in which these concepts are expressed in a language implementation
varies with the implementation (though it's frequently true that the
more compact the representation the more time it takes to extract
information from the representation -- this says something about the
nature of the representation).  All of which doesn't really answer
your question, but may jog some memories?

A third way of approaching your question -- which presumes some
familiarity with the subject -- is to simply ask "what would be the
point?" [Of not having the invariant 1=$$$noun.]

You could think of this as a way of asking "what's a meta-axis?"

Raul D. Miller



Sat, 27 Apr 1996 20:21:24 GMT  
 Really stupid question

Quote:

>Apologies; I seem to have pushed self-deprecation to the point of
>confusion :)
>Obviously I am aware that, for J and APL, $$$n (or \rho \rho \rho n --
>is that right? It's been years since I looked at APL) must be 1
>because $$n has to be a single (non-negative) integer (the number of
>dimensions/axes). And that, therefore, $n is a list (the size of each
>dimension/axis). As Raul mentions this is not dependent on the number
>of axes: e.g. if n is 1, $n is whatever J people call a zero-axis
>structure, $$n is the list 0 and $$$n is 1.
>I suppose my question was really why the design decision for $$$n to
>be 1 had been made, i.e. the decision not to include some sort of
>"meta-axis" concept. The reason I suspected this was a stupid question
>-- frankly one of my faults is to assume to much context when I ask a
>question -- was simply that doing such a this gives no appreciable
>additional flexibility to the language. Is this the case?

Wouldn't APL2, with it's generallized arrays produce a different answer
for $$$n?   ($ being the symbol for the verb shape)
eg.
        n
1 2
1 3 5
        $ n
{What would the result be?  Perhaps shape is not defined, but couldn't
a def'n be created? Surely the answer is not 2 3? How about
2
2 3

        $$ n
2
1 2

        $$$ n
2
1 2

Quote:
}

I just invented the above.  What should it be?  My thinking is that shape is
a vector in APL because the argument is rectangular.  Hence non-rectangualar
arrays should have non-flat shapes.  Tell me if this makes any sense.

Alan Baljeu
--
-------------------------------------------------------------------------------
        Alan Baljeu    
(signature still under construction)                    HAND! :)
-------------------------------------------------------------------------------



Sat, 27 Apr 1996 23:13:18 GMT  
 Really stupid question


Quote:
>A multidimensional array can be looked at as a pair of one
>dimensional arrays: the shape list and the ravel list.  Here, the
>invariant (+/shape)=(*/ravel) holds.

Sorry, you've lost me with that invariant. Can you give an example?

Quote:
>A third way of approaching your question -- which presumes some
>familiarity with the subject -- is to simply ask "what would be the
>point?" [Of not having the invariant 1=$$$noun.]

>You could think of this as a way of asking "what's a meta-axis?"

The subject in question being what?

Ok, so why is the answer to "What would be the point?" "none"?

I thought that the answer to "What's a \"meta-axis\"?" is that it's
something that allows the axes of an array to be grouped. Thus some
hypothetical noun, x for which (and this is NOT J)
    2 3 4=$$x
has 2 groups of 3 axes. Let's say the six axes are
    (2 3 4,:5 6 7)=$x
So we're presumably going to have, for [probably bad] example
    (|.$noun)=($|:noun)
[aside: not invariant in J if rank is considered] so
    (5 6 7,:2 3 4)=$|:x
and I suppose
    (4 3 2,;7 6 5)=$|:"1 x
etc. [<--- handwave!!!!]

Is this roughly what you were thinking?

I.



Sun, 28 Apr 1996 01:09:02 GMT  
 Really stupid question
|> Wouldn't APL2, with it's generallized arrays produce a different answer
|> for $$$n?   ($ being the symbol for the verb shape)
|> eg.
|>   n
|> 1 2
|> 1 3 5
|>   $ n
|> {What would the result be?  Perhaps shape is not defined, but couldn't
|> a def'n be created? Surely the answer is not 2 3? How about

J has similar issues - the equivalent is
   n=. ,. 1 2;1 3 5
   n
+-----+
|1 2  |
+-----+
|1 3 5|
+-----+

But here it's clear that you can have $ (.rho) return the outer shape.
   $n
2 1

|> I just invented the above.  What should it be?  My thinking is that shape is
|> a vector in APL because the argument is rectangular.  Hence non-rectangualar
|> arrays should have non-flat shapes.  Tell me if this makes any sense.

Sounds like it might be useful. Something that recursively descends
the tree giving shapes at each level. In J something like:

+----------------------------------+-++
|NB.  r =. rho a                   |:||
|NB. generalized shape             | ||
|$. =. ,> (y. -: >y.){nested;simple| ||
|simple) r=. $y.                   | ||
|$. =. end                         | ||
|nested) r=. (<$y.),: rho &.> y.   | ||
|end) r                            | ||
+----------------------------------+-++

But this fails since > can fail...

--
Sam Sirlin



Sun, 28 Apr 1996 02:00:29 GMT  
 Really stupid question

   >A multidimensional array can be looked at as a pair of one
   >dimensional arrays: the shape list and the ravel list.  Here, the
   >invariant (+/shape)=(*/ravel) holds.

Ian Young:
   Sorry, you've lost me with that invariant. Can you give an example?

Oops.  I don't know what I was thinking there.  

I mean, I know what I was thinking, I just don't know why I expressed
the thought so badly.  First off, the invariant should have been:
   (*/shape)=(#ravel)

Also, note that # is a simpler construct than $, # always returns a
single (simple/scalar/atomic/etc.) number while $ returns something a
bit more general.  $ might be thought of as the number of items at
each axis.  Also note that there are a variety of maybe not so useful
ways of expressing $.  For example, instead of
   $ i. 3 2 1
3 2 1
   you probably don't want
   rho i. 3 2 1
+-+-----+---+
|3|2 2 2|1 1|
| |     |1 1|
| |     |1 1|
+-+-----+---+

This later result is based on a concept that an array doesn't really
have to be rectangular, so 'rho' needs to report the number of items
in each distinct subarray.  But this particular concept doesn't really
buy us anything, and seems incredibly more complicated than $.

   I thought that the answer to "What's a \"meta-axis\"?" is that it's
   something that allows the axes of an array to be grouped. Thus some
   hypothetical noun, x for which (and this is NOT J)
...
   etc. [<--- handwave!!!!]

   Is this roughly what you were thinking?

Well, no.  A rectangular concept of grouping axis, while much less
general than J's, seems [at least superficially] to involve more
complications than J's.  Then again, when you say that the resulting
language isn't intended to a superset of J it becomes even less clear
what you're thinking of.

Sorry I'm coming across so dense.

Raul D. Miller



Sun, 28 Apr 1996 21:04:50 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Grok (was: Re: Really stupid question regarding PEP 252 and type/class unification)

2. Really stupid question...

3. A REALLY Stupid Question about the GET clause

4. a really stupid question

5. Really stupid question regarding PEP 252 and type/class unification

6. Stupid basic (really) question from a curious !

7. Get ready for a really stupid Clippper question

8. Really stupid problem with Floppies and Int 13h!!

9. PIL+Tkinter query (I must be doing something _really_ stupid)

10. Really Stupid-Environments...

11. DrScheme is really really cool

12. Really really real(Z)?

 

 
Powered by phpBB® Forum Software