Friday, 19 August 2016

Endless Repetition

endless iteror #3

Repetition

Frances K*, 2016

Learn to create ever bigger numbers
in an article series on site and blog,
dedicated to Chelsea Manning hero.

© Kreative commons

#3 Repetition

We grab the tools to work out repetitions, and define multiplication by a series of empty additions.

3.1 Word reps

In programming languages Regular Expressions are used to scan text and find words that match a regex. We have similar tools to describe repetition of any subexpression.

Repeat a sign or variable either with a regex quantifier {r} inside an expression, or on the dots .. with a rep :r right outside.

@

a*{c}b 
= a*..b *:c
v{n1} 
= v{n}v  
= v.. :n1
a*{1}b 
= a*b
= a*..b *:1
v{1} 
= v{0}v  
= v
= v.. :1
a*{2}b 
= a**b
= a*..b *:2
v{2} 
= v{1}v  
= vv
= v.. :2
a*{3}b
= a***b
= a*..b *:3
v{3} 
= v{2}v  
= vvv
= v.. :3
a*{4}b 
= a****b
= a*..b *:4
v{4} 
= v{3}v  
= vvvv
= v.. :4
a*{5}b 
= a*****b
= a*..b *:5
v{5} 
= v{4}v 
= vvvvv
= v.. :5

Please click the boards for examples!
The yellow sidebar highlights the use of unary constants (not digits) and natural addition.

To select a word W by dots, a single dot can . mark the left side of W, while double dots .. mark it on the right.

@

X.V..Z :0 
= XZ
W..Y :0 = Y
X.V..Z :1 
= XVZ
W..Y :1 = WY
X.V..Z :2 
= XVVZ
W..Y :2 = WWY
X.V..Z :3 
= XVVVZ
W..Y :3 = WWWY
X.V..Z :4 
= XVVVVZ
W..Y :4 
= WWWWY
X.V..Z :5 
= XVVVVVZ
W..Y :5 
= WWWWWYX.V..Z :6 
= XVVVVVVZ
W..Y :6 
= WWWWWWY
X.V..Z :7 
= XVVVVVVVZ
W..Y :7 
= WWWWWWWY

In case right dots have no left dot(s) preceding and there is no word specified W:n in the rep, the repeated word starts at the left of the expression (after the space).

For a subexpression that is expanded from the middle to the left and right at once, we use a two-sided rep.

@

Vi(..X..)Wi :n:
Vi(..X..)Wi :0: 
= X
Vi(..X..)Wi :1: 
= V1(X)W1
Vi(..X..)Wi :2: 
= V2(V1(X)W1)W2
Vi(..X..)Wi :3:
    = V3(V2(V1(X)W1)W2)W3
Vi(..X..)Wi :4:
    = V4(V3(V2(V1(X)W1)W2)W3)W4

Click to show that iteration variable i increments at every step of the repetition. We can also let a secondary iterator j increment for each i all over again in a nested loop.

Our repex notation allows us to iterate over rewrite rules that are defined in single steps. It's an intuitive tool, you can pick it up as we go.

3.2 Multiplication

A common way to multiply two numbers r×n is to take r times the number n and add them together.
Here the item n is put left in the star multiplication n*r and repeated by the iterator r on the right.

When we concatenate unary numbers n.. the multiplication product is directly given. Concatenation works by natural addition, which is the initial superstar operation with zero *{0} stars.

We define multiplication by its addition step, that is trivially selected on the left or right of its product.

@

n*r1 
= n.. :r1 
= n.n.. :r
     = n(n*r) 
= n+n*r
n*3
= n.. :111
= n+n*11
    = n+n+n*1 
= n+n+n
2*3 
= 11.. :111
= 11+11+11
    = 1111+11 
= 111111 = 6n*4
= n+n*111
= n+n+n*11
    = n+n+n+n*1 
= n+n+n+n
2*4 
= 11.. :1111
= 11+11+11+11
    = 11111111 = 8

We already made two choices for evaluation here:
• to place the iterator that counts off steps on the right. The operands have the same order as with exponentiation.
• to derive the suboperation of addition on the left. Generally we scan expressions ltr (left to right) and reduce free suboperations first.

So we add unary numbers directly on the left, while multiplication is kept separated from the growing result by a single postponed + plus.
Or you can leave the + steps to work out later from either side.

Multiplication n*r = r×n is commutative, which means the factors (number item and iterator) can be reversed.
Show examples of stepwise multiplication of: three hands... eight pairs.. nine ones.

@

3×5 = 2×5+5 = 1×5+5+5
    = 5+5+5 = 10+5 = 15

5*3 = 5+5*2 = 55+5*1
    = 555 = 111111111111111
8×2 = 7×2+2
   == 1×2+2+2+2+2+2+2+2
    = 2+2+2+2+2+2+2+2 := 16

2*8 = 2+2*7 = 22+2*6
   == 2222222+2*1
    = 1111111111111111
9×1 = 8×1+1
   == 1×1+1+1+1+1+1+1+1+1
    = 1+1+1+1+1+1+1+1+1 := 9

1*9 = 1+1*8 = 11+1*7
   == 11111111+1*1
    = 111111111

At the final iteration the identity operation is dropped, so the item operand is left over. Either remove and finish the remaining additions, or remove pop + and *1 and return the result.


+ Advanced System

Without direct repetition we must protect a multiplication from its own stepwise evaluation. The single pop + plus, that we put in between, works the same as the old plus: it postpones addition.

n*r2 = n+n*r1
     = n+n+n*r = nn+n*r

Our multiplication rule inserts an addition n+ on the left. At next steps n+ the former addition shifts left and drops its plus, which adds n to the subtotal.
Generally we introduce a new pop and eliminate the plus from the former pop to activate that operation in one go. For each superoperation there is one suboperation kept waiting.

So we can multiply stepwise without inconsistency. But to allow the old addition + gives some pain. Then we should use a double plus ++ to set apart the evaluation subspace on the outside (far left).
Surely in big number arithmetic, we may require the use of brackets m*(n**r) to append lower operations under minority precedence. And deprecate the m+n**r legacy plus.

Berlin 1910, lady mason on a ladder high above a smokey city

Friday, 12 August 2016

Endless Numeration

endless iteror #2

Numeration

Frances K*, 2016

Learn to create ever bigger numbers
in an article series on site and blog,
dedicated to Chelsea Manning hero.

© Kreative commons

#2 Numeration

We will unravel how decimal notation works, see how large numbers are handled in history, and explore the boundaries of mathematics.

2.1 Radix notation

The numbers you use daily are in the decimal system. This is a type of radix notation with number base 10 called ten. Although in any radix its base is written as one zero 10.
Here we show numbers in decimal base on an orange background.

You've forgotten (internalized) how this actually works, it's complicated.
The base determines a set of digits in the range 0d<10 to multiply the powers of the base with and add that in series.
This way a word composed of digits equals a unique number n.

Show the popular radices, both in decimal notation (orange) and by simple counting of ones (yellow).

@

 2 =: 11  binary
     {0,1}
 8 =: 11111111  octal
     {0,1,2,3,4,5,6,7}
10 =: 1111111111  decimal base
     {0,1,2,3,4,5,6,7,8,9}
16 =: 1111111111111111  hexadecimal
     {0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f}

We use the sign =: to change between formats.
Click @ to put the digits of each radix on the board.

After you agree on a base, apply repeated multiplication to it. Index each position p by a radix power, starting right with 10^0 = 1 and 10^1 = 10 and put larger powers 10^p on the left (Arabic writing direction).

On each numeral place you can write a digit, that multiplies its radix' power. Then add up that series to get your number, as below.

@

2016 = 1*6+
      10*1+
    10^2*0+
    10^3*2    in base 10
2015 = 1*7+
       8*3+
     8^2*7+
     8^3*3  =: 3737  in base 8
2020 = 1*0+
       2*0+
     2^2*1+
     2^3*0+
     2^4*0+
     2^5*1+
     2^6*1+
     2^7*1+
     2^8*1+    in base 2
     2^9*1+
    2^10*1  =: 11111100100
2018 = 1*2+
      16*14+
    16^2*7 
          =: 7e2  in base 16

Click @ to represent year numbers in different bases.
Or input your own...
in and

 

Radix notation is optimal, because we can uniquely express all natural numbers up to any n within a minimum word space. Any other system with a set of characters of radix size will do worse.

This goes for all natural number bases, but real bases are possible too. Try them in the above App: number 10 in base pi for example.
Radices below 2 show increasing overlap as they approach the lower limit of 1, A growing proportion of their digit series expresses the same numbers. So radices in the range (1,2) could model the overlap produced by arithmetical systems with a basic number.

2.2 Trends in history

The mumbo-jumbo of radix notation soon became automated, else society would now be crippled. What luck that children in the ages before social media were able to learn their elementary operations in decimals. We stand on the shoulders of midgets, as well as giants!

The ancient Egyptians had eight numeral hieroglyphs for the powers of ten up to 10000000 that were directly added in any position to depict numbers and baffle the crowd.
The Romans some MDCLXVI years ago had just those seven letters to work with. Yet the digit concept was already present in speech. D our 500 was quingenti in latin, and 8000 horses octo milia equorum.

The left position of decimal digits is most important. But powers of ten elude the human psyche after a few 1000000000 billion.
Bankers who believe Reaganomics will last, choose to ignore the impact of compound interest and the large debt that produces.
Any growth must stop somewhere, but exponential growth rapidly becomes unsustainable.

For example. If a family of two keeps growing at a general annual rate of 1.1% for 2016 years, it will be larger than the current world population. Enter that on a calculator.
2*1.011^2016 7.6E9
Exponent E9 in scientific notation means that you multiply the decimal factor on its left by *10^9 to get the number, or often an approximation.

A percentage sign % is equivalent to an exponent E-2 on the factor. Multiply the current quantity with that number to get the increase. Add the increase to the quantity, to get the next total.

2.3 Physical limits

Radix notation seems more economical than unary notation, but the extra digit signs employed for number input/output do not help the operations in the throughput. If your goal is to generate extreme numbers, without regard for the unnumbered gaps in between: then using just the character 1 is most frugal, an easy win.

Take the tetration 10^^r1 for example. A unary number 1.. is written in exactly that many places. In radix notation this space is a power of 10 smaller, that is 10^^r digit places.

This reduction in word size is sufficient to express only the simplest tetrations, given the resources of our physical universe.

@

3^^3 = 3^3^3 = 3^27
    =: 111**111111111111111111111111111
     = 7625597484987
     8E12
4^^3 = 4^4^4 = 4^256
     = 10^(log(4)*256)
     10^154.13
     1E154    exponential notation
2^^5 = 2^2^2^2^2 = 2^65536
     = 10^(log(2)*65536)
     10^19728
     E2E4   double exponential notation
3^^4 = 3^7625597484987
     = 10^(log(3)*8E12)
     E4E12
     EEE1    multi-exponential notation

Basically, a power of 10 less subtracts 1 from the tetration iterator.
But even in exponential notation, to approximate moderate input size tetrations, your output becomes too long. Worse is, by reducing your system's precision most numbers will escape the net.

Because we are physical beings we cannot uniquely express the majority of the numbers in the arithmetical sea between the scattered islands of tetration. Even with the help of computers we can only point out a small portion of these illusive numbers in the rather random choice of systems we can make.

According to Seth Lloyd the universe as a computer has at most 10^90 qubits, less than 2^300 binary places. Then the radix representation of tetrations like 4^^4 and 2^^6 by far defeats any known physical data capacity.

The human mind can envision even larger constructs: check out the ancient record 10^^(10^(5*2^120)) in buddhist poetry.
Moving higher, we can still contemplate the strength of our rules, but the big numbers they produce lie wholly beyond imagination…

Berlin 1910, lady mason on a ladder high above a smokey city