Next Article in Journal
Following the Writer’s Path to the Dynamically Coalescing Reactive Chains Design Pattern
Next Article in Special Issue
Exploratory Data Analysis and Searching Cliques in Graphs
Previous Article in Journal
Simultaneous Calibration of European Option Volatility and Fractional Order under the Time Fractional Vasicek Model
Previous Article in Special Issue
A Generalized Framework for the Estimation of Edge Infection Probabilities
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Binary Numeration System with Alternating Signed Digits and Its Graph Theoretical Relationship

Bolyai Institute, University of Szeged, Aradi vértanúk tere 1, 6720 Szeged, Hungary
Algorithms 2024, 17(2), 55; https://doi.org/10.3390/a17020055
Submission received: 27 December 2023 / Revised: 19 January 2024 / Accepted: 23 January 2024 / Published: 25 January 2024

Abstract

:
The binary number system is the basic number representation in computing. We can encode natural numbers with finite 0-1 sequences. The representation of natural numbers is based on this system. However, this poses problems and is technically not perfect. Several attempts have been made to handle integers (signed numbers). We mention only two: the balanced triple number system and the number system with base 2 . Our paper introduces new possibilities. We also shed light on the graph theoretical background of the new number systems.

1. Introduction

Positional number systems are fundamental in mathematics (see [1]). The development and spread of the number system with base 10 is a major achievement of ancient/medieval mathematics. The advent of computers gave special importance to the number system with base 2. These number systems encode natural numbers as a finite sequence of digits. The positions in a sequence of digits are local values weighted by the digits. The sum of these weighted values is a number, coded by the representation.
In the number system with base 2, the digits are 0 / 1 (they are called bits), and the values of the positions are …, 16, 8, 4, 2, 1. This basic theorem of the binary system can be formulated as follows.
Theorem 1.
Every natural number can be written uniquely as the sum of distinct powers of two, where the order of the members of the sum does not matter.
First note that the empty sum is also considered; its value is 0. The value of a sum with one term is the value of the only term. Second, we eliminate the freedom in the order of the terms by listing them following increasing order, that is, writing down the number n
n = 2 α + 2 β + + 2 ω , where α > β > > ω .
The digits 0 do not contribute to the value; hence, we do not include them in the sum.
The ternary number system can be introduced in a similar way. In the number system with base 3, the digits are 0, 1, and 2, and the local values are …, 81, 27, 9, 3, 1.
The decimal number system can be discussed similarly. All number systems are suitable for the unique encoding of natural numbers. If we want to consider integers, the usual method is to introduce signed numbers. Following a + / sign, we encode the absolute value of a number. The mathematical beauty is somewhat compromised: + 0 and 0 are two codes for the same number.
It helps if you use negative digits. Then, the positive/negative numbers can be handled homogeneously. This option was first published by J. Colson [2]. Later, independently, A. Cauchy [3] also discovered this possibility. A survey on the subject was published in Kvant [4].
If we have digits { 1 , 0 , 1 } (or more generally, a subset of the integers that is closed under taking opposite), then the sign change will be the sign changes of the digits. This advantage was also noticed by Shannon [5].
When designing multiple computer architectures, this advantage was considered [6,7,8,9,10,11,12,13]. The digits 1 , 0, and 1 can be called trits. Their technical realization is possible. Two early architectures build on this [12,13,14]. Many have looked in more depth at the ternary computers [15,16]. Currently, binary architecture—thanks to its explosive development—is the single dominant technology.
We highlight two possibilities where integers are represented by a finite sequence of 1 / 0 / 1 digits.
The first is the balanced ternary system. In this number system, the digits 1 , 0, 1 are powers of 3 of the local values [17]. The advantage of this number system is that all integers can be represented and the representation is unique. Donald Knuth’s well-known statement, in his excellent book [18], describes this system as ”Perhaps the prettiest number system of all is the balanced ternary notation,…”
The second is the negabinary. Here, the number system is based on 2 . The local values are the powers of 2 , and the digits 0 and 1. We can expand ( 2 ) α and consider it as 2 α with a possible sign.
For further systems, see [19,20,21,22].
In this note, we propose several new numeral systems based on our main theorem, Theorem 2. We present six options to produce a scheme for a unique representation of integers. In spite of their simplicity, I was able to find only one of them in the literature [20].
We call the new number system the alternating binary number system. The idea is that the local values are the same as in the binary system: …, 16, 8, 4, 2, 1 (the powers of two). The digits are 1 / 0 / 1 . Our main addition assumption is that the non-zero digits must alternate. The representation of a given integer using the above rules will be ambiguous. But this ambiguity is limited: all non-zero integers will have exactly two representations. The basic theorem of our paper is the following statement.
Theorem 2.
Every non-zero integer n has exactly two representations as
n = s α 2 α + s β 2 β + + s ψ 2 ψ + s ω 2 ω ,
where α > β > > ψ > ω , s i { 1 , 1 } , for i = α , , ω ; furthermore, any two consecutive signs differ.
Alternation means the s α = s γ = and s β = = s α .
In exactly one of the two forms, ψ is undefined or ψ > ω + 1 (this is called type I). The other has at least two terms and ψ = ω + 1 (this is called type II).
The theorem implies a new numeral system, a new coding of integers with a finite sequence of digits. The sum of the theorem contains the non-zero digits of an alternating binary representation. As usual, we write 1 ¯ instead of the 1 digit. The 1 ¯ and 1 digits are at the corresponding location of the code. The powers of two, which are not present at the sum, correspond to 0 digits. For example,
2023 = 2048 32 + 8 1 = 2 11 2 5 + 2 3 2 0 = 100000 1 ¯ 0100 1 ¯ alt-bin .
The digit associated with s α 2 α is the first digit of the code, which is referred to as the most significant digit. A single 0 digit is the code of the empty sum: 0 = 0 alt-bin . Given a representation/code, a sequence of digits, the number n, can be decoded.
Although uniqueness is not true, the two representations are strongly related. One representation ends with s · ( 2 ω + 1 2 ω ) . The other ends with s · 2 ω . Otherwise, the two representations are the same.
In the next section, we give a proof of this. We briefly mention several conventions which lead to a unique representation.
Finally, we provide the graph theoretical explanation of our main theorem. This is a crucial part of our paper. It can be seen that there are numerous ways to design number systems. After describing the number system, it is no longer difficult to understand the existence and uniqueness of the representation. In some cases, the existence and uniqueness can be automated [23,24]. We present the path we took to introduce our number system.
In this paper, N denotes the natural of natural numbers { 0 , 1 , 2 , } , Z denotes the set of integers, and N + denotes the set of positive integers.

2. The Proof of Theorem 2

The proof will be a simple series of simple claims and their proof.
1. Suppose that
s α 2 α s α 2 β + s α 2 γ
is a non-empty alternative binary representation of the number n. Then, n is not 0 and its sign is equal to the sign of s α .
Indeed,
n = s α ( 2 α 2 β ) + s α ( 2 γ 2 δ ) + ,
where the “brackets” are positive. (Brackets contain two terms, with the possible exception of the last one which might have only one term.)
2. 0 has a single representation, the empty sum.
3. It is enough to prove the theorem for positive integers, assuming that the most significant digit is + 1 .
4. Let n be a positive integer and take an alternative binary representation of it with ( > 0 ) terms. Consider the representation first k ( < ) of the representation and denote their sum by S k . If k is even, then S k < n . If k is odd, then S k > n .
Indeed,
n = ( 2 α 2 β ) + ( 2 γ 2 δ ) + = 2 α ( 2 β 2 γ ) ,
where the “brackets” have positive values.
5. Each positive integer n has an alternating binary representation.
Let us write down n in the binary number system, i.e., as the sum of different powers of two (with strictly decreasing order of exponents). Substitute 2 k + 1 2 k for each power of two: 2 k . We obtain a new representation of our initial number as the sum of signed powers of two; furthermore, the signs alternate. The exponents will be decreasing but not strictly decreasing. There can be only two powers of the same exponent, they must follow each other, and they must have different signs. Thus, they cancel. By performing the cancellations, we obtain a representation of our starting number in the alternating binary number system.
6. Let n be a power of two, i.e., n = 2 k for a suitable natural number k. Then, n has exactly two alternating binary binary representations: 2 k and 2 k + 1 2 k .
We know (4.) that 2 α 1 2 α 2 β n 2 α .
7. If n is between two consecutive powers of two (for a suitable natural number k we have 2 k < n < 2 k + 1 ), then the first term of each representation of n is necessarily 2 k + 1 .
Again, we know (4.) that 2 α 1 2 α 2 β n < 2 α .
8. If 2 k < n < 2 k + 1 ( k N ), then every representation of n is 2 k + 1 ρ where ρ is the representation of the number 2 k + 1 n ( > 0 )
9. If 2 k < n < 2 k + 1 ( k N ), then 2 k + 1 n is strictly smaller than n.
Then, the proof is completed by a simple induction.
In the case of a non-zero number in one of the two options for the representation, the last is non-zero, and the preceding digit is 0 d , or d d ¯ , where d { 1 , 1 } . There are several simple ways to make the representation unique.
Theorem 3.
The alternating binary representation will be unique if any of the following additional conditions are satisfied:
 (a) 
The last non-zero digit must be 1.
 (b) 
The last non-zero digit must be 1 .
 (c) 
The last non-zero digit must be immediately preceded by a 0 digit (or we have only one non-zero digit).
 (d) 
The last non-zero digit must be immediately preceded by a non-zero digit.
 (e) 
The number of non-zero digits is odd.
 (f) 
The number of non-zero digits is even.
The proofs are straightforward.
If we choose any of the rules above, we obtain a numeral system. For example, we can fix (c) as the basic rule of binary alternating coding of integers. We will denote the 1 digit as 1 ¯ and we use subscript 2 - A l t when representing n using place-value notation. We list a few integers with small absolute value and their representation.
11 = 1 ¯ 1 1 ¯ 01 2 - A l t , 10 = 1 ¯ 10 1 ¯ 0 2 - A l t , 9 = 1 ¯ 100 1 ¯ 2 - A l t , 8 = 1 ¯ 000 2 - A l t , 7 = 1 ¯ 001 2 - A l t ,
6 = 1 ¯ 010 2 - A l t , 5 = 1 ¯ 0101 2 - A l t , 4 = 1 ¯ 00 2 - A l t , 3 = 1 ¯ 01 2 - A l t , 2 = 1 ¯ 0 2 - A l t ,
1 = 1 ¯ 2 - A l t , 0 = 0 , 1 = 1 2 - A l t , 2 = 10 2 - A l t , 3 = 10 1 ¯ 2 - A l t , 4 = 100 2 - A l t , 5 = 10 1 ¯ 01 2 - A l t ,
6 = 10 1 ¯ 0 2 - A l t , 7 = 100 1 ¯ 2 - A l t , 8 = 1000 2 - A l t , 9 = 1 1 ¯ 001 2 - A l t , 10 = 1 1 ¯ 010 2 - A l t .

3. Connection to Graph Theory

Let G = ( V , E , I ) be a triple. The elements of V are called vertices; V is the vertex set of G. The elements of E are called edges; E is the edge set G. I is an incidence relation between V and E ( I V × E ). If v V and e E are incident, then we say that the vertex v is an endpoint of the edge e. We call G a graph if every edge has two endpoints.
These two endpoints may coincide, in which case e is called a loop. If an edge e has two endpoints u and v, then we say that u and v are connected by e or u and v are adjacent. If two edges have the same two endpoints, then we say that they are parallel edges. If there are no parallel edges in a graph, we only need to describe when two vertices are connected to define the graph. Moreover, if a graph contains no loops, then we call it a simple graph.
If V and E are finite sets, then G is a (finite) graph. If V or E are infinite, then G is an infinite graph.
Definition 1.
Let G be the infinite graph without parallel edges whose vertices are the natural numbers and two vertices are connected if and only if their sum is a power of two.
Notice that, because 2 k + 2 k = 2 k + 1 for every vertex that is a power of two, a loop is present in our graph. These are the only loops in G . Let G 0 be the simple graph that is obtained by removing the loops that are incident to the powers of two.
It is easy to see that G 0 is a graph of infinitely many vertices, each of which has infinite neighbors. Let v be a vertex of G 0 . If k is the natural number satisfying 2 k 1 < v < 2 k , then the neighbors of v are 2 k v , 2 k + 1 v , and 2 K v , where K is an arbitrary natural number k + 1 < K . If v = 2 k , then the neighbors of v are 0 and 2 K v for every k + 1 < K natural numbers.
Lemma 1.
For positive v N , the vertex v has exactly one neighbor that is smaller than v.
Let G 0 ( n ) be the finite graph is obtained from G 0 such that V n = { 1 , 2 , , n } with n elements and the edges G 0 ( n ) are the edges of G connecting two nodes from V n (see Figure 1).
Theorem 4.
The graph G 0 ( n ) is a tree.
Proof. 
We can think about G 0 ( n ) as a result of the following sequence of graph extensions:
G 0 ( 1 ) G 0 ( 2 ) G 0 ( 3 ) G 0 ( n 1 ) G 0 ( n ) .
The initial graph G 0 ( 1 ) is a graph with one node (1) and no edge, i.e., G 0 ( 1 ) is the smallest tree. Each expansion step is a “branching” (we extend our actual graph with a new vertex and a new edge that connects the new node to an old one). This operation preserves connectivity and cycle-freeness. That is, the operation forms a tree from a tree. □
Corollary 1.
G 0 is a tree.
Thus, there is exactly one path from any vertex, let us call it n, to the vertex 0. We assume that n 0 .
For each edge, label it with the sum of its two endpoints. Thus, we obtain an edge-labeled graph (the labels are powers of two). As the path from n to 0 is traversed, the labels of its edges strictly decrease. The walks with strictly decreasing labels from n to 0 are exactly the paths from n to 0 (that happen to be unique).
This is not true in G . There is a second walk from n to 0 with strictly decreasing edge labels, a walk where the penultimate step is a loop.
The above graph theoretic remark and the alternating binary number system are closely related. The next theorem formalizes this.
Theorem 5.
Let n be a positive integer. Let W n be the set of n 0 walks in G with strictly decreasing edge labels. Let R n be the set of alternating binary representations of n.
Then, there is a bijection between W n and R n .
Remember that G is almost the same as the G 0 graph (a tree), except there are additional loops at the neighbors of 0. Hence, W n consists of two walks: the unique n 0 path P in G 0 , and a walk that is the same as P, except that just before reaching 0 we go along a loop. The bijection, presented below, proves that R n also has two elements, which is the statement of Theorem 2. We can consider Corollary 1 as the graph theoretical analog of Theorem 2.
Proof. 
Let n = 2 α 2 β + 2 γ 2 δ ± be an arbitrary alternating binary representation of n (an element of R n ). We introduce the following numbers: n 0 = n = 2 α 2 β + 2 γ 2 δ ± , n 1 = 2 β 2 γ + 2 δ , n 2 = 2 γ 2 δ ± , n 3 = 2 δ , …, 0. These numbers: n 0 = n , n 1 , n 2 , …, n 1 , n = 0 are vertices in G , and they form a sequence of vertices of walk from n to 0. The labels of the edges are 2 α > 2 β > 2 γ .
Conversely, let us take a walk from n to 0 in G (an element of W n ). Let n = n 0 , n 1 , , n = 0 be the sequence of its nodes. ( n + n 1 ) ( n 1 + n 2 ) + ( n 2 + n 3 ) + s · ( n 1 + n ) is an element of R n , where s is a sign depending on the parity of .
The two mappings are inverses of each other; hence, they prove the theorem. □
We recall that after obtaining the two walks in G we can agree on a condition that makes the route unique. These conditions can be based on the ending of the walk or on parity of the length. At the end of the previous section, we fixed condition (c) in Theorem 3 and gave examples for the concrete representation of small numbers. It is easy to check that condition (c) corresponds to the agreement that the representation is based on the path in the tree G 0 .

4. Graphs Related to Fibonacci Numbers and the Related Numeral System

In this chapter, we apply the previously introduced graph theory technique. The positional values of the binary system are the powers of two. Now, we start with the Zeckendorff numeral system [25,26,27,28]. Its positional values are the Fibonacci numbers.
Denote by ( F i ) i = 0 the Fibonacci sequence ([29] A000045) defined as F n = F n 1 + F n 2 ( n 2 ) with F 0 = 0 and F 1 = 1 . We refer to F 2 < F 3 < F 4 < as the Fibonacci numbers. So, when we mention Fibonacci numbers, we mean elements of the Fibonacci sequence with indices at least 2.
In analogy to the previously introduced G graph, we define a new graph.
Definition 2.
Our graph F has a vertex set consisting of natural numbers. We connect vertices u and v if u + v is a Fibonacci number.
Specifically, 0 is adjacent to exactly the Fibonacci numbers.
In the graph F , there will be loops. First, note that every third Fibonacci number is even. For the sake of completeness, we acknowledge this commonly known fact.
Lemma 2.
F n (for n 2 ) is even if and only if n is divisible by 3.
Proof. 
F 2 = 1 , F 3 = 2 , F 4 = 3 . We prove by induction that for every positive integer k, F 3 k is even, and F 3 k 1 and F 3 k + 1 are odd. For the base case k = 1 , this is known.
We assume that for k = the claim is true: F 3 is even, and F 3 1 and F 3 + 1 are odd. We need to prove that F 3 + 3 is even, and F 3 + 2 and F 3 + 4 are odd. This is straightforward from F 3 + 2 = F 3 + 1 + F 3 , F 3 + 3 = F 3 + 2 + F 3 + 1 , and F 3 + 4 = F 3 + 3 + F 3 + 2 . □
If u = v = F 3 k / 2 , then u + v = F 3 k . Thus, u v forms an edge in F , creating a loop.
The graph F is not a tree, not only because of the loop edges but also because it contains many 4-cycles.
Lemma 3.
If u , v , u , v are non-negative integers such that u + v = F k , u + u = F k + 2 , and v + v = F k + 2 , then u + v = F k + 3 . Specifically, u , v , u , v form the vertices of a 4-cycle.
Proof. 
We only need to check that u + v will be a Fibonacci number with the right index.
u + v = u + u = ( F k + 2 u ) + ( F k + 2 v ) = F k + 2 + F k + 2 ( u + v ) = F k + 2 + ( F k + 1 + F k ) F k = F k + 2 + F k + 1 = F k + 3 .
Thus, the statement is obvious. □
Definition 3.
Let u ( F k ) be a positive integer. Define v = F k u , u = F k + 2 u , v = F k + 2 v ) . The cycle C k ( u ) in the graph F is formed by the edges u v , u u , v v , and u v .
Note that the cycles C k ( u ) and C k ( F k u ) are the same; only the roles of u and v are exchanged.
Lemma 4.
The points of the C k ( 0 ) = C k ( F k ) cycle ( u = 0 , v = F k , v = F k + 1 , u = F k + 2 ) are connected by only one additional edge beside the edges of the cycle: u v . If u is a positive integer that is not a Fibonacci number, then among the points of C k ( u ) , only the edges of the cycle are present.
Proof. 
The points of the C k ( 0 ) cycle are: u = 0 , v = F k , v = F k + 1 , u = F k + 2 . u v is obviously an edge since u + v is a Fibonacci number. u and v may be connected. Because F k + 2 < u + v = F k + F k + 2 < F k + 1 + F k + 2 = F k + 3 , their sum lies between two consecutive Fibonacci numbers, meaning it cannot be a Fibonacci number.
Let a be a positive integer: F < a < F + 1 F k . The points of the C k ( a ) cycle are: u = a , v = F k a , v = F k + 1 + a , u = F k + 2 a . Assume that u v is an edge of F . Then, u + v is a Fibonacci number
u + v = ( F k v ) + ( F k + 2 v ) = F k + F k + 2 2 v < F k + F k + 2 < F k + 3 ;
furthermore,
u + v = F k + F k + 2 2 v > F k + F k + 2 2 F k > F k + 2 F k = F k + 1 .
Therefore, u + v can only take one value as a Fibonacci number: F k + 2 . This value cannot be the label on this edge because it corresponds to the label of the uu’ edge (and the vv’ edge too). Hence, u v cannot be an edge. By the symmetry of u and v, we obtain that u v is not an edge either. □
It will be shown that these cycles, along with the loop edges, are the essential cycles in F. Therefore, it is not difficult to sparsify the F graph to obtain a tree. This is in spite of the fact that some of the 4-cycles share a common edge; hence, they form longer cycles in G .
Definition 4.
Let F 0 be the graph obtained from F by removing the edges connecting 0 to Fibonacci numbers with odd indices, the loop edges, and the u v edges of the 4-cycles C k ( a ) .
Theorem 6.
F 0 is a tree.
The theorem points out a spanning tree of F : F 0 .
Proof. 
Let F 0 ( n ) be the spanning subgraph of F 0 formed by the vertices 0 , 1 , 2 , , n and the edges between them. It is sufficient to show that for any n, this graph is cycle-free and connected.
For small values of n, it is easy to verify the statement. See F 0 ( 25 ) on Figure 2.
By induction, we prove that F 0 ( F k ) is a tree. Assume that we know this for F 0 ( F ) . We add the vertices F + 1 , F + 2 , , F + 1 1 , F + 1 to it and check that our graph remains a tree. We do this by proving that by adding any of these numbers it will be connected to exactly one earlier (smaller) node.
In the case of F + 1 , this is true. In F , there are two earlier neighbors of it: 0, and F . If + 1 is even, then 0 is connected to F + 1 , but F F + 1 is the deleted edge of C 2 ( 0 ) in F 0 . If + 1 is odd, then 0 F + 1 is a deleted edge, but F F + 1 is a remaining edge of C ( 0 ) in F 0 .
The same logic works in the case of F + i , where 0 < i < F 1 . In F , there are two earlier neighbors of it: F + 1 ( F + i ) = F 1 i , and F + 2 ( F + i ) = F + 1 i . The two connecting edges are in two 4-cycles. In one of them, the edge is deleted; in the other, it is not deleted. F + i has exactly one earlier neighbor in F 0 . □
As previously, we can label the edges. The label of an edge will be the sum of the numbers corresponding to its endpoints. The labels are Fibonacci numbers.
Lemma 5.
Consider G 0 as a graph with labeled edges. In this case, the edge labeling possesses the following two properties:
 (a) 
The edges incident to 0 have labels that are even-indexed Fibonacci numbers.
 (b) 
The labels of two adjacent (sharing a common endpoint) edges cannot correspond to Fibonacci numbers with consecutive indices.
Proof. 
The labeling can also be introduced for the edges of graph F . It is worth noting that both statements are false in F . In F 0 , both statements become true due to the definition of F 0 , which is a result of sparsifying F .
In F , all Fibonacci numbers appear on edges incident to 0. In the definition of F 0 , we precisely excluded those edges whose labels correspond to odd-indexed Fibonacci numbers. This yields statement (a).
Let us consider two adjacent edges in F with label Fibonacci numbers that correspond to consecutive indices. Suppose these two edges are u u and u v with labels F k and F k + 1 . Then, due to the C k 2 ( u ) cycle, the edge u v is not present in F 0 . This confirms statement (b). □
The claim of this lemma and the fact that F 0 is a tree leads to a new numeral system. The logic is the same: we have a tree defined on the set of natural numbers. From a vertex n, there is unique path to 0. This path can be converted to a representation of n. The existence and uniqueness follow from graph theory.
Theorem 7 (Fibonacci-alternating representation).
Every natural number n can be written uniquely as a sum
n = F F i 1 + F i 2 F i 3 + + ( 1 ) t 1 F i t 1 ,
with i 0 = i 1 i 2 i t 3 i t 2 i t 1 2 , where i j denotes i > j + 1 (i.e., i j + 2 ); furthermore, i t 1 is even. This sum is called the alternating representation of n.
The proof of Theorem 7 is based on Theorem 6.
Proof. 
Any natural number n can be considered as a vertex in F 0 . There is a unique n 0 path in F 0 . Let n = n 0 , n 1 , , n = 0 be the sequence of its nodes. n = ( n + n 1 ) ( n 1 + n 2 ) + ( n 2 + n 3 ) + s · ( n 1 + n ) , where s is a sign depending on the parity of . The values of the expressions in the brackets are Fibonacci numbers. We obtain the existence of the presentation.
For the uniqueness, assume that we have two representations of n. Both of them can be interpreted as the 0 n path in F 0 (see the proof of the binary case). Since F 0 is a tree, we obtain a contradiction that proves the theorem. □
As previously, we can extend this representation to integers. We give a few examples of this new representation that we denote by F-Alt indices:
11 = 1 ¯ 0010 1 ¯ F-Alt , 10 = 1 ¯ 00100 F-Alt , 9 = 1 ¯ 0100 1 ¯ F-Alt , 8 = 1 ¯ 0000 F-Alt ,
7 = 1 ¯ 0001 F-Alt , 6 = 1 ¯ 010 1 ¯ F-Alt , 5 = 1 ¯ 0100 F-Alt , 4 = 1 ¯ 001 F-Alt , 3 = 1 ¯ 00 F-Alt ,
2 = 1 ¯ 0 F-Alt , 1 = 1 ¯ F-Alt , 0 = 0 F A l t , 1 = 1 F A l t , 2 = 10 1 ¯ F A l t , 3 = 100 F A l t ,
4 = 100 1 ¯ F A l t , 5 = 10 1 ¯ 00 F A l t , 6 = 1010 1 ¯ F A l t , 7 = 1000 1 ¯ F A l t ,
8 = 10000 F A l t , 9 = 10 1 ¯ 001 F A l t , 10 = 100 1 ¯ 00 F A l t , 11 = 100 1 ¯ 01 F A l t .
The new numeral system is based on a spanning tree of G . The graph G has many cycles. Finding a spanning tree of it is not natural. There are several ways to construct one.
It is possible to describe a different spanning tree and introduce a new numeral system with Fibonacci numbers as place-values. Such numeral systems already exist; for example, see [30,31] for considered numeral systems. The connection between them and graph theory has not been explored so far.

5. Conclusions

The representations we described are very simple (one can say beautiful). Our results may inspire new research. The new number system raises many questions. How can basic operations be performed with numbers based on the new representation? How can numbers in the conventional notation be converted to the new one? What is the complexity of our algorithms? These questions have led to numerous results in the case of previous number systems (see [16,32,33,34,35,36,37]).
A new number system stimulates new research. The Zeckendorf number system is a good example [25]. After the introduction of that number system, research in several directions was initiated. The distribution of digits and algorithms for arithmetic were studied [38]. Later versions with negative digits [30,31,39] were developed. Many other areas of mathematics were connected to these notions. We mention only one, the research of automatic sequences.
The graph G in the last section is also natural; the proof of the fact that G 0 is a tree is simple. Finally, I found some hints to this claim in the literature. The graph G 0 arises naturally when one considers “Problems with Powers of Two”, the problem introduced by B. Haran and N.J.A. Sloane [40]. In the Online Encyclopedia of Integer Sequences (QEIS), T. Scheuerle makes a comment to A352178 [41]. He is probably formulating this claim.
After stating the theorems on representing integers, the uniqueness and existence of the state representation can be easily proven through elementary means, much like we did with the binary system. There are automated proofs as well. However, the essence of everything lies in stating the theorem; this is where mathematics begins.
Our article highlights that graphs can be defined in various ways from numbers. Often, a spanning tree for these graphs can be naturally identified. This tree can be viewed as a tree rooted at 0. Each vertex/natural number has a unique path leading to 0. This corresponds to a number-theoretic representation of n. The recognition of this relationship between graph theory and number systems seems entirely novel.

Funding

The research was carried out as part of Project no. TKP2021-NVA-09, which has been implemented with the support provided by the Ministry of Innovation and Technology of Hungary from the National Research, Development, and Innovation Fund, financed under the TKP2021-NVA funding scheme.

Data Availability Statement

Data are contained within the article.

Acknowledgments

I am grateful to Jeff Shallit for many literary references and helpful advice. I would like to express my gratitude to the anonymous reviewers for their thorough work, their ideas to make the presentation clearer, and their supportive words.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Allouche, J.-P.; Shallit, J. Automatic Sequences: Theory, Applications, Generalizations; Chapter 3: Numeration Systems; Cambridge University Press: Cambridge, UK, 2003. [Google Scholar]
  2. Colson, J. A Short Account of Negativo-Affirmative Arithmetick. Philos. Trans. 1726, 34, 161–173. [Google Scholar]
  3. Cauchy, A. Sur les moyens d’éviter les erreurs dans les calculs numériques. In Comptes Rendus Hebdo Madaires des Séances de l’Académie des Sciences; Elsevier: Amsterdam, The Netherlands, 1840; pp. 789–798. [Google Scholar]
  4. Zlatopol’skiy, D. Are there negative digits? Kvant 2021, 4, 11–16. (In Russian) [Google Scholar]
  5. Shannon, C.E. A Symmetrical Notation for Numbers. Am. Math. Mon. 1950, 57, 90–93. [Google Scholar] [CrossRef]
  6. Alexander, W. The ternary computer. Electron. Power 1964, 10, 36–39. [Google Scholar] [CrossRef]
  7. Eaton, M. Design and construction of a balanced ternary ALU with potential future cybernetic intelligent systems applications. In Proceedings of the 2012 IEEE 11th International Conference on Cybernetic Intelligent Systems (CIS), Limerick, Ireland, 23–24 August 2012. [Google Scholar]
  8. Glusker, M.; Hogan, D.M.; Vass, P. The Ternary Calculating Machine of Thomas Fowler. Ann. Hist. Comput. 2005, 27, 4–22. [Google Scholar] [CrossRef]
  9. Halpern, I.; Yoeli, M. Ternary arithmetic unit. Proc. IEEE 1968, 115, 1585–1588. [Google Scholar] [CrossRef]
  10. Hayes, B. Third Base. Am. Sci. 2001, 89, 490–494. [Google Scholar] [CrossRef]
  11. Hayes, B. Group Theory in the Bedroom, and Other Mathematical Diversions; Chapter 10; Hill and Wang, A Division of Farrar, Straus and Giroux: New York, NY, USA, 2008. [Google Scholar]
  12. Selling, E. Eine Neue Rechenmaschine; Springer: Berlin/Heidelberg, Germany, 1887. [Google Scholar]
  13. Brousentsov, N.P.; Maslov, S.P.; Alvarez, J.R.; Zhogolev, E.A. Development of Ternary Computers at Moscow State University, Russian Virtual Computer Museum. Available online: https://www.computer-museum.ru/english/setun.htm (accessed on 22 January 2024).
  14. Fowler, T. Tables for Facilitating Arithmetical Calculations Intended for Calculating the Proportionate Charges on the Parishes in Poor Law Unions; Nabu Press: Charleston, SC, USA, 2010. [Google Scholar]
  15. Frieder, G.; Luk, C. Ternary Computer. In Proceedings of the 5th Annual Workshop on Microprogramming Elektronika, Urbana, IL, USA, 25–26 September 1972. [Google Scholar]
  16. Frieder, G.; Luk, C. Algorithms for binary coded balanced and ordinary ternary operations. IEEE Trans. Comput. 1975, 24, 212–215. [Google Scholar] [CrossRef]
  17. Gardner, M. Mathematical Games, The “tyranny of 10” overthrown with the ternary number system. Sci. Am. 1964, 210, 118–128. [Google Scholar] [CrossRef]
  18. Knuth, D.E. The Art of Computer Programming, Volume 2: Seminumerical Algorithms, 3rd ed.; Addison-Wesley: Reading, MA, USA, 2011. [Google Scholar]
  19. Güntzer, U.; Paul, M. Jump interpolation search trees and symmetric binary numbers. Inf. Process. Lett. 1987, 26, 193–204. [Google Scholar] [CrossRef]
  20. Okeya, K.; Schmidt-Samoa, K.; Spahn, C.; Takagi, T. Signed Binary Representations Revisited. In Advances in Cryptology—CRYPTO 2004; Franklin, M., Ed.; Springer: Berlin/Heidelberg, Germany, 2004; pp. 123–139. [Google Scholar]
  21. Prodinger, H. On binary representations of integers with digits. Integers 2000, A8. [Google Scholar] [CrossRef]
  22. Shallit, J. A Primer on Balanced Binary Representations. 1993. Unpublished Manuscript. Available online: https://cs.uwaterloo.ca/~shallit/Papers/bbr.pdf (accessed on 22 January 2024).
  23. Shallit, J.; Shan, S.L.; Yang, K.H. Automatic Sequences in Negative Bases and Proofs of Some Conjectures of Shevelev. arXiv 2022, arXiv:2208.06025. [Google Scholar] [CrossRef]
  24. Shallit, J.; Shan, S.L. A General Approach to Proving Properties of Fibonacci Representations via Automata Theory. Electron. Proc. Theor. Comput. Sci. 2023, 386, 228–242. [Google Scholar] [CrossRef]
  25. Zeckendorf, E. Unpublished observation from 1939.
  26. Zeckendorf, E. Représentation des nombres naturels par une somme des nombres de Fibonacci ou de nombres de Lucas. Bull. Soc. Roy. Sci. Liège 1972, 41, 179–182. [Google Scholar]
  27. Lekkerkerker, C.G. Voorstelling van Natuurlijke Getallen Door een som van Getallen van Fibonacci; Stevin, S., Ed.; Stichting Mathematisch Centrum: Amsterdam, The Netherlands, 1951; Volume 29, pp. 190–195. [Google Scholar]
  28. Ostrowski, A. Bemerkungen zur Theorie der Diophantischen Approximationen. Abh. Math. Sem. Hamburg 1922, 1, 77–98. [Google Scholar] [CrossRef]
  29. OEIS. The On-Line Encyclopedia of Integer Sequences. Founded in 1964 by N.J.A. Sloane. Available online: https://oeis.org/ (accessed on 22 January 2024).
  30. Alpert, H. Differences of multiple Fibonacci numbers. Integers Electron. J. Comb. Number Theory 2009, 9, 745–749. [Google Scholar] [CrossRef]
  31. Hajnal, P. A short note on Zeckendorf type numeration systems with negative digits allowed. Bull. ICA 2023, 97, 54–66. [Google Scholar]
  32. Ahlbach, C.; Usatine, J.; Frougny, C.; Pippenger, N. Efficient algorithms for Zeckendorf arithmetic. Fibonacci Q. 2013, 51, 249–255. [Google Scholar]
  33. Avizienis, A. Signed-Digit Number Representations for Fast Parallel Arithmetic. IRE Trans. Electron. Comput. 1961, EC-10, 389–400. [Google Scholar] [CrossRef]
  34. Booth, A.D. A signed binary multiplication technique. Quart. J. Mech. Appl. Math. 1951, 4, 236–240. [Google Scholar] [CrossRef]
  35. Das, S.; Sain, J.P.; Dasgupta, P.; Sensarma, S. Algorithms for Ternary Number System. Procedia Technol. 2012, 4, 278–285. [Google Scholar] [CrossRef]
  36. Idziaszek, T. Efficient Algorithm for Multiplication of Numbers in Zeckendorf Representation. In Proceedings of the 10th International Conference on Fun with Algorithms (FUN 2021), Sicily, Italy, 30 May–1 June 2021; Volume 157, pp. 16:1–16:9. Available online: https://drops.dagstuhl.de/opus/volltexte/2020/12777 (accessed on 22 January 2024).
  37. Tee, G.J. Russian Peasant Multiplication and Egyptian Division in Zeckendorf Arithmetic. Austral. Math. Soc. Gaz. 2003, 30, 267–276. [Google Scholar]
  38. Demontigny, P.; Do, T.; Kulkarni, A.; Miller, S.J.; Varma, U. A Generalization of Fibonacci Far-Difference Representations and Gaussian Behavior. Fibonacci Q. 2017, 52, 247–273. [Google Scholar]
  39. Bunder, M.W. Zeckendorf representations using negative Fibonacci numbers. Fibonacci Q. 1992, 30, 111–115. [Google Scholar]
  40. Haran, B.; Sloane, N.J.A. Problems with Powers of Two, Numberphile Youtube Channel. September 2022. Available online: https://youtu.be/IPoh5C9CcI8 (accessed on 22 January 2024).
  41. Scheuerle, T. Comment to A352178 in The On-Line Encyclopedia of Integer Sequences. 23 September 2022. Available online: https://oeis.org/A352178 (accessed on 22 January 2024).
Figure 1. The tree G 0 ( 26 ) .
Figure 1. The tree G 0 ( 26 ) .
Algorithms 17 00055 g001
Figure 2. The tree F 0 ( 25 ) .
Figure 2. The tree F 0 ( 25 ) .
Algorithms 17 00055 g002
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Hajnal, P. Binary Numeration System with Alternating Signed Digits and Its Graph Theoretical Relationship. Algorithms 2024, 17, 55. https://doi.org/10.3390/a17020055

AMA Style

Hajnal P. Binary Numeration System with Alternating Signed Digits and Its Graph Theoretical Relationship. Algorithms. 2024; 17(2):55. https://doi.org/10.3390/a17020055

Chicago/Turabian Style

Hajnal, Péter. 2024. "Binary Numeration System with Alternating Signed Digits and Its Graph Theoretical Relationship" Algorithms 17, no. 2: 55. https://doi.org/10.3390/a17020055

APA Style

Hajnal, P. (2024). Binary Numeration System with Alternating Signed Digits and Its Graph Theoretical Relationship. Algorithms, 17(2), 55. https://doi.org/10.3390/a17020055

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop