Friday 5 August 2016

Endless Counting

endless iteror #1

Counting

Frances K*, 2016

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

© Kreative commons

#1 Counting

In the beginning there is counting, simply on your fingers. With infinite hands you could add up all the natural numbers.

1.1 Unary

To count a quantity, add unit 1 for each item, until all items passed by once. The number of units then equals your quantity.

You can tell a number by its name: counting one, two, three, four, five, or write them with Arabic numerals 1, 2, 3, 4, 5.

But numeral constants are not quantities, and must be translated before a calculation, where you add up fingers again. Or, when you use tables of multiplication, the calculation can stay in the dictionary.

In unary notation we write natural numbers as series 1.. of ones, that repeat the unit 1 a number of :n times.
The number named zero 0 counts nothing   at all.

@

1 = 1
2 = 11
3 = 111
4 = 1111
5 = 11111
6 = 111111
7 = 1111111
8 = 11111111
9 = 111111111
ω = 1..       ..infinity

n = 1.. :n

Click the board to show larger unary numbers.

During counting a number variable is still undefined, but its lower bound n may already be available.

The term unary applies to units 1. When different units can be used, we call this unit notation.
Minus - is an independent unit, with a left and right elimination rule that is dependent on unit 1.

1.2 Addition

We can add m+n unary numbers simply by concatenation. No operation is performed in between, we just remove the plus.

@

mn =
1..1.. 1:m 1:n
   = 1.. :mn

24 =
1..1.. 1:2 1:4
   = 111111 = 6

55 =
1..1.. :5 :5
   = 1111111111 =: 10

4321 =
1..1..1..1 :4 :3 :2
     = 1111111111 =: 10

Show examples with numbers instead of variables.

Natural addition concatenates numbers directly and has precedence over all other operations.
You can still use the old plus + operator to postpone addition. Then V+m+n adds up after subexpression (V) is completely reduced.

We define a minus unit - by adding 1- = 0 to void. Let addition of finite numbers be associative and commutative, then -1 = 0 too.

Negative numbers form by concatenation -.. :k of units minus. We never use a sign for subtraction as the inverse operation of addition.

In recursions we either subtract 1 from an entry r1 or add - to an entry r to count off the next operation. And repeat that == until the operation counter or iterator r is down to 0 or 1 as customary.


+ Advanced System

When we reduce multiplication to addition as part of a larger operation, a neighbouring old plus + causes confusion. But not if a double plus ++ marks the outside of the evaluation subspace. Such a prop works in tandem with pop marks, that set apart suboperations on the inside.

Both the left prop ++ that delimits left iterators and the single pop + there just postpone addition. Double pluses have lowest precedence. For example:
An expression m+n++V evaluates ltr to mn++V first. Operation V further := reduces to mn++p and then adds up to mnp number.

Note that if you + add   void n the pluses in an expression become +.. oversized, but that this need not lead to conflicts.

In our advanced system the parent entry counts down separator arrays. A deeper operation has to add to an initial array that shields it off.
Earlier we prescribed a single first + plus there. Now we start on a dedicated double ++ prop, which is still optional for operations on numbers. Without it a preceding old + plus is pop added on top.

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

No comments:

Post a Comment