To calculate this dimension for a fractal S, imagine this fractal lying on an evenly-spaced grid, and count how many boxes are required to cover the set. The box-counting dimension is calculated by seeing how this number changes as we make the grid finer.
Suppose that N(ε) is the number of boxes of side length ε required to cover the set. Then the box-counting dimension is defined as:
If the limit does not exist then one must talk about the upper box dimension and the lower box dimension which correspond to the upper limit and lower limit respectively in the expression above. In other words, the box-counting dimension is well defined only if the upper and lower box dimensions are equal. The upper box dimension is sometimes called the entropy dimension, Kolmogorov dimension, Kolmogorov capacity or upper Minkowski dimension, while the lower box dimension is also called the lower Minkowski dimension.
Both are strongly related to the more popular Hausdorff dimension. Only in very specialized applications is it important to distinguish between the three. See below for more details. Also, another measure of fractal dimension is the correlation dimension.
These, in turn follow with a little effort from the triangle inequality.
The advantage of using balls rather than squares is that this definition generalizes to any metric space. In other words, the box definition is "external" — one needs to assume the fractal is contained in a Euclidean space, and define boxes according to the external structure "imposed" by the containing space. The ball definition is "internal". One can imagine the fractal disconnected from its environment, define balls using the distance between points on the fractal and calculate the dimension (to be more precise, the Ncovering definition is also external, but the other two are internal).
The advantage of using boxes is that in many cases N(ε) may be easily calculated explicitly, and that for boxes the covering and packing numbers (defined in an equivalent way) are equal.
The logarithm of the packing and covering numbers are sometimes referred to as entropy numbers, and are somewhat analogous (though not identical) to the concepts of thermodynamic entropy and information-theoretic entropy, in that they measure the amount of "disorder" in the metric space or fractal at scale , and also measure how many "bits" one would need to describe an element of the metric space or fractal to accuracy .
Another equivalent definition for the box counting dimension, which is again "external", is given by the formula
where for each r>0, the set is defined to be the r-neighborhood of S, i.e. the set of all points in which are at distance less than r from S (or equivalently, is the union of all the open balls of radius r which are centered at a point in S).
However, they are not countably additive, i.e. this equality does not hold for an infinite sequence of sets. For example, the box dimension of a single point is 0, but the box dimension of the collection of rational numbers in the interval [0, 1] has dimension 1. The Hausdorff dimension by comparison, is countably additive.
An interesting property of the upper box dimension not shared with either the lower box dimension or the Hausdorff dimension is the connection to set addition. If A and B are two sets in a Euclidean space then A + B is formed by taking all the couples of points a,b where a is from A and b is from B and adding a+b. One has
The box dimensions and the Hausdorff dimension are related by the inequality
In general both inequalities may be strict. The upper box dimension may be bigger than the lower box dimension if the fractal has different behaviour in different scales. For example, examine the interval [0,1], and examine the set of numbers satisfying the condition
The digits in the "odd places", i.e. between and are not restricted and may take any value. This fractal has upper box dimension 2/3 and lower box dimension 1/3, a fact which may be easily verified by calculating N(ε) for and noting that their values behaves differently for n even and odd. To see that the Hausdorff dimension may be smaller than the lower box dimension, return to the example of the rational numbers in [0, 1] discussed above. The Hausdorff dimension of this set is 0.
Box counting dimension also lacks certain stability properties one would expect of a dimension. For instance, one might expect that adding a countable set would have no effect on the dimension of set. This property fails for box dimension. In fact