978-1-5386-1810-3/17/$31.00 ©2017 IEEE
617
A Stream Processing Approach to Distance
Measurement of Integers in p-adic Metric Space
Wenlong Yi
#*1
, I. V. Gerasimov
#2
#
Saint Petersburg Electrotechnical University "LETI"
St. Petersburg, Russia
*
Jiangxi Agricultural University
Nanchang, China
1
yiwenlong@jxau.edu.cn,
2
IVGerasimov-45@yandex.ru
S. A. Kuzmin
1
, Huojiao He
2
1
Saint Petersburg Electrotechnical University "LETI"
St. Petersburg, Russia
2
Jiangxi Agricultural University
Nanchang, China
Abstract—This paper takes the p-adic representation of
integers as the research object to realize the distance
measurement of integers in the p-adic metric space. The authors
firstly apply the Euclidean algorithm to infer the coefficients of a
positive integer in polynomial representation, whose
corresponding negative integer can be obtained with the help of
the similar solution method of binary complement; secondly, the
coefficients are respectively mapped into from mod p to mod the
n-th power of p layers, where n can be 0 to approaching infinite
integer; lastly, the distance measurement method and the data
storage structure based on multi-way tree are achieved by Java 8
programming and the library Javaslang. The research results
can be applied in p-adic numbers representation and non-
Euclidean space task solutions based on p-adic metrics.
Keywords—distance measure; p-adic; metric space; multi-way
tree; stream processing
I. I
NTRODUCTION
It is 120 years since the concept of p-adic numbers was put
forward in the paper by the Germany mathematician Kurt
Hensel in 1897 [1]. It is equipped with not only excellent
algebraic properties, for example, the integral algebraic system
composed of it is the finite commutative ring to satisfy the
addition and multiplication operation, but also the properties
like intuitively describing the nonlinear topological structure.
Therefore, it is widely applied in various fields such as quantum
physics, biology, optimization theory and error-free
computation. For instance, Vladimirov and Volovich introduced
formalized the probability measurement of p-adic quantum
mechanics in the generalized function space[2]. After
establishing a 5-adic model to simulate the DNA sequences,
Dragovich et al. found that the gene encoding degradation was
related to the p-adic distance between codons[3]. Gregory and
Krishnamurthy introduced p-adic-based error-free computation
theory in details in their books, indicating that it enabled the
computer to eliminate round-off error in the calculation [4].
Murtagh adopted p-adic to encode the sparse data, and the
experiment revealed that the time complexity of the content
search was a constant [5]. Starting from a programming point of
view, this paper firstly designs a distance algorithm of integers
in the p-adic metric space, then creates a suitable data structure
for p-adic numbers; and finally realizes the above program
through the data stream processing method.
II. B
ASIC CONCEPT AND METHOD
A. Metric space
Definition 1: given a nonempty set S, where d
is a
function to measure the distance between any two elements in
this set
:dS S×→
. For
,,xyz S∀∈
, the function needs to
satisfy the below axioms:
(i) Non-negativity:
(, ) 0dxy>=
, and
(, )dxy
=0, iff
xy=
;
(ii) Symmetry:
(, ) (,)dxy dyx=
;
(iii) Triangle inequality:
(,) (, ) (,)dxz dxy dyz≤+
or
Strong triangle inequality:
(,) max (, ), (,)dxz dxy dyz≤
.
In which, the triangle inequality in the axiom (iii) is
applicable to the Euclidean space, while the strong triangle
inequality is suitable for the non-Euclidean space, such as the
p-adic metric space.
Definition 2:
in the rational number field
, if there is a
nonzero element
/
y
α
=
, where
,{0}xy∈−
and they
are co-prime, then
α
can be uniquely expressed by (1) [4].
n
c
d
=
α
. (1)
Where,
is a given prime number;
,,cdn∈
;
0d ≠
; c
and d do not divide
p
, then a rational number
α
is measured
by
, as shown in (2).
00
.
0
n
p
if
pif
−
=
=
≠
α
α
α
. (2)
The distance function defined in (2) can satisfy to the
above axiom (i) to axiom (iii). In addition, Koblitz specifically
deduced (2) in [6], and composed it as a proposition, where
is a norm in
.
The metric space in (
, d) is not complete. For example,
taking two arbitrary limited series of the irrational number
π
,
their distance not always smaller than any given
ε
. In the