Current issue

Vol.26 No.4

Vol.26 No.4

Volumes

© 1984-2024
British APL Association
All rights reserved.

Archive articles posted online on request: ask the archivist.

archive/8/2

Volume 8, No.2

Recreation with Transcendental Numbers

by Gérard Langlet

First, let us fix ⎕PP←16 to have the maximum precision. What is the shortest APL expression producing the Golden Number? Probably:

       .5×1+5*.5 
1.618033988749895

Then, what is the shortest expression without using *? I propose:

       ⍎112⍴'1+÷' 
1.618033988749895

(This is an interesting use of Execute, that may be generalised to produce other transcendental numbers, summing continuous fractions. Moreover, in APL.68000, the expression becomes as short as the preceding one, if one knows that the closing quote may be omitted in that implementation...)

This gives the following idea: What is the shortest APL expression to get the Golden Number using only 1 either as a numeral or as a character? I propose:

       ⍎'1',111⍴'+÷1' 
1.618033988749895

Then, is it possible to obtain the same number without any figure or numeral, even as a character?

       ⍎⍎'''',I,''',',I,I,I,'⍴''+÷'',I',⍴⍎I←⍕'I'='I' 1.618033988749895

(The on the right is necessary in APL*PLUS II: of a scalar being a vector of length 1.)

Now, knowing that

       ⍎111⍴'1+÷1+'     ⍝ returns 2*.5: 
1.414213562373095

we may try:

       ⍎⍎I,I,I,'⍴I,''+÷'',I,''+''',⍴⍎I←⍕'I'='I' 1.414213562373095

Similarly, a good value of 10*.5 is obtained by:

        ⍎1111⍴'1+1+1+÷1+1+ 1+'      ⍝ (Mind the blank!) 3.162277660168379

Exercise: find the expressions that return all the famous transcendental numbers without using numbers!


(webpage generated: 20 January 2007, 23:26)

script began 2:12:23
caching off
debug mode off
cache time 3600 sec
indmtime not found in cache
cached index is fresh
recompiling index.xml
index compiled in 0.1746 secs
read index
read issues/index.xml
identified 26 volumes, 101 issues
array (
  'id' => '10004650',
)
regenerated static HTML
article source is 'HTML'
source file encoding is 'ASCII'
read as 'Windows-1252'
URL: mailto:-*- => mailto:-*-
URL: mailto:-*- => mailto:-*-
completed in 0.2062 secs