Kashirin I. (mod 18.01.2020)
Hierarchical numbers are numbers of the form [s] a0 . a1 . a2 . ... . ai . ... .an ,
where ai are positive integers from the set N = {0, 1, 2, 3...}. s is the symbol of the "+" or "-" sign,
a positive sign may not be specified.
For example, hierarchical numbers may look like this:
0.0.12.48.0 or -2.33.0.0.4 .
The symbol denoting the set of hierarchical numbers is H.
Applied definition of decimal hierarchical numbers
Briefly, the idea of hierarchical numbers is as follows. Let N be the set of integers, including 0 and negative elements.
N = {…, -3, -2, -1, 0, 1, 2, 3, …}
Let there also be a distinct symbol "." The set A = N ᴗ "." is defined as the alphabet with integers n ∈ N, "ᴗ" is the set union operation, "." is the level separator symbol, and "∈" is the set-theoretic relation of element membership in a set.
Then the grammar:
h → < n >, h → < n > . <h>
describes the set of binary hierarchical numbers H with elements h.
Examples of hierarchical numbers:
-42.0.1.0.4, 4, -12, 0.1.1.0.
Hierarchical numbers have a graphical interpretation, in which they correspond to the numerical indices of the vertices of trees with a single root vertex n ∈ N. The number of such trees is equivalent to the set N, since the root vertex of any such tree is vertex n, which does not have the symbol "." in its spelling.
Descent to vertex n1 one level down from vertex nx is performed by the binary operation "+" (nx + ny = nx . ny ), ascent from vertex n1 . n2 up is performed by the unary operation "--" (n1 . n2 -- = n1, 0-- = 0). Thus, any hierarchical number is either an integer or starts with an integer and contains integers in its structure, separated by periods.
Let's give some examples.
Let { n1 , n2 , n3, n4, nx } ⊂ N.
n1 . n2 + n3 . n4 = n1 . n2 . n3 . n4 , n1 . n2 . n3 -- = n1 . n2,
0.nx + 0 = 0.nx.0, 0.0 + 0 = 0.0.0, 0 + -4 = 0.-4,
nx -- = nx . 41-- = 41, -33 + 0 = -33.0, -33-- = -33.
These numbers are already used in one way or another in the practice of classification or addressing, for example: a universal decimal code or the IP address of a computer on a global network. However, the introduction of
an algebraic system of hierarchical numbers makes it possible to perform operations with them similar to formal arithmetic, and to isolate binary relations for their comparison and analysis of non-trivial properties of operations and relations.
More complex are the operations {º, ^, ||}.
The "º" operation calculates the common ancestor of two vertices, for example:
45.-1.0.0.12 º 45.-1.1.0.12 = 45.-1, 1.-2.14 º -5.3.3.3 = 0.
That is, if there is no common ancestor, the result of the operation is 0.
The "^" operation calculates a path from one node to another through a common ancestor. The hierarchical number identifying the common ancestor is omitted, for example:
45.-1.0.0.14 ^ 45.-1.1.0.12 = [(45.-1.0.0.14 → 45.-1.0.0 → 45.-1.0 → 45.-1) → (45.-1.1 → 45.-1.1.0 →
45.-1.1.0.12)] = 14.0.0.1.0.12,
where the "→" symbol denotes one step of the tree transition from node to node.
Finally, the unary operator "||" calculates the length of the hierarchical number, for example:
|14.0.0.1.0.12| = 6 .
Here, we utilize the property of the algebra of hierarchical numbers H, defined as an algebra encompassing the formal arithmetic of integers. Indeed, the algebra of integers (arithmetic) is a special case of the algebra H if we extend it to include the arithmetic operations of addition, subtraction, and multiplication. After considering the semantics of these operations, we can define the universal arithmetic algebra H of hierarchical numbers:
H = < H, Ω >, Ω = {+ (2), --(1), º(2) , ^(2), ||(1)},
where H is the carrier set, and Ω is the signature of the algebra, i.e., the set of operations. The operations {+, º , ^} are binary, while the operations {--, ||} are defined as unary.
The algebra considered can be supplemented to an algebraic system H = < H, Ω, R > by introducing a set of relations R = {< , >, ~, = }, where the relations "a > b" and " b < a " mean, respectively, "the number a is more complex than the number b" and "the number b is shorter than the number a". The symbols "~" (a~b) and "=" (a = b) denote, respectively, the relations "equality of the lengths of the numbers a and b" and complete coincidence of the numbers.
Consider the algebra of binary hierarchical numbers.
Let B be a set of numbers with elements {0, 1}, n ϵ B (n = 0 or n = 1), let there also be a highlighted character ".".
The set A = B ᴗ "." ᴗ L
ĥ → L, ĥ → h, ĥ → -h,
h → < n >, h → < n > . <h>
describes a set of binary hierarchical numbers H with elements of h.
Examples of binary hierarchical numbers can be given: 0.1.0.0.1 or 1.0.-1.0 .
Binary hierarchical numbers are numerical indices of the vertices of two
binary trees: positive and negative with one common vertex 0.
The generation of a vertex to the left of 0 is performed by the binary operation 0+0 = 0.0, the generation of a vertex to the right is performed by the binary operation 0 + 1 = 0.1.
The generation of negative vertices is performed by the operation "-", respectively:
0-0 = -0.0, 0-1 = -0.1.
Graphically, this can be represented by a tree spreading in a positive or negative direction (Figure 1):

Figure 1 – An image of algebraic operations in the form of trees
However, using negative elements can make the meaning of operations more complicated. For example, the generation of the "+" trace may look like this:
0.1 + 1.1 = 0.1.1.1, 0 + 0.1 = 0.0.1
However, the example 0.0.-1 + 1.1 = 0.0.-1.1.1 indicates the presence of more complex tree travel routes using not only descent but also local ascents. This application of hierarchical numbers will be discussed further with specific examples.
The reverse operation of generation, the removal of the terminal vertex "--", is unary:
0.1.1.1-- = 0.1.1, 0.1.0-- = 0.1, 0.-1.-1 -- = 0.-1.-1 .
In graphical interpretation, the number can be considered the absolute index of any vertex, i.e. starting from the top of the tree 0 or relative, displaying the path through the tree from one of any vertices to other vertices up and down.
The absolute index always starts with the character 0.
When solving practical problems, only the positive part of the algebra of binary hierarchical numbers can be considered. In this case, operations claiming to receive a negative index will have a result of 0.
One more rather popular operation can be cited, namely, the calculation of the most common vertex, which is interpreted as a search for a common ancestor of two argument vertices:

Figure 2 – Another example of hierarchy
This generalization/multiplication operation is commutative, i.e. a º b = b º a.
Multiplying a positive number by a negative number always equals 0.
The important operation is "Ù" as the calculation of the path from the vertex given by the first argument to the vertex given by the second argument. For the previous figure, examples of such calculations could be given:
0.1.0 Ù 0.1.1.1 = 0.1.0. 0.1. 0.1.1. 0.1.1.1
0.1.1.1 Ù 0.1.0 = 0.1.1.1 0.1.1. 0.1 0.1.0
0.1.0. 0.1. 0.1.1. 0.1.1.1 @ 0.1.1.1 0.1.1. 0.1 0.1.0
Here “@” relation of equality of lengths of two hierarchical numbers.
However, such a calculation leads to an unnecessarily complex result.
Note that the common ancestor for 0.1.1.1 and 0.1.0 is 0.1, from which both numbers begin.
As a result, when calculating the operation Ù vertex to the second.
This is necessary to get an idea of the complexity of the path from the first vertex to the second, regardless of the depth of the tree.
Then the correct operation Ù will be like this:
0.1.0 Ù 0.1.1.1 = [0.1.]0. [0.1.] [ 0.1.]1. [ 0.1].1.1 = 0.1.1.1
0.1.1.1 Ù 0.1.0 = [0.1.]1.1 [0.1.]1. [0.1] [0.1.]0 = 1.1.1.0
0.1.1.1 @ 1.1.1.0
After considering the semantics of the above operations, we can define a universal arithmetic algebra of hierarchical
numbers H:
H = < H, Ω >, Ω = {+, -, --, º , Ù, ⊕},
where Ω is the signature of the algebra, i.e. many operations.
All operations are binary, except for "--", which is unary. The meaning of the operation “⊕” will be discussed later,
using relevant examples.
The considered algebra can be supplemented to the algebraic system
H = < H, Ω, R > by introducing a set of relations R = {< , >, @ , = },
where the relations “a > b” and “b < a”, respectively, “the number a is more complex numbers b" and "number b is
shorter than number a."
A brief example of a taxonomy is shown in the figure.

Figure 3 – Brief taxonomy example
A special case of hierarchical numbers (HN) is the algebra of integers. When calculating the proximity of the vertices, the numbers are obtained: 1, 45, 0, etc. But this is an HN of the upper root level. They can be interpreted as the index of the vertex 0, 1, or simply as an integer. Moreover, starting from the number 2, there cannot be such an index at the upper level. The sum of complex HN can be considered either undivided (in integers, too, it cannot be divided by 0), or calculated as the sum of paths from the root vertex. This is interesting when considering phrases and sentences with the calculation of semantic similarity.
More examples on this site in articles about icf taxonomies.





