PhysicsLettersAl63(1992)419—424 North-Holland
PHYSICS LETTERS A
Box-counting with base b~numerals Stuart Bingham Department ofMathematics, University ofTennessee, Knoxville, TN 37996-1300, USA Received 22 December 1989; accepted forpublication 17 October 1990 Communicated by D.D. Holm
The position of a point in the unit cube [0, 1)” is usually approximated as an n-tuple of p-digit base b numerals. When collated, the base b digits form a single base b” numeral that is well-suited (indeed, tailor-made) for box-counting: Its p digits specify a sequence of nested n-dimensional cubes. For an attractor whose points are represented as an ordered list of such numerals, boxcounting is a task of linear complexity. In fact, it suffices to perform a single comparison of each ofthe adjacent numerals in such a list to count, for all re { 1, 2 p}, the minimal number ofcubes of edge length b —rwhich cover the points on the attractor.
In the past decade, investigators in a variety of fields have become interested in characterizing the spatial structure of fractal [1] objects. The method of phase space reconstruction, introduced by Packard et al. [2] and Takens [3] and subsequently refined by Fraser and Swinney [4,5], gained acceptance as a useful tool with which experimentalists could detect and characterize scale-invariant structure in attractors of nonlinear dynamical systems. Early attempts to characterize the scale-invariant structure of an attractor often involved counting, for some judiciously chosen sequence of edge lengths, the mmimal number of n-dimensional boxes of uniform edge length which cover the attractor. In some instances, investigators were able to accurately (although somewhat incompletely) characterize the geometry of an attractor in terms ofa single fractal dimension. Interest in the estimation of fractal dimensions by box-counting was short-lived, however, for it was soon found by Greenside et al. [61 that, for attractors of dimension exceeding two, box-counting was a task of prohibitive computational complexity. Nonetheless, box-counting has a respectable track record, having been successfully enlisted in efforts to detect and characterize scale-invariant structure in ~‘ attractors [6] and Poincaré sec~ I use this term in reference to attractors ofdimension less than two. Elsevier Science Publishers By.
tions of higher-dimensional attractors [7]. This Letter describes a straightforward method of box-counting which exploits the idea, introduced here and described elsewhere [8], that the representations of points on an attractor as n-tuples of base b numerals implicitly define a sequence of minimal covers of the attractor with n-dimensional cubes of uniform and geometrically decreasing edge length. The sequel contains first a brief discussion of definitions offractal dimensions, related terminology and ideas, and noteworthy efforts of other investigators. The exposition then centers on the idea that a point in n-dimensional Euclidean space may be represented as a base b” numeral whose digits specify a finite sequence of nested n-dimensional cubes. Some basic properties of bounded subsets of Euclidean space and their finite-precision representations are then described, and a method for box-counting with base b” numerals is introduced and illustrated in examples involving several low-dimensional fractals. Methods for the related problem of estimating fractal dimensions, each developed in terms of the base b” numerals introduced in this Letter, are described in a separate communication [91. Box dimension is the close relative of capacity, a fractal dimension originally defined by Kolmogorov [10] in terms of the minimal number of cubes of uniform edge length which cover a bounded subset of P”. Capacity is often described in the literature as 419
Volume 163, number 5,6
PHYSICS LETTERS A
the presumably well-defined limit of an indeterminate form, log N (E) dimK (E) = lim bo ~ (1) 8~’ in which N~(E) is the minimal number of n-dimensional cubes of edge length ô whose union contains the bounded subset E c~P”. For a sequence of edge lengths satisfying ô= b —r with bE {2, 3, ...} fixed and re { 1, 2, ...} free, the box dimension of a set E ~ [0, 1)’ is ,
—
mapping from Z” to 7L to facilitate the characterization of higher-dimensional attractors is described by Hunt and Sullivan [20], who incorporated such a mapping in an algorithm for the estimation of capacity by Monte Carlo integration. More recently, Liebovitch and Toth [211 described a related method for box-counting in which a single numeral is constructed by truncating and then concatenating the numerals representing a point’s coordinates. Liebovitch and Toth argue that, with such a one-toone mapping from Z~to Z, the hard work of box-
(2)
counting is no more difficult than sorting: For each edge length, the elements of a list of integers constructed in this way are masked and then examined
provided that it exists. Here, Nr( E) is the minimal number of n-dimensional cubes of edge length b r whose union contains E. The careful reader will note that, since box dimension is defined here in terms of a restricted set of cubes (only those defined in terms of base b expansions of points’ coordinates), it is an upper bound on capacity. Capacity and other dimensions that take on fractional values are described by Farmer et al. [11]. The surveys by Besicovitch [12] and Falconer [131 contain accessible descriptions of the mathematics of sets of fractional dimension. The idea that n-tuples of numerals define sequences ofnested n-dimensional cubes has its origins [141 in Georg Cantor’s discovery, in 1877, of a oneto-one correspondence between the set of real numbers and the set of n-tuples of real numbers. Kline [15] gives a popular description of Cantor’s one-to-
to determine the number of distinct elements in the list. In an addendum to their Letter, Liebovitch and Toth describe a modification of their mapping, suggested by Kaplan, with which box counts may be computed for p edge lengths in p traversals of a single sorted list. The method ofbox-counting described in ref. [81 enlists the finite-precision version of Cantor’s mapping to indirectly construct an ordered list of base b” numerals. As shown in ref. [8] and in the sequel, properties of ordered lists of base b’ numerals may be exploited to computebox counts forp edge lengths in a single traversal of such a list. To understand the finite-precision version of Cantor’s mapping, suppose bE {2, 3, ...} is some fixed base, and consider the conventional representation of the real number xc [0, 1) as a numeral whose digits belong to the base b alphabet {0, 1, b 1 }. The numeral d1d2...d~represents x, that is,
dimB (E)
tim
log N (E) b r r
30 March 1992
o~o
—
one correspondence and a brief historical account of its discovery. In the computer science literature, the related technique of bit interleaving and its applications in the representation of spatial data are described by Bentley [16] and Samet [17]. Although Cantor encountered difficulties in constructing a oneto-one mapping from P” to P with infinite decimal expansions (some rationals are not uniquely defined in terms of their infinite decimal expansions), there is no such difficulty in constructing a similarlydefined mapping from the n-tuples of integers 1’ to the integers 1. Recently, Városi [18] exploited useful properties of the elements in the range of such a mapping in an algorithm that enlists an external merge sort for the estimation of order-q Rényi entropies [19]. Városi’s idea of defining a one-to-one 420
...,
d d ~
—
d
3
2~”
I
if and only if [u v r,
~
r=
)
. with the endpoints of the half-open intervals d £ d e me as d b—’
(4) [Ur, Vr)
5
—
Ur =
i
and v =u r—
+ b —r
(
(6)
r
For convenience, numerals are written without a ra-
Volume 163, number 5,6
PHYSICS LETTERS A
30 March 1992
dix point, as in (3), with the understanding that they are correctly interpreted as numbers by placing the radix point immediately to the left of their most sig-
xc [0, 1 as an n xp matrix ofbase b digits. For n = 3 and p = 4,
nificant digit. Alternatively, the radix point may be placed immediately to the right of the least significant digit in (3), in which case the numerals represent the coordinates of a point in the n-dimen-
x
sional cube [0, ~ The idea of recursively approximating a real number with a sequence of nested intervals as in (3)— (6) is easily generalized from P to P” with Cantor’s method of constructing base b” numerals from conventional representations of points. To understand Cantor’s idea, consider the problem of approximating the position of a point xc [0, 1)~to a precision of one part in b”. The conventional approach to approximating the position of such a point is to first specify a sequence of p base b digits that define a planar region of thickness b ~ containing those points in [0, l)~whose first coordinates differ from the first coordinate of x by an amount no greater than one part in b”. Having done so for each of the coordinates of x, one observes that the three planar regions intersect in a cube of edge length b which contains the point. Thus, the position of the point is approximated, in this conventional manner, to a precision of one part in b~with three p-digit base b numerals. Cantor’s alternative approach is to first approximate all three coordinates ofx to a precision of one part in b by interpreting in the conventional manner only the most significant digit in the base b representations of each coordinate x, thuscubes distinguish3 pairwiseof disjoint ofedge ing from among the b length b in [0, 1)~that cube which contains x. The second-most-significant digits in the base b representations of the coordinates of x are then inter preted in this same manner to identify, within the cube just specified, a cube of edge length b 2 which also contains the point. Proceeding recursively to interpret in this manner coordinates’ digits of equal significance, one eventually specifies within [0, 1)~ a sequence of p nested cubes of geometrically decreasing edge length b~,re [p] ~ Numerals of the type constructed by Cantor are perhaps most easily understood in general terms by regarding the conventional representation of a point “
)fl
Id11 (,d21
d12 d22
d13 d23
d14\ d24)
d31
d32
d33
d34
(7) ~
if and only if its coordinates x, satisfy x
d1 d12d13 d14
(8)
in the sense of (3)— (6). Note that the first subscript in (7), ic [n], is a coordinate index, the second subscript je [p] is a position index, and the columns of the n xp matrix (7) each contain n base b digits of equal significance. The base b” digit formed by concatenating the base b digits in the jth column of the n xp matrix (7) is denoted as ~ (9) and the p-digit base b” numeral
e~ e2 ...e~ (10) is constructed by concatenating the base b” digits (9) in the usual way. This construction is illustrated in fig. 1 for b = 3 and n = 2. The notation t x means that the p-digit base b” numeral t approximates the position of the point x, to a precision of one part in b~,with a sequence ofp nested n-dimensional cubes. The closest-pair distance of a bounded and finite set E may be defined in terms of the sup norm II II as t
_____
_____
_____
_____
—
S2
I use the notation [n] for the positive integers { 1, 2
n}.
02
12
22
2
5
8
01
11
21
1
4
7
00
10
20
0
3
6
-______
(a)
(b)
Fig. 1. In (a), the left digit in a square is the most significant digit in the temarm’ expansion of the x-coordinate of any point in the square, and the right digit is the most significant digit in the ternary expansion of the p-coordinate of any point in the square. The two ternary digits are written as single base 32 numerals in (b).
421
Volume 163, number 5,6
PHYSICS LETTERS A
cp(E)~min{IIx—yII:x,ycEandx~y}.
(11)
30 March 1992
merals. This result may be established in the following way: Suppose that the finite set E ~ [0, 1)” contains at least two elements, and denote by D~(T) the number of base b” numerals in the ordered list T E that agree with their predecessor in their first j— 1 digits. If T E to within one part in b”, then
Strange attractors typically have many finite subsets for which closest-pair distance decreases with cardinality in accordance with the same fixed scaling law. For finite sets constructed by sampling the points on a low-dimensional attractor, closest-pair distance is usually a rapidly decreasing function of cardinality. It follows that, for large subsets of points on a low-dimensional attractor, the finite precision of certain representations might not be sufficient to resolve the individual points in the subset. It is shown below that the minimal number ofbase b digits necessary for representing the points of a finite set E c [0, 1) each as distinct numerals increases roughly in proportion to the absolute value of the base b logarithm of the closest-pair distance of E. To establish this result, suppose that the finite set E ~ [0, 1) contains two or more elements and denote
for all rc [p]. To see that (14) holds under the stated conditions, suppose that the elements of T, indexed on the integers, are in nondecreasing order, denote by Tk the first k elements of this list, and denote by Nr(Ek) the minimal number of cubes of edge length b r which cover the corresponding points in Ek. Now, suppose that tk and tk+ are adjacent elements of the ordered list T, and that tk± agrees with its predecessor tk in its first r* 1 digits. Since the elements of T are in nondecreasing order, the following rela-
qm_floorlog~cp(E)
tions hold:
,
(12)
with floor(z) returning the greatest integer less than z. For the corresponding set of base b~numerals T
{t
x: XE E},
Nr( E) = 1 + ~ D~(T)
(14)
~‘ I
—
1
—
Nr(Ek÷l)Nr(Ek)~rE [r*_. 1] Nr(Ek+l ) Nr(Ek) + l.~=r=r*, r*+ 1
p.
(15) (16)
(13)
Constructing T by appending successors to an or-
the sufficient condition p> q guarantees that no two distinct elements of E have the same representation in T. This follows directly from the requirement that the closest pair of points in E have distinct representations in T: If p exceeds q, then the base b expansions of the closest pair of points in E specify disjoint intervals. For p> q, E and T are finite sets of equal cardinality. In the sequel, T E is written to
dered list of base b’ numerals in this manner, one readily obtains the result, (14). The application of (14) is described here for a fractal set constructed in the same way as the set depicted in fig. 2. For b= 3, n = 2 and p= 2, define the restricted base b” alphabet G~{0, 2, 4, 6} and construct with it the set of sixteen base b” numerals T = {e, e2: e~e G4=jE [2] }. (17)
indicate that T approximates E in the manner just described. With distance defined in terms of the sup norm, the sufficient condition on precision stated in the preceding paragraph also holds for a bounded and finite set Ec [0, 1)~,neIN. It is interesting to note that, for a sequence of higher-dimensional reconstructions [2,3] generated from a scalar time series of fixed length, closest-pair distance is a nondecreasing function of embedding dimension. In fact, cbsest-pair distances of such reconstructions almost always increase with embedding dimension. As stated earlier, box-counting with base b” numerals involves only a single comparison of each of the adjacent elements in an ordered list of such flu422
It is easily verified by listing the elements of this set that (14) is satisfied with D1 (T) = 3 and D2 (T) = 12. It may be shown that the similarly defined set of points EE{x~e1e2...:e~eG.~=jEl\J} (18) has box dimension dimB ( E) = log34 1.26. More generally, for point sets constructed in this manner from a fixed alphabet G, a straightforward argument shows that the box dimension of the set is the base b logarithm of the cardinality of G. Box counts for a 2’ ‘-cycle ofthe logistic map, cornputed in accordance with (14), are shown in fig. 3. In fig. 4, the results of applying this method ofbox-
Volume 163, number 5,6
PHYSICS LETTERS A
30 March 1992
‘p.
_
/1///
Reconstrnctions Fig. 4. Box o countswere for reconstructions generated,r withofthe unit lag Hénon and attractor embedding 32 [221. di-
Fig. 2. The set shown here, {x~e,e
2e3e4: e~G~=je[p] ~, is con-
structed with b= 3, n=2 and p=4 from the restricted alphabet
mensions n {2, 3, 4, 5}, from a time series of x-coordinates of 216 points on the Hénon attractor.
G={0, 2,4, 6}. In
In
r
5
S ./ /
/ C
0
_______________________________________ 0
r
0
32
Fig. 3. Box counts for a 2”-cycle of the logistic map, x1+1=~tx(l—x)with u=3.5699456, forb=2 and r[32]. The slope of the straight line, approximately 0.538, agrees with estimates published by other investigators,
counting with base b” numerals are shown for several reconstructions ofthe Hénon attractor [22]. Box counts for a Poincarésection of the Monod attractor, an invariant set of a nonlinear dynamical system studied by Kot [23], are shown in fig. 5. It is advantageous to recognizethat, given the base
r
32
Fig. 5. Box counts for 212 points on a Poincaré section of the
Monod attractor [23].
b representations of a point’s coordinates, any digit of the corresponding base b’ numeral may be accessed by evaluating the appropriately-defined storage mapping function [24]. Hence it is possible to indirectly sort a list of base b” numerals simply by re-ordering the elements of a vector of indices. Moreover, because indirection may also be exploited in phase space reconstruction, it is possible to devebop a box-counting algorithm in which the ele423
Volume 163, number 5,6
PHYSICS LETTERS A
ments of a scalar time series too remain in place throughout the computations. Additional details concerning one implementation ofsuch a box-counting algorithm are described in ref. [8]. The author acknowledges, with many thanks, a number of interesting discussions with Dr. Mark Kot of the University of Tennessee. This work was partially supported by the United States Department of Energy through grant DE-FGO5-89ER60880.
References
—.
[1] B. Mandelbrot, The fractal geometry of nature (Freeman, San Francisco, 1983) pp. 14—19. [2] N.H. Packard, J.P. Crutchfield, J.D. Farmer and R.S. Shaw, Phys. Rev. Lett. 45 (1980) 712. [3] F. Takens, in: Dynamical systems and turbulence, eds. D.A. Rand and L.S. Young (Springer, Berlin, 1985) p. 366. [4]A.M. Fraser and H.L. Swinney, Phys. Rev. A 33 (1986) 1134. [5] A.M. Fraser, IEEE Trans. Inf. Theory 35 (1989) 245. [6] H.S. Greenside, A. Wolf, J. Swift and T. Pignataro, Phys. Rev. A 25(1982) 3453. [7] D.A. Russell, J.D. Hanson and E. Ott, Phys. Rev. Lett. 45 (1980) 1175.
424
30 March 1992
[8] S.C. Bingham, Efficient algorithms for the estimation of capacity and correlation dimension, MS. Thesis, University of Tennessee (1989). [9] S. Fractal dimensions ofsets ofbase b” numerals, in Bingham, preparation. [101 A.N. Kolmogorov, DokI. Akad. Nauk SSSR 119 (1958) 861. [11] J.D. Farmer, E. Ott and J.A. Yorke, Physica D 7 (1983) 153. [12] A.S. Besicovitch, Math. Ann. 101(1929) 161. [13] K.J. Falconer, The geometry of fractal sets (Cambridge Univ. Press, Cambridge, 1985).
[141G.
Cantor, J. Reine Angew. Math. 84 (1878) 242, §7. [15] M. Kiine, Mathematical thought from ancient to modern times (OxfordUniv. Press, Oxford, 1972) p. 997. [16] J.L. Bentley, Commun. ACM 18 (1975) 509. [17] H. Samet, The design and analysis of spatial data structures (Addison-Wesley, Reading, 1990) §2.7. [18] F. Városi,Efficient use of diskstorage for computingfractal dimensions, M.A. Thesis, University of Maryland (1985). [19] A. Rényi, Probability theory (North-Holland, Amsterdam, 1970) appendix A. [20] F. Hunt and F. Sullivan, in: Dimensions and entropies in chaotic systems, ed. G. Mayer-Kress (Springer, Berlin, 1986) p. 74. [21]L.S.LiebovitchandT.Toth,Phys.Lett.A 141 (1989) 386. [22] M. Hénon, Commun. Math. Phys. 50 (1976) 69. [23] M. Kot, Chaos in the forced double-Monod model, in preparation. [24] D.E. Knuth, The art of computer programming, 2nd Ed., Vol. 1. Fundamental algorithms (Addison-Wesley, Reading, 1973) §2.2.6.