Here's a sample C# application that implements structured numbers. (Practial use of this number is unknown :) )
The maths
The StrutucredNumbers sample contains an implementation of the binary tree operation developped by V. Blondel in Structured Numbers, Properties of a hierarchy of operations on binary trees, Acta Informatica, 35, 1-15, 1998.
We introduce a hierarchy of operations on (finite and infinite) binary trees. The operations are obtained by successive repetition of one initial operation. The ¯rst three operations are generalizations of the operations of addition, multiplication and exponentiation for positive integers.
In the paper, the author defines countably many internal operations on binary trees. The first operation, which he denote by .1. , is obtained by forming the binary tree whose left and right subtrees are equal to the operands. This operation is not associative. The second operation .2. is defined as follows: From the binary trees a and b we construct the binary tree a.2.b by repeating the operation .1. on the tree a with the structure dictated by b. In the same way, we define an operation .3. by repeating .2. , an operation .4. by repeating .3. , etc. We eventually obtain countably many internal operations ( .k. for k>= 1) with the definition
a .k. b = a^(k-1).a^(k-1).a^(k-1)...a^(k-1).a,
where there are b factors.
The code
The code is mainly composed of the BtNode that implements the algebra defined above and some valuators for the tree. At last, NGraphviz is used to render to trees :)
The results
Suppose that we have
x = .. y = ..
Page rendered at Sunday, September 07, 2008 8:25:21 PM UTC
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.