ArticlePDF Available

Abstract

This paper provides a short guided tour through the world of pairing functions—bijections between and —as models for computational "situations." After a short discussion of the computationally simplest pairing functions—the Cauchy-Cantor "diagonal" polynomials—we describe in detail two specific computational situations where pairing functions give an unexpectedly simple handle on apparently complex systems-related problems. (1) We discuss the use of pairing functions as storage mappings for rectangular arrays/tables that are extendible, in the sense that the programmer may expand and shrink them dynamically. (2) We discuss the use of pairing functions as the basis for a mechanism for instilling accountability into Web-computing projects, by linking remote "volunteers" to the tasks they compute.
Efficient Pairing Functions—and Why You Should Care
(Extended Abstract)
Arnold L. Rosenberg
Department of Computer Science
University of Massachusetts
Amherst, MA 01003
rsnbrg@cs.umass.edu
Abstract
This paper provides a short tour through the world of
pairing functions—bijections between N
Nand N—as
models for computational “situations. After a short dis-
cussion of the computationally simplest pairing functions—
the Cauchy-Cantor “diagonal” polynomials—we describe
two specific computational situations in some detail: the
use of pairing functions as storage mappings for rectangu-
lar arrays/tables that can expand and shrink dynamically;
the use of pairing functions as the basis for a mechanism
for instilling accountability into Web-computing projects.
1. Introduction
Entia non sunt multiplicanda praeter necessitatem
Occam’s Razor
This famous admonition by William of Occam (14th cent.)
to strive for simplicity is worth heeding when seeking math-
ematical models of computational phenomena. In this spirit,
we describe examples of the use of pairing functions (PFs,
for short)—bijections between N
Nand N, where Nis
the set of positive integers—as the basis for such models.
Our emphasis is on the varied structures that PFs can enjoy,
which allow one to use PFs to model quite disparate com-
putational situations. After due obeisance to the importance
of PFs in foundational studies (in the next paragraph), we
turn in Section 2 to a short discussion of the computation-
ally simplest PFs, the Cauchy-Cantor polynomials, whose
charming mathematical structure—see (2.1)—begs one to
ask if other such polynomials exist. (This question remains
unresolved!) In the remainder of the paper, we focus on
PFs in more “modern” computational situations, discussing
just two situations that I have studied personally: the use of
PFs as storage mappings for rectangular arrays/tables that
can expand and shrink dynamically (Section 3); the use of
pairing functions as the basis for a mechanism for instill-
ing accountability into Web-computing projects (Section 4).
During our short tour, we shall encounter several intriguing
and challenging problems that remain open, despite the ap-
parent simplicity of PFs.
The “classical” importance of PFs. As is well known,
PFs played a pivotal role in Cantor’s seminal study [1] of
infinities, supplying a rigorous formal basis for asserting the
counterintuitive “equinumerousness” of the integers and the
rationals. It took revolutionary thinkers such as odel and
Turing to recognize that the correspondences embodied by
PFs can be viewed as encodings, or translations, of ordered
pairs (and, thence, of arbitrary finite tuples or strings) as
integers. This insight allowed G¨odel and Turing to build
on the existence of eminently computable—indeed, eas-
ily computed—PFs in their famous studies of, respectively,
logical systems [5] and algorithmic systems [15]. The uses
we propose for PFs, while certainly less profound than these
two, also build on the insight that PFs can be used as encod-
ing mechanisms.
Throughout the paper, we illustrate selected values from
selected PFs using the following convention. We illustrate
a PF

N
N
Nvia a two-dimensional array whose
entries are the values of
described in Fig. 1.
     
     
         
!" !" !" !"   
     
.
.
..
.
..
.
..
.
..
.
....
Figure 1. Our generic sampling from a PF.
0-7695-1573-8/02/$17.00 (C) 2002 IEEE
2. The Prettiest Pairing Function(s)
It has been known for almost two centuries that there
exist bijections between N
Nand N. Indeed, it has been
known for at least 125 years that there exist such bijections
that are polynomials. Cauchy [2] pictorially describes, and
Cantor [1] symbolically specifies, the Diagonal PF
#$%&('*)
$,+-&/.0
1
+2&
(2.1)
(which, of course, has a twin obtained by exchanging
$
and
&
); see Fig. 2. A simple double induction based on the fact
that
#
maps integers in an “upward direction” along the “di-
agonal shells,
$3+4&4'56$3+4&4'7 8$3+9&,': <;=;;
proves
that the function specified in (2.1) does, indeed, describe a
bijection. A computationally more satisfying proof in [3]
finds an explicit recipe for computing
#
’s inverse.
1 3 6 10 15 21 28 36
=
2 5 9 14 20 27 35 44
=
4 8 13 19 26 34 43 53
=
7 12 18 25 33 42 52 63

11 17 24 32 41 51 62 74
=
16 23 31 40 50 61 73 86
=
22 30 39 49 60 72 85 99
=
29 38 48 59 71 84 98 113
=
.
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
....
Figure 2. The diagonal PF
#
. The shell
$>+?&,'
@
is highlighted.
Is
#
the only polynomial PF? It is so intriguing that
there exists a PF that is a polynomial that the question of
#
’s uniqueness (as a polynomial PF) is irresistible! This
question remains largely open, but there are a few nontriv-
ial beginnings to an answer.
1. There is no quadratic polynomial PF other than
#
(and
its twin) [4].
2. The preceding assertion remains true if the “onto” con-
dition for bijections is replaced by a “unit density” con-
dition [7].
3. No cubic or quartic polynomial is a PF [8].
4. The development in [8] excludes large classes of
higher-degree polynomials from being PFs—e.g., a
super-quadratic polynomial whose coefficients are all
positive cannot be a PF—yet fails to settle the problem.
3. Pairing Functions and Array/Table Storage
This section is derived from [11, 12].
It has been recognized since the 1950s that many com-
putational scenarios, ranging from scientific applications
to databases, benefit from the ability to reshape multidi-
mensional arrays and tables dynamically. While several
programming languages allow a user to specify at least
some types of reshapings—say, the addition and/or deletion
of rows and/or columns in two dimensions—the language
processors I am aware of implement the capability quite
naively, by completely remapping an array/table with each
reshaping. In the mid-1970s, I began to study the use of PFs
as storage-mapping functions for two-dimensional rectan-
gular arrays/tables, since the mappings so specified would
allow one to add and delete rows and columns dynamically,
without ever remapping array/table positions that are un-
affected by the reshaping. (Extending this work to higher
dimensionalities is immediate.)
3.1. A Methodology for Constructing PFs
Rather than trying to select a single one-form-fits-all
storage mapping for dynamically extendible arrays, I de-
cided, in [11], to explore the space of possible PFs, with an
eye to seeking ones that optimized various criteria. I used
the following procedure to systematize the process of con-
structing PFs.
Procedure PF-Constructor(
A
)
/*Construct a PF
A
*/
Step 1. Partition the set N
Nof potential array/table posi-
tions into finite sets called shells. Order the shells lin-
early in some way: many natural shell-partitions carry
a natural order.
/*Here are a few sample shell-partitions that played a role
in our study of extendible arrays. For each relevant integer
B
, shell
B
comprises all pairs
C
$%&D
such that: (
E
)
$F+G&4'
B
(the diagonal shells that define the PF
#
of (2.1) and Fig. 2);
(
H
)
I4JLK
$%&M'
B
(square shells; cf. (3.3) and Fig. 3); (
B
)
$ &4'
B
(hyperbolic shells; cf. (3.4) and Fig. 4).*/
Step 2. Construct a PF from the shells as follows.
Step 2a. Enumerate the array positions shell by shell,
honoring the ordering of the shells.
Step 2b. Enumerate each shell in some systematic
way, say “by columns”. This means enumerating
the pairs
C
$%&D
in the shell in increasing order of
&
and, for pairs having equal
&
values, in, say, de-
creasing order of
$
. (Increasing order of
$
works
as well, of course.)
2
0-7695-1573-8/02/$17.00 (C) 2002 IEEE
/*We have thus extended the partial order imposed by the
shell structure to a linear order—which means that we have
a PF
A
.*/
Of course, Procedure PF-Constructor begs the question
of how to compute the PF
A
efficiently. This issue will be a
major concern for the remainder of this paper.
3.2. Pursuing Compact PFs
When one considers using a PF such as
#
for mapping
arrays/tables into storage, one notes immediately the poor
resulting management of storage. For instance, one sees
in Fig. 2 that
#
spreads the 64-position
N
N
array/table
over 113 addresses, and, even worse (percentage-wise), it
spreads the 8-position
N
array/table over 36 addresses. I
would argue that this loss of “compactness” is a more seri-
ous deficiency than is the loss of the bidirectional arithmetic
progressions enjoyed by the ubiquitous row- or column-
major indexings, since the waste of storage plagues one no
matter how one intends to access the array/table. Therefore,
in [11, 12], I actively sought PFs
A
that were compact, as
measured by small growth rates of their compactness func-
tion
OFP
!Q%
def
'
I4JLK8RA
!$%&3S=$ &T0QVU;
(3.1)
Here is what I discovered.
3.2.1 Favoring One Fixed Aspect Ratio. Say that one
moderates one’s demands on the PF
A
by focusing only on
its compactness when storing arrays/tables of a fixed aspect
ratio
CE
H
D
, i.e., arrays/tables whose dimensions have the
form
EW
HXW
for some
W
. Then one can manage storage
perfectly, in the sense that there exists a PF
AYZ [
such that
OPV\^] _
!Q%
def
'
I4JLK6RA`YaZ [
$%&bSc $dT
EWegf
c &?T
HXWe
f
c
EHXWh
TiQ
e
U
' Q<;
(3.2)
In other words,
AYZ [
maps every position
$%&
of an
EW
HXW
array/table having
Q
or fewer positions to an address
T
Q
. It is easy to construct
AYaZ [
via the shells specified as
follows.
1. Shell
comprises the positions of the
E
H
array, i.e.,
the set
RC
$%&D>Sc $jT
Eegf
c &?T
H^e
U;
2. Shell
W
+7
comprises the positions of the
E
W
+5a
H
W
+k
array that are not elements of the
EW
HXW
array, i.e., the set
RC
$%&D<Sac
EW?l
$dT
E
W
+d
enm
c
HXWl
&T
H
W
+
e
U;
While the preceding guarantee of compactness ignores
the issue of ease of computation, there are at least some
PFs that utilize storage perfectly in the sense of (3.2) and
are quite easy to compute. One useful such PF favors
square arrays/tables, i.e., those whose aspect ratio is given
by
E
'
H
'o
. This “square-shell” PF,
A?p Zp
, which seems to
have originated in [11], is specified by the following explicit
expression.
ApZp
!$q&r' s
h
+2st+2&F.G$/+:
(3.3)
where
s
def
'
I4JuK
$9.i&/.0av;
Once having noted that
Ap Zp
maps integers in a counter-
clockwise direction along the “square shells”
sw'yxzs{'
=;|;};
(see Fig. 3) one verifies its bijectiveness via a simple
double induction. (Of course,
ApZp
has a twin that proceeds
in a clockwise direction along the square shells.)
1 4 9 16 25 36 49 64
=
2 3 8 15 24 35 48 63
=
5 6 7 14 23 34 47 62
=
10 11 12 13 22 33 46 61
=
17 18 19 20 21 32 45 60
=
26 27 28 29 30 31 44 59
=
37 38 39 40 41 42 43 58
=
50 51 52 53 54 55 56 57
=
.
.
..
.
..
.
..
.
..
.
..
.
..
.
..
.
....
Figure 3. The square-shell PF
A~p Zp
. The shell
I,JuK
!$%&'7
is highlighted.
3.2.2 Favoring Finite Sets of Aspect Ratios. We show in
[12] how to “dovetail” any set
RA p
A
h
;=;;X
A`
U
of
s
PFs
to arrive at a PF
A
whose compactness is at worst
s
times
that of the most compact
A4
; i.e., for all
Q
,
OP
Q%GTs
I,|
OPz
!Q%X;
The dovetailing is performed in two steps.
1. Alter each
A~
to be a bijection
A?
b
between N
N
and the congruence class
W
.
I,
s
, i.e., the set of
integers of the form
s$4+
W
.:
. Specifically, define
the PF
A
b
via:
A
>
$%&d's
A
!$%&+
W
.j
.
2. Define the PF
A
via:
A
!$%&'
I~}RA4
b
!$%&^U
.
Thus, if one wants a PF to be compact on arrays of aspect
ratios
CEp
H=p
Dv
CE
h
H
h
Dv=;;=;
CE
H
D
, then one can craft
a PF
AY=Z [ YvXZ [v YX>Z [
that maps every position
$%&
of
an array/table which has one of these
s
aspect ratios, and
which has
Q
or fewer positions, to an address
TsQ
.
3
0-7695-1573-8/02/$17.00 (C) 2002 IEEE
3.2.3 Maximizing Worst-Case Compactness. The pre-
ceding shape-based guarantees do not help much with ap-
plications such as relational databases, wherein one cannot
limit a priori the potential shapes of one’s tables. This fact
led me to the question of how compact a PF could be on
arrays/tables of arbitrary shapes. We show in [12] that there
exists a PF
whose compactness is given by
OF
!Q%',Q

Q%v
and no PF can beat this compactness (in the worst case) by
more than a constant factor. The PF
maps integers along
the “hyperbolic shells” defined by
$"&'¡V$ &d'oV$"&'
;=;;
. More specifically, if we let
¢
!Q%
denote the number
of divisors of the integer
Q
, then
$%&£' ¤¥a¦
p
§
v¨qp
¢
W
(3.4)
+
the position of
C
$q&D
among
2-part factorizations of
$ &
, in
reverse lexicographic order
See Fig. 4.
13 5 8 10 14 16
=
2 7 13 19 26 34 40

4 12 22 33 44 56 69
=
6 18 32 48 64 81 99
=
9 25 43 63 86 108 130
=
11 31 55 80 107 136 165

15 39 68 98 129 164 200

17 47 79 116 154 193 235
=
.
.
..
.
..
.
..
.
..
.
..
.
..
.
....
Figure 4. The hyperbolic PF
. The shell
$ &4'
@
is highlighted.
4. Pairing Functions and Web-Computing
This section is derived from [13].
Evolving technology has given rise to a new modality of
cooperative computing, which we call Web-Based Comput-
ing (WBC, for short). WBC proceeds roughly as follows.
“Volunteers” register with a WBC website. After having
registered, each volunteer visits the website from time to
time to receive a task to compute. Some time after complet-
ing a task, the volunteer returns the results from that task
and receives a new task. And the cycle continues.
As typically implemented, WBC is vulnerable to mali-
cious, or careless, volunteers returning false results. When
the WBC computations relate to sensitive matters such as
security [14] or medical testing [6, 10], such false results
could have dire consequences. In [13], we have proposed
a computationally lightweight scheme for keeping track of
which volunteer computed which task(s), thereby enabling
the head of the WBC project to ban frequently errant volun-
teers from continued participation in the project. The pro-
posed scheme builds on the strategy of assigning positive-
integer indices to (
E
) the set of all tasks, (
H
) all volunteers,
(
B
) the set of tasks reserved for each volunteer
©
, and using
a PF
ª
(which we call a task-allocation function) to link
volunteers with their assigned tasks. In other words, the
«
th
task that volunteer
©
receives to compute is task
ª
©
«
.
Since the practicality of such a scheme demands that
ª
,
ª
¦
p
, and
¬
©
«
def
'
ª
©
«
+¡.
ª
©
«
all be easily
computed, the primary focus in [13] is on PFs that are ad-
ditive (APFs, for short): an APF assigns each volunteer
©
a
base task-index
`®
and a stride
¯%®
; it then uses the formula
ª
©
«
>'
°®
+y
«
.i
¯n®
to determine the workload task-
index of the
«
th task assigned to volunteer
©
. From a system
perspective, APFs have the benefit that a volunteer’s stride
need be computed only when s/he registers at the website
and can be stored for subsequent appearances.
The complete scheme described in [13] has a “front end”
which ensures that, even when volunteers may arrive and
depart dynamically, faster volunteers are always assigned
smaller indices. Given our focus on APFs, and given this
mode of assigning indices to volunteers, one can argue that
the management of the memory where tasks reside is sim-
plified if we devise APFs whose strides
¯®
grow slowly as a
function of
©
, hence, that are compact in the sense of (3.1).
This observation sets the agenda for [13] and for the remain-
der of this section. In Section 4.1, we present a methodol-
ogy for designing easily computed APFs; in Section 4.2,
we present a sequence of APFs that represent a tradeoff be-
tween ease of computation and slowness of stride growth.
We henceforth abstract the preceding discussion from
the WBC scenario by replacing “volunteer” by “row” and
“base task-index” by “base row-entry.” We also revert to
our generic uses of
$
and
&
, instead of
©
and
«
.
4.1. A Methodology for Designing Additive PFs
Easily, any APF must have infinitely many distinct
strides; i.e.,
¯
¤
, viewed as a function of
$
, must have in-
finite range. Despite this, we now show that there do ex-
ist easily computed APFs. Our strategy for designing such
APFs builds on the following well-known property of the
set Oof positive odd integers.
Lemma 4.1 ([9]) For any positive integer
B
, every odd in-
teger can be written in precisely one of the
 ±
¦
p
forms:
±
Q9+:z
±
Q9+2 z
±
Q?+0;=;;XV
±
Q9+7
±
.iX
4
0-7695-1573-8/02/$17.00 (C) 2002 IEEE
for some nonnegative integer
Q
.
We build on Lemma 4.1 to construct APFs as follows.
Procedure APF-Constructor(
ª
)
/*Construct an APF
ª
*/
Step 1. Partition the set of row-indices into groups whose
sizes are powers of 2 (with any desired mix of equal-
size and distinct-size groups). Order the groups lin-
early in some (arbitrary) way.
/*We can now talk unambiguously about group 0 (whose
members share group-index
²
'³x
), group 1 (whose mem-
bers share group-index
²
'´
), and so on.*/
Step 2. Assign each group a distinct copy of the set O,
via a copy-index
µ
²
expressed as a function of the
group-index
²
.
/*We can now talk unambiguously about group
²
’s copy
¶¸·
º¹
of the odd integers.*/
Step 3. Allocate group
²
’s copy
¶`·
º¹
to its members via
the
B
'
µ
²

instance of Lemma 4.1, using the mul-
tiplier
¹
as a signature to distinguish group
²
’s copy
of the set Ofrom all other groups’ copies.
An explicit expression for
ª
.If we denote the
·
º¹
rows of group
²
as
$
¹
Zp
$
¹
Z
h
;=;;X$
¹
Z
h^»^¼º½¾
, then for all
¿ÁÀ
R
^=;;;v
µ
²
vU
,
ª
!$
¹
Z
&
def
'
¹/Â
pÃ
·
º¹
&/.in+5u$
¹
Z
+7
I~
pÃ
·
º¹
ÅÄ
(4.1)
Theorem 4.1 Any function
ª
N
N
Nthat is designed
via Procedure APF-Constructor, hence is of the form (4.1),
is a valid APF whose base row-entries and strides satisfy
¤
T
pÃ
¹
Ã
·
º¹
¯
¤
'
ª
$%&M+7V.
ª
$%&'Æ
pÃ
¹
Ã
·
º¹
;
(4.2)
Proof sketch. (1) Any such
ª
maps N
Nonto N, be-
cause every positive integer equals some power of 2 times
some odd integer.
ª
is one-to-one because it has a func-
tional inverse
ª
¦
p
. To wit, the trailing 0’s of each image
integer
W
'
ª
!$q&
identify
$
’s group
²
, hence the opera-
tive instance
µ
²
of Lemma 4.1. Then:
1. We compute
$Ç'
Â

¦
¹
WFI,
pÃ
·
|¹
z.iXÄb
which is an integer because the division by
¹
produces
an odd number.
2. We end up with a linear expression of the form
E
&È+
H
,
from which we easily compute
&
.
Finally, we read the relations (4.2) directly from (4.1).
In order to implement Procedure APF-Constructor
completely, one must express both the group-indices
²
and
their associated copy-indices
µ
²
as functions of
$
. This is
accomplished by noting that all
$
whose indices lie in the
range
·
ºÉ
+
·
p
+:=L+
·
|¹
¦
p
+7:TÊ$
TË
·
ºÉ
+0
·
p
+:=+0
·
º¹
¦
p
+
·
|¹
(4.3)
share group-index
²
and copy-index
µ
²
. Translating the
range (4.3) into an efficiently computed expression of the
form
²
'yÌV!$8
may be a simple or a challenging enterprise,
depending on the functional form of
µ
²
that results from
the grouping of row-indices.
4.2. A Sampler of Explicit APFs
Theorem 4.1 assures us that Procedure APF-
Constructor produces a valid APF no matter how the
copy-index
µ
²
grows as a function of the group-index
²
. However, the ease of computing the resulting APF, and
its compactness, depend crucially on this growth rate. We
now illustrate how one can use this growth rate as part
of the design process, in order to stress either the ease of
computing an APF or its compactness.
4.2.1 APFs that Stress Computation Ease. We first
implement Procedure APF-Constructor with equal-size
groups, i.e., with
µ
²
i'
BXÍ
Q%Î
«E
Q
«
. For each
B
À
N,
let
ª4Ï
±Ð
be the APF produced by the Procedure with
µ
Ï
±Ð
²
ÁÑ
B
.i
. One computes easily that
ª,Ï
±Ð
!$%&
def
'
Ò
¤u¦
pÓ
h^ÔÅÕ
Ö
c
±
&F.in+5L$?.0
I,
±
e
;
Proposition 4.1 Each
ªÏ
±Ð
is a valid APF whose base
row-entries and strides are given by
Ï
±Ð
¤
T
¯Ï
±Ð
¤
'
Ò
¤u¦
pÓ
h^ÔÅÕ
Ö
Ã
±
;
(4.4)
Each
ª
Ï
±Ð
is easy to compute but has base row-entries
and strides that grow exponentially with row-indices. In-
creased values of
B
(= larger fixed group sizes) decrease
the base of the growth exponential, at the expense of mod-
est increase in computational complexity. Computing a few
sample values illustrates how a larger value of
B
penalizes a
few low-index rows but gives all others significantly smaller
base row-entries and strides; cf. Fig. 5.
5
0-7695-1573-8/02/$17.00 (C) 2002 IEEE
×ÙØ"ÚÛÜ ÝMÞ8ßàqáÙØ8Úâã
×Åä^åÚvä^æaÜ
8192 24576 40960 57344 73728
ç^ç^ç
×ÅäXèuÚväåLÜ
16384 49152 81920 114688 147456
ç^ç^ç
×ÙØ"ÚÛÜ Ý Þéà áÙØ8Úâã
×Åä^åÚæaÜ
24 88 152 216 280
ç^ç^ç
×ÅäXèuÚæaÜ
40 104 168 232 296
çç^ç
ççvç ç^ç^ç ç^ç^ç ç^ç^ç ç^çç çç^ç
×ê=ëÚìaÜ
448 960 1472 1984 2496
ç^ç^ç
×ê=íÚîÜ
128 1152 2176 3200 4224
ç^çç
×ÙØ"ÚÛÜ Ýðï3áÙØ"ÚÅâã
×ê=ëÚÅåLÜ
400 912 1424 1936 2448
ç^ç^ç
×ê=íÚÅåLÜ
432 944 1456 1968 2480
ç^ç^ç
×ÙØ"ÚÛÜ ÝðñLáÙØ8ÚÅâã
×ê=ëÚæaÜ
328 840 1352 1864 2376
ç^ç^ç
×ê=íÚæaÜ
344 856 1368 1880 2392
ç^ç^ç
.
.
..
.
..
.
..
.
..
.
....
Figure 5. Sample values by several APFs.
4.2.2 APFs that Balance Computation Ease and Com-
pactness. The functional form of the exponent of
in
(4.4) suggests that one can craft an APF whose base row-
entries and strides grow subexponentially by allowing the
parameter
B
to grow with
$
, in a way that balances the (com-
mon) growth rate of
¤
and
¯
¤
. This strategy leads us to
the copy-index
µqò
²
,'
²
. When we implements Proce-
dure APF-Constructor with
µnò
, we arrive at an APF
ª
ò
that is rather easy to compute and whose base row-entries
and strides grow only quadratically with row-indices.
The copy-index
µqò
²
È'
²
aggregates row-indices into
groups of exponentially growing sizes: each group
²
com-
prises row-indices
¹
^
¹
+0;=;;X^
¹
Ãqp
.-
. By (4.3), then,
one computes easily that1
µ
ò
²
'
²
'ôóÙ

$õ;
(4.5)
Instantiating (4.5) in the definitional scheme (4.1), we find
that
ª
ò
!$%&'
Òö ÷ø
¤
Ö¸ù
pÃ
Òö ÷ø
¤
Ö
&/.in+5u$~+7
I,
pÃ
Òö ÷ø
¤
Ö
ú
(4.6)
Proposition 4.2 The function
ª
ò
specified in (4.6) is a
valid APF whose base row-entries and strides (as functions
of
$
) are given by
ò
¤
lû¬
ò
¤
'Æ
pÃ
h
Òö ÷ø
¤
Ö
TL$
h
hence, grow quadratically with
$
.
1Throughout, all logarithms have base 2.
Comparing
ª
ò
and the
ªÏ
±Ð
.For sufficiently large
$
, the (exponentially growing) strides of any of the APFs
ª,Ï
±Ð
will be dramatically larger than the (quadratically
growing) strides of the APF
ª
ò
. However, it takes a while
for
ª
ò
’s superiority to manifest itself; for instance,
ü
it is not until
$('³
that
ªÏ
p
Ð
’s strides are always at
least as large as
ª
ò
’s;
ü
the corresponding number for
ªÏ
h
Ð
is
$'ý
;
ü
the corresponding number for
ªÏ6þ
Ð
is
$'5
.
4.2.3 APFs that Stress Compactness. By choosing a
copy-index
µ
²
that grows superlinearly with
²
, one can
craft APFs whose base row-entries and strides grow sub-
quadratically, thereby beating the compactness of
ª
ò
. But
one must choose
µ
²
’s growth rate judiciously, since faster
growth need not yield more compactness.
Achieving subquadratic growth. Many copy-index
growth rates yield APFs with subquadratic compactness.
However, all of the APFs we know of that achievethis goal
are rather difficult to compute and actually achieve the goal
only asymptotically, hence are likely more of academic than
practical interest.
Consider, for each
W
À
N, the APF
ªdÿ

specified by
the copy-index
µ
ÿ

²
~'
²
. By (4.3), the row-indices
$
belonging to group
²
now lie in the range
%+j<+j

+-+
º¹
¦
p

l
$¡T n+<+j

n+G=+
¹
so that
²
' ?+
Í


!

$6
pÓ

. We actually use
the simplified, albeit slightly inaccurate, expression
²
'


$8
pÓ
in our asymptotic analyses of the
ªdÿ

, since
the
Í
a
-quantity decreases very rapidly with growing
$
.
Although closed-form expressions for
ªÿ

in terms of
$
have eluded us, we can verify that each
ªÿ

does indeed
enjoy subquadratic stride growth.
Proposition 4.3 Each function
ªÿ

produced by Proce-
dure APF-Constructor from the copy-index
µ
ÿ

²
/'
²
is a valid APF whose base row-entries and strides (as func-
tions of
$
) are given by
ÿ

¤
T
¬ÿ

¤
'

ö ÷ø
¤

ö ÷ø
¤
' $8

ö ÷ø
¤

(4.7)
hence, grow subquadratically with
$
.
We illustrate a close relative of
ªÿ
h
which exhibits
its subquadratic compactness at much smaller values of
$
than
ª4ÿ
h
does, namely, the APF
ª

that Procedure APF-
Constructor produces from the copy-index
µ
²
Á'

²h

;
(4.8)
6
0-7695-1573-8/02/$17.00 (C) 2002 IEEE
Mimicking the development with
µ
ÿ

, we see that now
²
'
È+
Í
a

V

$
+
, which we simplify for analysis
to the slightly inaccurate expression
²
'

V

$

M+7;
(4.9)
We can easily compute
ª

from (4.8), in the presence of
(4.1, 4.3).
Proposition 4.4 The base row-entries and strides of the
APF
ª
satisfy
¤
T
¬

¤
'
pÃ
¹
Ã
·

º¹

N
$ 
h
ö ÷ø
¤
;
Comparing
ª
and
ª
ò
.Any function that grows
quadratically with
$
will eventually produce significantly
larger values than a function that grows only as
$ 
h
ö ÷ø
¤
.
Therefore,
ª
’s strides will eventually be dramatically
smaller than
ª
ò
’s. Fig. 5 indicates that this difference
takes effect at about the same point as the exponential
vs. quadratic one noted earlier, albeit at the cost of greater
computational complexity.
The danger of excessively fast growing
µ
.If
µ
²
grows
too fast with
²
, then the base row-entries and strides of
the resulting APF grow superquadratically with the row-
indices
$
, thereby confuting our goal of beating quadratic
growth. We exemplify this fact by supplying Procedure
APF-Constructor with the copy-index
µ
²
5'ô
¹
; the
reader can readily supply other examples. By (4.3), we see
that in this case,
²
' óÙ


$õb+0,a
. Therefore, when-
ever
$
is the smallest row-index with a given group-index
²
(of course, infinitely many such
$
exist) we have
$t'Æ
·
ºÉ
+0
·
p
+7=+0
·
º¹
¦
p
+7
·
º¹
while the stride associated with
$
is (cf. (4.2))
¯
¤
'
pÃ
¹
Ã
·
º¹
"!
·
º¹
µ
²
$
h

$%;
We do not yet know the growth rate at which faster growing
µ
²
starts hurting compactness.
Acknowledgments. The research described in Sections 2
and 3 was done while the author was with the IBM Watson
Research Center. The research described in Section 4, and
the preparation of this paper were supported in part by NSF
Grant CCR-00-73401.
References
[1] G. Cantor (1878): Ein Beitrag zur Begrundung der
transfiniter Mengenlehre. J. Reine Angew. Math. 84,
242–258.
[2] A.L. Cauchy (1821): Cours d’analyse de l ´
Ecole
Royale Polytechnique, 1 `
ere partie: Analyse
alg´
ebrique. l’Imprimerie Royale, Paris. Reprinted:
Wissenschaftliche Buchgesellschaft, Darmstadt,
1968.
[3] M. Davis (1958): Computability and Unsolvability.
McGraw-Hill, N.Y.
[4] R. Fueter and G. P´olya (1923): Rationale
Abz¨ahlung der Gitterpunkte. Vierteljschr. Natur-
forsch. Ges. Z¨
urich 58, 380–386.
[5] K. G¨odel (1931): ¨
Uber formal unentscheidbare atze
der Principia Mathematica und verwandter Systeme, I.
Monatshefte f¨
ur Mathematik und Physik 38, 173–198.
[6] The Intel Philanthropic Peer-to-Peer program.
C
www.intel.com/cure
D
.
[7] J.S. Lew and A.L. Rosenberg (1978): Polynomial in-
dexing of integer lattices, I. J. Number Th. 10, 192–
214.
[8] J.S. Lew and A.L. Rosenberg (1978): Polynomial in-
dexing of integer lattices, II. J. Number Th. 10, 215
243.
[9] I. Niven and H.S. Zuckerman (1980): An Introduction
to the Theory of Numbers. (4th Ed.) J. Wiley & Sons,
New York.
[10] The Olson Laboratory Fight AIDS@Home project.
C
www.fightaidsathome.org
D
.
[11] A.L. Rosenberg (1974): Allocating storage for ex-
tendible arrays. J. ACM 21, 652–670.
[12] A.L. Rosenberg (1975): Managing storage for ex-
tendible arrays. SIAM J. Comput. 4, 287–306.
[13] A.L. Rosenberg (2002): Accountable Web-
computing. Submitetd for publication. See an
extended abstract in IEEE Intl. Parallel and Dis-
tributed Processing Symp. (IPDPS’02).
[14] The RSA Factoring by Web Project.
C
http://www.npac.syr.edu/factoring
D
(with Foreword by A. Lenstra). Northeast Parallel
Architecture Center.
[15] A.M. Turing (1936): On computable numbers, with an
application to the Entscheidungsproblem. Proc. Lon-
don Math. Soc. (ser. 2, vol. 42) 230–265; Correction
ibid. (vol. 43) 544–546.
7
0-7695-1573-8/02/$17.00 (C) 2002 IEEE
... Arnold L. Rosenberg [3], provided a short tour about the pairing functions for computation situations and then they discussed about computationally simplest pairing functions-Caunchy-Cantor "diagonal" polynomial. They described the usage of pairing functions based on two specific computational situations in the paper viz., (i) in storage mappings for rectangular arrays/tables, pairing functions could be used for expand and shrink them dynamically and (ii) pairing function was used for instilling accountability mechanism into web-computing projects. ...
... They are viz., (i) given any pairing function for the positive integers, then the function is also a Cantor's pairing function for the non-negative integers. It is defined as (3) (ii) Given any pairing function for a set , the Cantor's pairing function is also obtained by exchanging and in . Hence, (4) The inverse function of the Cantor's pairing function is defined as (5) where ...
Article
The potential disadvantage of ElGamal cryptosystem is the ciphertext produced is always twice as long as the plaintext i.e., the message expansion by a factor of two takes place during encryption. When the message is too long the ciphertext produced by the ElGamal cryptosystem is also too long. i.e., when the ciphertexts are transmitted through the communication channel which lead to provide less security because if anyone of the ciphertext from two ciphertexts for each character of the plaintext is intercepted by the adversary, the other may be retrieved easily because there is a relationship between the two ciphertexts. If two ciphertexts are reduced to one, the adversary may not be able to predict the two ciphertexts from one. To enhance the security of ElGamal cryptosystem, the binary Cantor function , Rosenberg pairing function and Elegant pairing functions are used in this paper. When the said functions are used, the two ciphertexts produced by each plaintext character are reduced to one, so that the adversary cannot easily be recovered the plaintext. Experimental results clearly revealed enhancing the security of ElGamal cryptosystem after incorporating the pairing functions into it.
... To create these new gids, we propose the application of pairing functions. By definition, a pairing function is a bijection f : [23]. Pairing bijection functions have the property to map two natural numbers onto a single one. ...
... Pairing bijection functions may be constructed to fulfill specific requirements. In Rosenberg [23] and Tarau [26] the authors discuss different methods for creating these functions. However, consider the classical Cantor pairing function, defined by: f (i, j) = (i + j)(i + j + 1)/2 + i, which assigns consecutive numbers to points along diagonals in the plane, as shown in Fig. 3(a), this function can be applied for building new global ids during the refinement process. ...
Article
Often unstructured grid methods, such as finite elements, are used in high fidelity simulations. In these methods, solution accuracy is associated to the interpolation order and to the grid size. Unstructured parallel mesh refinement is computationally expensive due to sub-domains interface communication. In the present work we develop a uniform edge-based parallel tetrahedral mesh refinement scheme completely free of communication, fast, simple to implement and highly scalable. This is achieved by an index generation for subdomain interface grid points based on special pairing functions.
... Given an identifier structure IS, an identifier pattern ip is a tuple (c, s) of integers called current and step such that s > 0. The stream of atomic identifiers generated by an identifier pattern (c, s) is IS(c, s) = γ(c), γ(c + s), γ(c + s + s), γ(c + s + s + s), . . .. [34,37]. Let p be any of those pairing function, and let p − (m, n) = −(p(m, n)). ...
Chapter
Full-text available
Existing formalisms for the algebraic specification and representation of networks of reversible agents suffer some shortcomings. Despite multiple attempts, reversible declensions of the Calculus of Communicating Systems (CCS) do not offer satisfactory adaptation of notions usual in “forward-only” process algebras, such as replication or context. Existing formalisms disallow the “hot-plugging” of processes during their execution in contexts with their own past. They also assume the existence of “eternally fresh” keys or identifiers that, if implemented poorly, could result in unnecessary bottlenecks and look-ups involving all the threads. In this paper, we begin investigating those issues, by first designing a process algebra endowed with a mechanism to generate identifiers without the need to consult with the other threads. We use this calculus to recast the possible representations of non-determinism in CCS, and as a by-product establish a simple and straightforward definition of concurrency. Our reversible calculus is then proven to satisfy expected properties. We also observe that none of the reversible bisimulations defined thus far are congruences under our notion of “reversible” contexts.
... Given an identifier structure IS, an identifier pattern ip is a tuple (c, s) of integers called current and step such that s > 0. The stream of atomic identifiers generated by an identifier pattern (c, s) is IS(c, s) = γ(c), γ(c + s), γ(c + s + s), γ(c + s + s + s), . . .. [34,37]. Let p be any of those pairing function, and let p − (m, n) = −(p(m, n)). ...
Preprint
Existing formalisms for the algebraic specification and representation of networks of reversible agents suffer some shortcomings. Despite multiple attempts, reversible declensions of the Calculus of Communicating Systems (CCS) do not offer satisfactory adaptation of notions that are usual in ''forward-only'' process algebras, such as replication or context. They also seem to fail to leverage possible new features stemming from reversibility, such as the capacity of distinguishing between multiple replications, based on how they replicate the memory mechanism allowing to reverse the computation. Existing formalisms disallow the ''hot-plugging'' of processes during their execution in contexts that also have a past. Finally, they assume the existence of ''eternally fresh'' keys or identifiers that, if implemented poorly, could result in unnecessary bottlenecks and look-ups involving all the threads. In this paper, we begin investigating those issues, by first designing a process algebra endowed with a mechanism to generate identifiers without the need to consult with the other threads. We use this calculus to recast the possible representations of non-determinism in CCS, and as a by-product establish a simple and straightforward definition of concurrency. Our reversible calculus is then proven to satisfy expected properties, and allows to lay out precisely different representations of the replication of a process with a memory. We also observe that none of the reversible bisimulations defined thus far are congruences under our notion of ''reversible'' contexts.
... their components and second by their components in increasing order (cf. [3,19]): ...
Preprint
Full-text available
Metric learning has received conflicting assessments concerning its suitability for solving instance segmentation tasks. It has been dismissed as theoretically flawed due to the shift equivariance of the employed CNNs and their respective inability to distinguish same-looking objects. Yet it has been shown to yield state of the art results for a variety of tasks, and practical issues have mainly been reported in the context of tile-and-stitch approaches, where discontinuities at tile boundaries have been observed. To date, neither of the reported issues have undergone thorough formal analysis. In our work, we contribute a comprehensive formal analysis of the shift equivariance properties of encoder-decoder-style CNNs, which yields a clear picture of what can and cannot be achieved with metric learning in the face of same-looking objects. In particular, we prove that a standard encoder-decoder network that takes $d$-dimensional images as input, with $l$ pooling layers and pooling factor $f$, has the capacity to distinguish at most $f^{dl}$ same-looking objects, and we show that this upper limit can be reached. Furthermore, we show that to avoid discontinuities in a tile-and-stitch approach, assuming standard batch size 1, it is necessary to employ valid convolutions in combination with a training output window size strictly greater than $f^l$, while at test-time it is necessary to crop tiles to size $n\cdot f^l$ before stitching, with $n\geq 1$. We complement these theoretical findings by discussing a number of insightful special cases for which we show empirical results on synthetic data.
... A typical use in the foundations of mathematics is [32]. An extensive study of various pairing functions and their computational properties is presented in [33]. ...
Article
This paper is an exploration of isomorphisms between elementary data types (e.g., natural numbers, sets, finite functions, graphs, hypergraphs) and their extension to hereditarily finite universes through hylomor-phisms derived from ranking/unranking and pairing/unpairing opera-tions. An embedded higher order combinator language provides any-to-any encodings automatically. A few examples of free algorithms obtained by transferring operations between data types are shown. Other applications range from stream iterators on combinatorial ob-jects to succinct data representations and the generation of random instances.
Conference Paper
ICN communication is inherently multipath and potentially multi-destination. Content Centric and Named Data Networks at present do not offer a mechanism to direct traffic onto a specific path in multipath or a specific destination in a multi-destination environment, because the forwarding plane multiplexes packets across nexthops dynamically. This makes it challenging to provide practical multipath traceroute and ping applications, or implement multipath-aware congestion control, traffic engineering or SDN solutions. The symmetry of forward and reverse paths in Content Centric and Named Data Networks allows one to compute an end-to-end path label in a Data message on the reverse path and subsequently use this label to forward an Interest message through a specific nexthop. ICN Path Switching is a method of high-speed Interest forwarding in Content Centric and Named Data networks based on exact matching of a nexthop label retrieved from the Interest's path label against a nexthop ID in the ICN Forwarder's Adjacency database. ICN Path Switching maintains all major characteristics of CCN / NDN architectures, such as multicasting, caching, flow balance, etc. Simulations demonstrate that path labels are consistent with ICN control plane routing state in the presence of route updates. Analysis of ICN Path Switching with regards to Multiprotocol Label Switching (MPLS) and Segment Routing architectures suggests that it offers similar advantages at lower complexity with the potential to simplify network operations.
Article
We present an efficient, modular, and feature-rich framework for automated generation and validation of complex structures, suitable for tasks that explore a large space of structured values. Our framework is capable of exhaustive, incremental, parallel, and memoized enumeration from not only finite but also infinite domains, while providing fine-grained control over the process. Furthermore, the framework efficiently supports the inverse of enumeration (checking whether a structure can be generated and fast-forwarding to this structure to continue the enumeration) and lazy enumeration (achieving exhaustive testing without generating all structures). The foundation of efficient enumeration lies in both direct access to encoded structures, achieved with well-known and new pairing functions, and dependent enumeration, which embeds constraints into the enumeration to avoid backtracking. Our framework defines an algebra of enumerators, with combinators for their composition that preserve exhaustiveness and efficiency. We have implemented our framework as a domain-specific language in Scala. Our experiments demonstrate better performance and shorter specifications by up to a few orders of magnitude compared to existing approaches.
Article
We attack an interesting open problem (an efficient algorithm to invert the generalized Cantor n-tupling bijection) and solve it through a sequence of equivalence preserving transformations of logic programs, that take advantage of unique strengths of this programming paradigm. An extension to set and multiset tuple encodings, as well as a simple application to a “fair-search” mechanism illustrate practical uses of our algorithms. The code in the paper (a literate Prolog program, tested with SWI-Prolog and Lean Prolog) is available at http://logic.cse.unt.edu/tarau/research/2012/pcantor.pl.
Article
Wenn zwei wohldefinirte Mannigfaltigkeiten M und N sich eindeutig und vollständig, Element für Element, einander zuordnen lassen (was, wenn es auf eine Art möglich ist, immer auch noch auf viele andere Weisen geschehen kann), so möge für das Folgende die Ausdrucksweise gestattet sein, dass diese Mannigfaltigkeiten gleiche Mächtigkeit haben, oder auch, class sie äquivalent sind. Unter einem Bestandtheil einer Mannigfaltigkeit M verstehen wir jede andere Mannigfaltigkeit M’, deren Elemente zugleich Elemente von M sind. Sind die beiden Mannigfaltigkeiten M und N nicht von 12 gleicher Mächtigkeit, so wird entweder M mit einem Bestandtheile von N oder es wird N mit einem Bestandtheile von M gleiche Mächtigkeit haben; im ersteren Falle nennen wir die Mächtigkeit von M kleiner, im zweiten Falle nennen wir sie grösser als die Mächtigkeit von N.