[Edu-sig] Setting a variable's value

kirby urner kirby.urner at gmail.com
Fri May 12 01:18:44 CEST 2006


> For more on J, see:
> http://www.4dsolutions.net/ocn/Jlang.html
> (Iverson himself helped me with this essay).
>
> Kirby
>

Here, I'll declassify one from my inbox, from the late Kenneth to myself:

From: Ken Iverson [mailto:kei at interlog.com]
Sent: Friday, July 26, 2002 8:32 AM
To: Kirby Urner
Subject: Re: Jforum: New essay on J in K-12

----- Original Message -----
From: "Kirby Urner" <urnerk at qwest.net>
To: "Ken Iverson" <kei at interlog.com>
Sent: Friday, July 26, 2002 3:39 AM
Subject: Re: Jforum: New essay on J in K-12


> Tim Peters over on edu-sig (a Python list), has given me the most
> informative pointer thus far:
>
http://www.cs.unb.ca/~alopez-o/math-faq/node40.html#SECTION00530000000000000
000

In the foregoing, it is remarked that "... you need to use a special
technique such as L'Hopital's rule to evaluate them." But much insight
can be gained by observing patterns produced by the power function,
as shown below.

(Tables appear distorted if your browser does not use a monofont
such as Courier, but will appear more clearly if re-executed in J)

   2^ 2 3 4 NB. Each result is 2 times the preceding
4 8 16

   2^5      NB. 2^4 multiplied by 2
32
   2^1      NB. 2^2 divided by 2
2

   2^0      NB. 2^1 divided by 2
1
   2^_1     NB. 2^0 divided by 2
0.5

   e=:i:3   NB. A systematic list that includes 0
   e
_3 _2 _1 0 1 2 3

   10^e     NB. Shows pattern of powers
0.001 0.01 0.1 1 10 100 1000
   0.1^e    NB. Related pattern for one-tenth
1000 100 10 1 0.1 0.01 0.001
   1r10 ^ e NB. Shows more clearly in rational form
1000 100 10 1 1r10 1r100 1r1000
   10r1 ^ e NB. 10r1 is ten
1r1000 1r100 1r10 1 10 100 1000

   1r100^ e NB. 1r100^0 remains 1 for obvious reasons
1000000 10000 100 1 1r100 1r10000 1r1000000

   1 1r10 1r100 1r1000 ^/ e NB. Table shows approach to 0^0
         1       1    1 1      1         1            1
      1000     100   10 1   1r10     1r100       1r1000
   1000000   10000  100 1  1r100   1r10000    1r1000000
1000000000 1000000 1000 1 1r1000 1r1000000 1r1000000000

   1 1r10 1r100 1r1000 0 ^/ e NB. 0^0 works as defined in J
         1       1    1 1      1         1            1
      1000     100   10 1   1r10     1r100       1r1000
   1000000   10000  100 1  1r100   1r10000    1r1000000
1000000000 1000000 1000 1 1r1000 1r1000000 1r1000000000
         _       _    _ 1      0         0            0

   e ^/ e   NB. Table of powers shows pattern
_0.037037 0.111111 _0.333333 1 _3 9 _27
   _0.125     0.25      _0.5 1 _2 4  _8
       _1        1        _1 1 _1 1  _1
        _        _         _ 1  0 0   0
        1        1         1 1  1 1   1
    0.125     0.25       0.5 1  2 4   8
 0.037037 0.111111  0.333333 1  3 9  27

   e ^/ x:e NB. But rational form shows it more clearly
_1r27 1r9 _1r3 1 _3 9 _27
 _1r8 1r4 _1r2 1 _2 4  _8
   _1   1   _1 1 _1 1  _1
    _   _    _ 1  0 0   0
    1   1    1 1  1 1   1
  1r8 1r4  1r2 1  2 4   8
 1r27 1r9  1r3 1  3 9  27

   NB. Note the column and the row for the argument 0 (_ denotes infinity)

> At the moment, it looks to me the balance is tipped in favor of
> 0^0 = 1, but I'm seeing this more in the "useful convention" category,
> and less in the "proved, case closed" category.

To see why this might be more than a useful convention, consider the
standard form for a polynomial with coefficients c. (If c has four elements,
and if i is 3 2 1 0, this would be expressed in J as +/ c*x^i , and in
conventonal notation as Sigma c subscript i x superscript i.)

Now try to evaluate the polynomial for the case of x=:0, assuming that
0^0 is undefined.

> Kirby
>
> PS:  wonder if you've heard of John Conway's suggestion that -1 be
> admitted as a prime number.

No, but the inclusion of either 1 or _1 as primes would destroy the notion
of the unique prime decomposition of numbers. For example:

   a=:q: 12345
   a
3 5 823
   */a
12345
   1 1 1 1,a
1 1 1 1 3 5 823
   */1 1 1 1,a
12345
   */_1 _1 1 1,a
12345


More information about the Edu-sig mailing list