endless iteror Ψ #4
Frances K*, 2016
© Kreative commons
We reduce various powers step by step to series of multiplications. Star powers will be supported by pop marks instead of brackets.
4.1 Multiple repetitions
The concept of repeating a repetition operation,
which defines exponentiation,
is easily confused with the double repetition of a number,
which equals two multiplications.
n is a length,
and you multiply that once for a plane, or twice to measure a volume,
then exponentiation sizes up to any number of dimensions.
To multiply a number by itself
is a square
or 2nd power, which we notate in the formats:
forms a cube
or 3d power:
These formats depend on the method of evaluation to apply, and sometimes we may switch
=: between them.
In a mixed context the operand position
should be clear from the code alone, not the colours.
We delimit a left evaluated operation by a plus
+ or pluses
++ at the top.
And strictly, subspace prefix
is defined for right iterators, and prefix
++ indicates left iterators.
To repeatedly multiply a number by itself
is called exponentiation
A command line expression doesn't allow superscripts,
but we automate powers in four formats:
In each format a different method reduces through suboperations to number. We will explain them in historical order.
Then little Joey, the US treasury, astronomers, and mighty Joe in the multiverse, can create @ll the large numbers they need.
10^3 = 10*10^2 = 10*10*10^1
= 10*10*10 = 1000
1000**5 = (10**3)**5 = 10**3*5
= 10**15 = 1000000000000000
++2**+2***10 = ++2**10**+1***10
++2**10**10 = ++100**10
=: 10^100 =: 1E100googol
The blue star
is so powerful: right iterator, left evaluation,
that it only accepts single operation input.
The red star
with left iterator and left evaluation subspace,
is our all-round red riding hood.
4.2 Caret powers
^ is the ascii
sign for powers or exponentiation,
but programmers may use a double star
in a similar way.
^ powers have precedence over
Define exponentiation by a single multiplication step,
over that to form a series of multilications.
To show examples, click @t the board.
n^(r+1) = n*n^r
== n*..n^1 :r
= n*..n :r
5^(2+1) = 5*5^2
== 5*..5^1 :2
= 5*..5 :2
5^(2+1) = 5*5^2
= 5*5*5 = 125
4^(3+1) = 4*4^3
== 4*..4^1 :3
= 4*..4 :3
4^(3+1) = 4*4^3
= 4*4*4*4 = 256
2^(9+1) = 2*2^9
== 2*..2^1 :9
= 2*..2 :9
2^(9+1) = 2*2^9
= 2*2*2*2*2*2*2*2*2*2 = 1024
We don't follow the custom from physics,
where you multiply without an operator sign,
as if this empty
We feel that addition of unary numbers
is the true void operator, first comes multiplication,
and next recursions are enumerated from there:
Operators with multiple carets
evolved from the arrow functions
invented by Donald Knuth,
who is an expert in algorithms for computers.
Knuth's superexponential operators are also called
but nowadays only the arrowhead or caret remains.
In a short article in 1976 Knuth invented his arrows to show that finite numbers can get extremely large, and therefore we should consider them just as interesting as infinite numbers. Quite a statement from a man who injected infinity in the real field with his surreal numbers.
are ruled by right majority precedence.
So major operations with more carets are reduced to number first,
and adjacent equal operators are worked away from the right.
For variety between operators and to save on brackets, you can use them together and evaluate majority carets before minority stars.
4.3 Minority star powers
Now describe star operations
ruled by minority precedence,
where lesser stars are reduced to number first.
Because zero stars
is a virtual operator for natural addition,
it is consistent to evaluate smaller operators sooner.
In this section we apply right minority precedence. So operations with equal stars are worked out rtl (from right to left).
We paint right minority stars black by default (with a blue accent inside brackets).
Evaluating these operations stepwise,
a preceding suboperation is spawned on the right,
and this immediately gets precedence.
We work it out on top,
before completing the whole subtower.
For example the power
has to wait inactivated until its first suboperation
n*n produces a number
that then becomes the iterator for a new suboperation
But we have to take care to shield off the iterator
in the original operation from the resulting
p of the suboperations.
To separate operations we introduce pop marks
and function like temporary brackets.
waits and separates the sub
from the super space.
Define minority star exponentiation
by its multiplication
using left pops
that express a factor on top.
n**r1 = n**r+*n
n**r1+*p = n**r+*n*p
n**1+*p = n*p
3**111 = 3**11+*3
3**11+*3 = 3**1+*3*3
3**1+*9 = 3*9 = 27
2**6 = 2**5+*2
2**3+*8 = 2**2+*2*8
2**1+*32 = 2*32 = 64
The postponed operation
with its iterator
waits for the next factor
to come free. Then
shifts on top and has precedence.
We use a left pop
to shield the original exponent
from the suboperations issued on the right.
By introducing, shifting and eliminating pops we can evaluate superexponents using a minimum of signs (without brackets).
4.4 Leftist star powers
In expressions like
the rule of right minority precedence
champions the largest numbers.
But because exponents matter most,
the results of straight rtl
evaluation are almost as big.
Now we'd like to evaluate operators
without the use of precedence rules.
Operators can become so big and complex
that it's not so straightforward to compare them in size anymore.
Also we'd rather do without inner expressions in (group) brackets.
The alternative is to scan expressions ltr,
and to apply rewrite rules strictly from left to right.
This way we won't meet difficult precedence choices
Our leftist powers
with the usual operands reversed
and suboperations issued on the left.
Operators are painted red,
when the iterator operand is placed left.
But if operand position doesn't matter,
because iterator and item happen to be
or for commutative
we let stars have the normal colour.
Define red star powers by working out
on the left.
Click @ for examples.
2r**n = n*+1r**n
:= pr2 = n.*n.. :r1for
1**n = n = 1*n<=>
r**n = 1.*n.. :rfor
11111**2 = 2*+1111**2
6**3 = 3*+5**3
8**8 = 8*+7**8
a suboperation is reduced to number first,
before the next is issued.
We use right pops
to keep the subroutines separated from the original iterator.
Semi-permeable bracketing by pops is crucial in the event a subtotal
:= pi is ready
and the superoperation
is decremented again.
The formerly postponed operator then shifts
and becomes active with a new item
*n to repeat,
and the next pop
is put in place to stand guard.