Content uploaded by Arnold Rosenberg

Author content

All content in this area was uploaded by Arnold Rosenberg on Oct 20, 2014

Content may be subject to copyright.

Efﬁcient 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 speciﬁc 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

inﬁnities, supplying a rigorous formal basis for asserting the

counterintuitive “equinumerousness” of the integers and the

rationals. It took revolutionary thinkers such as G¨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 ﬁnite 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 speciﬁes, 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'56$3+4&4'7 8$3+9&,': <;=;;

proves

that the function speciﬁed in (2.1) does, indeed, describe a

bijection. A computationally more satisfying proof in [3]

ﬁnds 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 coefﬁcients 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 scientiﬁc applications

to databases, beneﬁt 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 speciﬁed 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-ﬁts-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 ﬁnite 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 deﬁne 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

efﬁciently. 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 deﬁciency 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

'

I4JLK8RA

!$%&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 ﬁxed aspect

ratio

CE

H

D

, i.e., arrays/tables whose dimensions have the

form

EW

HXW

for some

W

. Then one can manage storage

perfectly, in the sense that there exists a PF

AYZ [

such that

OPV\^] _

!Q%

def

'

I4JLK6RA`YaZ [

$%&bSc $dT

EWegf

c &?T

HXWe

f

c

EHXWh

TiQ

e

U

' Q<;

(3.2)

In other words,

AYZ [

maps every position

$%&

of an

EW

HXW

array/table having

Q

or fewer positions to an address

T

Q

. It is easy to construct

AYaZ [

via the shells speciﬁed as

follows.

1. Shell

comprises the positions of the

E

H

array, i.e.,

the set

RC

$%&D>Sc $jT

Eegf

c &?T

H^e

U;

2. Shell

W

+7

comprises the positions of the

E

W

+5a

H

W

+k

array that are not elements of the

EW

HXW

array, i.e., the set

RC

$%&D<Sac

EW?l

$dT

E

W

+d

enm

c

HXWl

&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 speciﬁed by the following explicit

expression.

ApZp

!$q&r' s

h

+2st+2&F.G$/+:

(3.3)

where

s

def

'

I4JuK

$9.i&/.0av;

Once having noted that

Ap Zp

maps integers in a counter-

clockwise direction along the “square shells”

sw'yxzs{'

=;|;};

(see Fig. 3) one veriﬁes 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

RA 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%GTs

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

.:

. Speciﬁcally, deﬁne

the PF

A

b

via:

A

>

$%&d's

A

!$%&+

W

.j

.

2. Deﬁne the PF

A

via:

A

!$%&'

I~}RA4

b

!$%&^U

.

Thus, if one wants a PF to be compact on arrays of aspect

ratios

CEp

H=p

Dv

CE

h

H

h

Dv=;;=;

CE

H

D

, then one can craft

a PF

AY=Z [ YvXZ [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

TsQ

.

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” deﬁned by

$"&'¡V$ &d'oV$"&'

;=;;

. More speciﬁcally, 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 beneﬁt 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-

pliﬁed 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 inﬁnitely many distinct

strides; i.e.,

¯

¤

, viewed as a function of

$

, must have in-

ﬁnite 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;=;;XV

±

Q9+7

±

.iX

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Ã

·

º¹

&/.in+5u$

¹

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+7V.

ª

$%&'Æ

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.iXÄ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 efﬁciently 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 ﬁrst

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.in+5L$?.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 ﬁxed 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 signiﬁcantly 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 deﬁnitional scheme (4.1), we ﬁnd

that

ª

ò

!$%&'

Òö ÷ø

¤

Ö¸ù

pÃ

Òö ÷ø

¤

Ö

&/.in+5u$~+7

I,

pÃ

Òö ÷ø

¤

Ö

ú

(4.6)

Proposition 4.2 The function

ª

ò

speciﬁed in (4.6) is a

valid APF whose base row-entries and strides (as functions

of

$

) are given by

ò

¤

lû¬

ò

¤

'Æ

pÃ

h

Òö ÷ø

¤

Ö

TL$

h

hence, grow quadratically with

$

.

1Throughout, all logarithms have base 2.

Comparing

ª

ò

and the

ªÏ

±Ð

.For sufﬁciently 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 difﬁcult 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ÿ

speciﬁed 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 simpliﬁed, 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 signiﬁcantly

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, inﬁnitely 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

transﬁniter 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 S¨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