Power Laws for Repetitions
In the previous chapter, we have analyzed power laws connected to the growth of block mutual information (1.132). We have seen that these laws arise naturally if the persistent topic of a random text is infinitely complex. Equivalently, we may say that in this case, there exists an infinitely complex world that is repeatedly described by the random text. In contrast, in this chapter, we would like to study the power‐law logarithmic growth of maximal repetition (1.133), which also seems to arise in texts created by humans, as introduced in Section 1.13.
The power‐law logarithmic growth of maximal repetition was discovered by Dębowski ( 2012b , 2015b ) accidentally. The initial motivation for this research was confirming a hypothesis of Dębowski ( 2011 ) that the maximal repetition for natural language grows logarithmically, which was connected to the theorem about facts and words originally stated for minimal grammar‐based codes, see Problem 7.4. A converse statement turned out to be likely true for natural language. Consequently, we have asked the question what kind of stochastic processes can exhibit a power‐law logarithmic growth of maximal repetition and in what ways they can resemble natural language. This idea inspired further papers (Dębowski, 2017 , 2018b ), where we constructed random hierarchical association (RHA) processes and demonstrated some general bounds for the maximal repetition in terms of conditional Rényi entropy rates.
In fact, the maximal repetition had been earlier researched by Erdös and Rényi ( 1970 ), Shields ( 1992 ), and Szpankowski ( 1993b ). Whereas for finite‐state processes, the maximal repetition grows logarithmically, Shields ( 1992 ) has shown that in general, the maximal repetition can grow arbitrarily fast for stationary processes, and this growth may hold regardless of the value of the Shannon entropy rate. Complementing this result, Szpankowski ( 1993b ) showed that the logarithmic rate of growth of maximal repetition is equal to the so called collision entropy rate for some subclass of processes with a finite excess entropy. This result is less general than the partial result of Dębowski ( 2018b ). Thus, we can see that we need both more general and stronger results so as to understand what happens in natural language.
As it was sketched in Section 1.13, our intuition is that the infinitely complex world repeatedly described in texts in natural language may emerge in the limit as a result of human tendency to imitate previously encountered chunks of text. More generally, we suppose that the process being perigraphic and the power‐law growth of block mutual information can be a mathematical consequence of the power‐law logarithmic growth of maximal repetition or rather of a related phenomenon. We have not succeeded in proving this linking statement yet, and, in this chapter, we will present a bundle of preliminary propositions that might help in future research. Some of these results have not been discussed in the literature so far, whereas some have been beautified.
Thus, Section 9.1 is devoted to Rényi–Arimoto entropies, a generalization of the conditional Shannon entropy. The Rényi–Arimoto entropies do not satisfy the chain rule and the polymatroid identities like the Shannon entropy but they enjoy a number of other nice relationships. They are parameterized with an extended real number parameter, and they are decreasing with respect to this parameter. They are also monotonic with respect to their other arguments.
In Section 9.2 , we consider generalized entropy rates defined as the upper limits of the rates of Rényi–Arimoto block entropies for a stationary process. If the process satisfies a certain condition stronger than finite excess entropy then the respective generalized entropy rates exist as the proper limits and do not change their value if we impose conditioning on the infinite future. It is an important open question whether this result can be generalized to processes with an infinite excess entropy such as, hypothetically, the natural language.
Recurrence times are the topic of Section 9.3 . The recurrence time is the first position in the stationary process on which the value of the initial block of the specified length reoccurs. Recurrence times are a classical topic in ergodic theory and information theory. We recall some received results such as the Kac lemma and the Kontoyiannis bounds for recurrence times in terms of the block probability. Subsequently, using these propositions, we prove the Wyner–Ziv/Ornstein–Weiss (WZ/OW) theorem, which shows that the rate of recurrence times equals the Shannon entropy rate of a stationary ergodic process almost surely and in expectation.
Section 9.4 treats the concept of subword complexity. Subword complexity is a function that counts how many distinct substrings of a given length are contained in a given string. Subword complexity can be linked with recurrence times. In particular for a stationary process, the expected subword complexity equals the expectation of the recurrence time trimmed to the length of the considered string. Given this result, we can express Jensen gaps for the recurrence time, such as the variance, as series of the expected subword complexity. Using other simple techniques, we can also upper bound the expected subword complexity by the block entropy of the process.
In Section 9.5 , we introduce two maximal lengths: the longest match length and the maximal repetition. The longest match length is smaller than the maximal repetition and grows essentially like the logarithm of the window length divided by the Shannon entropy rate, by the WZ/OW theorem proved in Section 9.3 . In contrast, it was discussed in the literature that the maximal repetition can grow faster. For processes with a finite excess entropy, satisfying the condition mentioned in Section 9.2 , it was shown that the maximal repetition grows essentially like the logarithm of the string length divided by the collision entropy rate. We show two ideas of generalizing this result to arbitrary stationary processes which fail.
To be more positive, in Section 9.6 , we discuss a few bounds for maximal repetition that work for arbitrary stationary processes. We reformulate the problem of bounding the maximal repetition using entropy powers and Hilberg exponents. We show that the power‐law logarithmic growth of maximal repetition corresponds to a power‐law growth of an entropy function if the Hilberg exponent of the respective entropy power of the maximal repetition is approximately constant and bounded away from zero and infinity. We show that this quantity is indeed constant for Rényi–Arimoto entropies, and we present a few positive bounds which apply Kontoyiannis inequalities for recurrence times. These bounds do not fully constrain the growth of maximal repetition, however, and should be strengthened in the future.
9.1 Rényi–Arimoto Entropies
The general goal of this chapter is to furnish some theory for growth rates of maximal repetition. We will approach this topic gradually, moving through various related concepts, whose relationship to our main subject will become clear in the end. To begin, in this section, we will define and investigate properties of generalized entropies called Rényi entropies and Rényi–Arimoto conditional entropies. These quantities generalize the concepts of Shannon entropy and Shannon conditional entropy, respectively. We will link them to maximal repetition ultimately in Section 9.6 .
The unconditional Rényi entropies are defined as follows, see Rényi ( 1961 ).
Definition 9.1 (Rényi entropies)
For a parameter
, the Rényi entropy of a simple random variable
is defined as
(9.1)
, we define the Rényi entropy as
(9.2)
As a definition of the generalized entropy, Rényi proposed the first formula in ( 9.1 ), which is trivially equal to the second, more decorated formula. The second formula, however, motivates a straightforward generalization of the Rényi entropy to a conditional quantity called the Rényi–Arimoto entropy.
It took some time before this reasonable definition of a generalized conditional entropy was proposed. The nontrivial achievement was to insert the expectation operator in such a place that would guarantee the most interesting algebraic properties of the resulted object. Consequently, the conditional entropy will be generalized as follows, see Fehr and Berens ( 2014 ).
Definition 9.2 (Rényi–Arimoto conditional entropies)
For a parameter
, the Rényi–Arimoto conditional entropy of a simple random variable
given an arbitrary random variable
is defined as
(9.3)
where
, whereas for
, we define the Rényi–Arimoto conditional entropy as
(9.4)
It can be easily seen that
and
for a constant
. Some special cases of Rényi and Rényi–Arimoto entropies have their names, mentioned in the following proposition. Two of them, the Shannon and the Hartley entropy, have been already encountered.
Theorem 9.1
Some special cases of Rényi and Rényi–Arimoto entropies are:
-
1. Hartley entropy:
(9.5)
(9.6)
-
2. Shannon entropy:
(9.7)
(9.8)
-
3. Collision entropy:
(9.9)
(9.10)
-
4. Min‐entropy:
(9.11)
(9.12)
Proof:
It is straightforward that the unconditional expressions are special cases of the conditional expressions so it is sufficient to derive the latter ones.
-
1. We have
. Let
. Then (9.13)
-
2. By the L'Hôpital rule, we obtain
(9.14)
The first derivative can be developed as
(9.15)
Consequently, we obtain the claim.
-
3. These equalities follow by a direct application of formulas ( 9.1 ) and ( 9.3 ).
-
4. We obtain
(9.16)
It is a general fact that entropy
decreases if we increase parameter
. This result requires a certain preparation and care. Let
be a probability ‐norm of this distribution as
(9.17)
For
, we have
(9.18)
since the Shannon entropy is positive. Hence,
is a decreasing function of
. This relationship is called the inequality on means. Somewhat surprisingly, unconditional Rényi entropy
is also a decreasing function of
, in spite of the negative sign, since
(9.19)
where the Kullback–Leibler (KL) divergence is also positive.
Now we can state the theorem by Fehr and Berens ( 2014 ) about monotonicity of Rényi–Arimoto entropies.
Theorem 9.2
We have
for
.
Proof:
It is sufficient to prove our claim for
and
and conditional entropies. In both cases, we can denote
and write
(9.20)
where the first inequality follows by ( 9.19 ) and the second inequality follows by the Jensen inequality ( Theorem 3.14 ). Hence, we obtain the claim.
Yet we have a simple upper bound for some entropies in terms of the min‐entropy, which is the smallest of all generalized entropies.
Theorem 9.3
We have
for
.
Proof:
For
, we obtain
(9.21)
As shown by Fehr and Berens ( 2014 ), the Rényi–Arimoto conditional entropy does not satisfy the exact chain rule like the Shannon conditional entropy, but it satisfies the following weaker inequalities:
(9.22)
We will demonstrate now the first two inequalities.
Theorem 9.4
We have
.
Proof:
We have
. Hence, for
, we obtain
(9.23)
where the inequality follows by the repeated use of the Jensen inequality ( Theorem 3.14 ) for function
. The other cases of
can be obtained by continuity.
Theorem 9.5
We have
.
Proof:
For
, we obtain
(9.24)
The other cases follow by continuity.
9.2 Generalized Entropy Rates
In this section, we will investigate simple properties of Rényi block entropies and Rényi entropy rates, tracing some ideas from Section 5.2 such as the Fekete lemma. In contrast to the Shannon entropy rates, the existence of Rényi entropy rates as proper limits is guaranteed only for a subclass of stationary processes. As it will become clear, this class of processes has a finite excess entropy, so it may be too small as for the needs of statistical language modeling.
Let us consider a stationary process
over a finite alphabet
. By analogy to finite sequences
of symbols
, we will also write infinite sequences
. A similar convention is applied to random variables. Recall the Shannon block entropy
and the Shannon entropy rate
. Formally, we may also define the conditional Shannon block entropy
. By analogy we may consider the following Rényi block entropies.
Definition 9.3 (Block Rényi entropy)
For a stationary process
over a finite alphabet and
, let us define the block Rényi entropies
(9.25)
(9.26)
By the results of the previous section,
and
are increasing functions of
and decreasing functions of
. Moreover, we have
,
, and
.
Recall that for a stationary process, the Shannon entropy is subadditive,
, and hence by the Fekete lemma ( Theorem 5.11 ), for the process over a finite alphabet, the Shannon entropy rate
can be equivalently defined as the limit
(9.27)
By analogy, we may consider the following rates of Rényi block entropies:
(9.28)
(9.29)
In the second turn, we may ask whether the respective upper limits exist as proper limits. It turns out that the proper limit exists always for the largest of all Rényi entropies.
Theorem 9.6
For a stationary process
over a finite alphabet, we have
(9.30)
Proof:
Observe that
. Hence
and thus ( 9.30 ) holds by the Fekete lemma ( Theorem 5.11 ).
Limit
will be called the Hartley entropy rate.
The behavior of other block Rényi entropies seems to be less regular, unless we make some pretty strong assumptions. Consider for example conditions
(9.31)
(9.32)
Clearly, if condition ( 9.31 ) is satisfied then process
is finitary, i.e. its excess entropy is finite. Thus, condition ( 9.31 ) is probably too strong as for probabilistic modeling of natural language. But as we will see in Section 11.1 , condition ( 9.31 ) is satisfied by hidden Markov processes with a finite number of hidden states. Similar statement holds also for condition ( 9.32 ). Therefore, it makes a certain sense to contemplate conditions ( 9.31 ) and ( 9.32 ) for a while.
In fact, it can be shown that condition ( 9.31 ) is sufficient for the existence of proper Rényi entropy rates. The following result is due to Pittel ( 1985 ).
Theorem 9.7
For a stationary process
over a finite alphabet which satisfies condition ( 9.31 ) and
, we have
(9.33)
Proof:
Write
. For
, observe that condition ( 9.31 ) implies
(9.34)
Hence,
for
for
by continuity and thus ( 9.33 ) holds by the Fekete lemma ( Theorem 5.11 ).
Similar statements hold also for rates
, which are equal to rates
.
Theorem 9.8
For a stationary process
over a finite alphabet which satisfies condition ( 9.31 ) and
, we have
(9.35)
Proof:
It is sufficient to show that differences
tend to zero. Write
and
. For
, assuming ( 9.31 ), we obtain indeed
(9.36)
which remains true also for
by continuity. Hence, we obtain the claim.
It is an open question whether relationships ( 9.33 ) and ( 9.35 ) survive when we relax somehow condition ( 9.31 ). Answering this question is important since by the discussion in Chapter 8 , we may suppose that condition ( 9.31 ) is too strong as for probabilistic modeling of natural language, for it implies that excess entropy is finite.
9.3 Recurrence Times
In this section, we will study some basic properties of recurrence times, i.e. the functions which return the first position in an infinite sequence on which the initial block of a given length reoccurs. Recurrence times can be related to both Rényi entropies (see Theorem 9.28 ) and maximal repetition (see Theorem 9.26 ). In this section, we will present a few more fundamental and more celebrated results. It should be noted that recurrence times are a classical topic in ergodic theory and information theory. Their fundamental links with probability and the Shannon entropy rate have been established by Kac ( 1947 ), Wyner and Ziv ( 1989 ), and Ornstein and Weiss ( 1993 ). Less recognized are their links with Rényi entropies (Ko, 2012 ). Recently, recurrence times have been also researched experimentally for natural language (Altmann et al., 2009 ).
The formal definition of the recurrence times is as follows.
Definition 9.4 (Waiting and recurrence times)
The waiting time
is the first position in the infinite sequence
on which a copy of a string
starts,
(9.37)
where the infimum of the empty set equals infinity,
. In contrast, the recurrence time
is the first position in the infinite sequence
on which a copy of the finite prefix
restarts,
(9.38)
The first proposition concerning recurrence times is due to Kac ( 1947 ). It states that the conditional expectation of the recurrence time is equal to the inverse probability of the recurring event.
Theorem 9.9 (Kac lemma)
Consider a stationary ergodic process
. If
then
(9.39)
Proof:
Denoting
, we obtain
(9.40)
Recall that
. Since
holds almost surely by the Birkhoff ergodic theorem ( Theorem 4.6 ), then we obtain
for
(9.41)
Subsequently, by stationarity we may write
(9.42)
which implies the claim.
is also stationary ergodic, as a consequence of the Kac lemma we obtain two probabilistic bounds for the recurrence time, established by Kontoyiannis ( 1998 ). The first Kontoyiannis bound applies unconditional probability.
Theorem 9.10 (Kontoyiannis bound)
For a stationary ergodic process
over a countable alphabet, for any
, we have
(9.43)
Proof:
By the conditional Markov inequality (see Theorem 3.11 )
(9.44)
and the Kac lemma ( Theorem 9.9 ), we obtain
(9.45)
which is the claim.
The second Kontoyiannis bound applies conditional probability.
Theorem 9.11 (Kontoyiannis bound)
For a process
over a finite alphabet of cardinality
, for any
, we have
(9.46)
Proof:
By the conditional Markov inequality ( 9.44 ), we obtain
(9.47)
, so we have a uniform almost sure bound
(9.48)
which implies the claim.
A simple consequence of the Kontoyiannis bounds is the following theorem discovered by Wyner and Ziv ( 1989 ) and Ornstein and Weiss ( 1993 ), which is called the WZ/OW theorem. For a stationary ergodic process over a finite alphabet, the WZ/OW theorem equates the exponential growth rate of the recurrence time to the Shannon entropy rate.
Theorem 9.12 (Almost sure WZ/OW theorem)
For a stationary ergodic process
over a finite alphabet, we have
(9.49)
where
is the entropy rate of the process.
Proof:
Putting
in ( 9.43 ) and
in ( 9.46 ) we obtain by the Borel–Cantelli lemma ( Theorem 3.12 ) that sandwich bound
(9.50)
holds for all but finitely many
almost surely. But by the proof of the Shannon–McMillan–Breiman (SMB) theorem ( Theorem 6.1 ), we have
(9.51)
Hence the claim follows.
A similar result holds in expectation for any stationary process over a finite alphabet. As it can be foreseen, the expected exponential growth rate of the recurrence time is also equal to the Shannon entropy rate.
Theorem 9.13 (Expected WZ/OW theorem)
For a stationary process
over a finite alphabet, we have
(9.52)
where
is the Shannon entropy rate of the process.
Proof:
Let
be the block entropy of process
. Observe that
. Hence, applying Theorem 9.10 , we also obtain
(9.53)
Conversely, we observe that given
there is a one‐to‐one correspondence between
and
. Moreover, we observe that
. Hence,
for a random variable
assuming values in natural numbers and a constant
, see the proof of a similar bound in Theorem 8.17 . Thus,
(9.54)
As a result, we obtain a sandwich bound for expectations,
(9.55)
Noticing that
completes the proof.
Using the Kontoyiannis bounds, moments of the recurrence time
can be also bounded by Rényi entropy rates of order
. A related idea will be used in Theorem 9.28 to bound the maximal repetition, via recurrence times, with Rényi entropies.
9.4 Subword Complexity
In this section, we will investigate some properties of subword complexity, i.e. the function which counts how many different substrings of a given length appear in a given string. Subword complexity can be simply related to both recurrence times (see Theorem 9.15 ) and maximal repetition (see Theorem 9.20 ). Subword complexity has not been much researched in information theory but it is a simple characteristic of a string. It has been mostly studied by theoretical computer scientists (Ferenczi, 1999 ; de Luca, 1999 ; Janson et al., 2004 ; Gheorghiciuc and Ward, 2007 ; Ivanko, 2008 ). As we will show in this section, subword complexity can be used to estimate moments of recurrence times, so it should deserve more attention in stochastic processes.
The formal definition of the subword complexity is as follows.
Definition 9.5 (Subword complexity)
The subword complexity
is the number of distinct substrings of length
in string
. In symbols, we have
(9.56)
whereas we put
for
.
We note in passing that subword complexity
is the cardinality of the empirical vocabulary
defined in (6.57). Let us write
(9.57)
We note the well‐known simple combinatorial bound for the subword complexity
(9.58)
where
is the cardinality of the alphabet of symbols
.
It is natural to ask whether subword complexity and recurrence times are related. Let us make the following simple observation, which holds in general.
Theorem 9.14
Let
be an arbitrary infinite sequence. Then
(9.59)
Proof:
Observe that for
we have
(9.60)
and since
then we obtain the telescope sum
(9.61)
Thus, we have derived the claim.
Subsequently, let us define the subword complexity of an infinite sequence and the trimmed recurrence times of a string,
(9.62)
(9.63)
As a consequence of Theorem 9.14 , an exact equality can be proved for the expectations of subword complexity and trimmed recurrence time, if we assume that the process which generates strings is stationary.
Theorem 9.15
Let
be a stationary stochastic process over a countable alphabet. Then for
, we have
(9.64)
Proof:
By identity ( 9.59 ), we have
(9.65)
Applying stationarity and inverting the order of summation, we obtain
(9.66)
Finally, using identity
for a random variable
taking values in natural numbers yields
(9.67)
which is the requested claim for finite
. The claim for infinite
follows hence by the monotone convergence ( Theorem 3.8 ).
We note that the expectation of the recurrence time is
for a process
over an alphabet of cardinality
– by the Kac lemma ( Theorem 9.9 ). Thus, identity ( 9.64 ) is a neat complement of the simple bound ( 9.58 ). We find it intriguing that identity ( 9.64 ) holds for all stationary processes. Similar equalities do not seem to be true for other moments of subword complexity and recurrence times – and even the equality for the expectations may break down for nonstationary sources.
What is somehow surprising, the variance of recurrence time and, more generally, Jensen gaps of recurrence time can be expressed by a series of expected subword complexities. This is a consequence of a more general fact for Jensen gaps of random variables taking values in natural numbers. For a real random variable
and a function
, the Jensen gap is usually defined as difference
. For random variable
taking values in natural numbers and a function
, we will define the Jensen gap as
, where formula
(9.68)
extends function
to a piecewise linear function
. For a convex function
, so extended function
is also convex and so defined Jensen gap is positive by the Jensen inequality ( Theorem 3.14 ).
Now let us denote the central second difference operator
(9.69)
Let us observe that for a random variable
taking values in natural numbers,
(9.70)
since
and thus
. Hence, we obtain the following representation by summing by parts.
Theorem 9.16
Let
be a bounded random variable assuming values in natural numbers. For an arbitrary function
, we have
(9.71)
Proof:
For functions
, we observe the identity of summing by parts which takes form
(9.72)
Now let us put
. Since
, we obtain
for
and
. This yields
(9.73)
Since
(9.74)
and
by observation ( 9.70 ), we further derive
(9.75)
Thus, the claim follows by conjunction of equalities ( 9.73 ) and ( 9.75 ).
Obviously,
. Thus, Theorem 9.16 has a simple corollary for convex functions, which follows by the monotone convergence.
Theorem 9.17
Let
be a random variable assuming values in natural numbers such that
. Put
for
. For a convex function
we have
(9.76)
(9.77)
Proof:
Consider
for
. We have
(9.78)
Observe that for a convex function
we have
, whereas random variables
are uniformly either increasing or decreasing to
for sufficiently large
. Also terms
and
increase with
to
and
respectively. Hence the claims follow by the monotone convergence ( Theorem 3.8 ).
It is an interesting problem whether inequality ( 9.76 ) can be further generalized. Let us note that there exist convex functions
and linear functions
such that the reverse inequality is true,
(9.79)
For example, we can take
,
and
. Then inequality ( 9.79 ) is obtained for
. It may be possible, however, that the desired inequality
(9.80)
holds if function
is convex and function
satisfies a sort of contracting condition similar to
.
To make another observation, as a consequence of formula ( 9.77 ), we obtain a bound for the variance
of form
(9.81)
where
by convexity of function
.
Let us come back to subword complexity and trimmed recurrence time in the case of a stationary process. Let us write their common expectation as
(9.82)
with
. Since
by observation ( 9.70 ), then expectation
is a positive, growing, and concave function of
– like the Shannon block entropy
. Assume now that limit
(9.83)
is finite and take a convex function
. By Theorem 9.17 for
we obtain
(9.84)
(9.85)
As some special cases of formula ( 9.85 ), we obtain for instance expressions
(9.86)
(9.87)
(9.88)
We suppose that the variance of subword complexity is in general smaller than the variance of the respective trimmed recurrence time. Thus, potentially, plugging empirical averages of subword complexities instead of their expectations
into the above formulas, we may estimate Jensen gaps of untrimmed recurrence time given a sample path of a stationary ergodic process.
In the following, we would like to provide some links between the subword complexity and certain entropy functions. Since subword complexity for arbitrary sequences can be quite large, it is convenient to consider the logarithm of the subword complexity. In this way, we obtain the Hartley entropy of a sequence, see Allouche and Shallit ( 2003 ).
Definition 9.6 (Hartley entropy)
The Hartley entropy of a string or an infinite sequence is defined as
(9.89)
The Hartley entropy of a sequence can grow at most linearly for a finite alphabet of cardinality
since
in this case. This entropy is naturally connected to the Hartley entropy of a generating stochastic process.
Theorem 9.18
For a stationary process
over a countable alphabet,
(9.90)
and if process
is ergodic, then we have equality in ( 9.90 ).
Proof:
Since the alphabet is countable, inequality
holds almost surely for all
, and hence
holds almost surely. Additionally, if the process is ergodic then by the Birkhoff ergodic theorem ( Theorem 4.6 ), if
then the relative frequency of
in
is almost surely strictly greater than zero. Hence,
holds almost surely.
Somewhat less trivial is a bound for the expected subword complexity in terms of the Shannon entropy. The following inequality is based on the results originally formulated by Dębowski ( 2016a , b , 2018b ).
Theorem 9.19
For a stationary process
over a countable alphabet, if
then
(9.91)
where we use the integral logarithm
(9.92)
Proof:
We will use the identity
(9.93)
Hence by the Markov inequality ( Theorem 3.11 ),
(9.94)
Observe that
. Therefore, by the Markov inequality ( Theorem 3.11 ), we have
(9.95)
for
. Hence, for
, we further obtain from ( 9.94 ) that
(9.96)
which is the requested claim.
We would like to stress that bound ( 9.91 ) is valid also for processes over an infinite alphabet. If the random symbols
are words of natural language (which are a priori countably infinitely many) then subword complexity
as a function of text length
is the empirical vocabulary size function, studied in quantitative linguistics (Khmaladze, 1988 ; Baayen, 2001 ). In this domain, also discussed is the type‐token ratio
. On page 9.4 we have observed that for a stationary process, the expected vocabulary size
is a positive, growing, and concave function of text length
. In that case, by Theorem 9.19 , the expected type‐token ratio satisfies
(9.97)
if additionally the Shannon entropy
is finite.
We note that for natural language, the empirical vocabulary size
grows approximately like
where
by the Herdan's law discussed in Section 1.3, whereas the unigram entropy of words was estimated cross‐linguistically as
bits (Bentz et al., 2017 ). Hence, Theorem 9.19 gives quite a loose bound in this case. It is interesting, however, to note that finiteness of word entropy is in general a sufficient cause to make the expected type‐token ratio tend to zero, under the hypothesis that texts are generated by a stationary source.
9.5 Two Maximal Lengths
In this section, we will deal with two examples of maximal lengths: the longest match length and the maximal repetition. The longest match length has been researched mostly by information‐theorists (Wyner and Ziv, 1989 ; Ornstein and Weiss, 1993 ; Szpankowski, 1993a ; Kontoyiannis et al., 1998 ; Gao et al., 2008 ). In contrast, the maximal repetition has been studied by computer scientists (de Luca, 1999 ; Kolpakov and Kucherov, 1999b , a ; Crochemore and Ilie, 2008 ), probabilists (Erdös and Rényi, 1970 ; Arratia and Waterman, 1989 ; Shields, 1992 , 1997 ), and information theorists (Szpankowski, 1993b ; Kontoyiannis and Suhov, 1994 ; Dębowski, 2011 , 2017 , 2018b ).
The definition of the longest match length is as follows.
Definition 9.7 (Longest match length)
The longest match length
of an infinite sequence
is the maximal length of its prefix that is repeated within the first
symbols. In symbols, we have
(9.98)
Subsequently comes the definition of the maximal repetition.
Definition 9.8 (Maximal repetition)
The maximal repetition
of a string
is the maximal length of a substring that is repeated in the string on possibly overlapping positions. In symbols, we have
(9.99)
Maximal repetition can be computed in time which grows linearly with the length of string (Kolpakov and Kucherov, 1999a , b ). Thus, we can easily compute the maximal repetition for empirical data.
The longest match length and the maximal repetition can be connected to recurrence times. To make the simple observation, we have
(9.100)
so that we obtain
(9.101)
Hence by the almost sure WZ/OW theorem ( Theorem 9.12 ) for a stationary ergodic process
with a Shannon entropy rate
, we obtain
(9.102)
The exact proof is left as a simple exercise. As we can see, the rate of the longest match length is exactly equal to the Shannon entropy rate, whereas the rate of the maximal repetition is greater.
Indeed, the first inequality in ( 9.102 ) can be strict, as shown by Shields ( 1992 ). In particular, for any stationary ergodic process
and a function
such that
, there is a measurable function
of infinite sequences and a stationary ergodic process
, where
, such that
(9.103)
Whereas the Shannon entropy rate of process
is smaller than that of process
(Gray, 1990 ), a careful analysis of the proof of Shields ( 1992 ) shows that the difference between the two can be made arbitrarily small. Moreover, if we take
to be an IID process, then process
is mixing.
Is there a general upper bound for the maximal repetition in terms of a different entropy function? According to Szpankowski ( 1993a , b ), if process
satisfies both conditions ( 9.31 ) and ( 9.32 ) then not only the collision entropy rates satisfy
(9.104)
which we have shown in Section 9.2 but also the maximal repetition obeys
(9.105)
As it was mentioned in Section 1.13, it was shown by Dębowski ( 2012b , 2015b ) that the maximal repetition for texts in natural language satisfies the power‐law logarithmic growth and in this context we should rather contemplate condition
(9.106)
for an
and
. Moreover, in the context of natural language modeling, probably we cannot assume condition ( 9.31 ) since it implies that the excess entropy is finite. In view of these empirical premises, it is valid to ask whether condition ( 9.106 ) implies in general that the collision entropy rate
exists as a proper limit and is equal to zero. This question is more difficult than it seems and we will not give a definite answer. In the next section, we will only manage to show that if condition ( 9.106 ) holds then
for
.
It is easy to see that the growth rate of the maximal repetition should be somehow related to the growth rate of some sort of collision entropy. Namely, some simple idea of upper bounding the maximal repetition in terms of collision entropy is as follows. We have inequality
(9.107)
where as for a stationary ergodic process by identity (4.34) we obtain
(9.108)
Hence we obtain
for the difference
(9.109)
and consequently
(9.110)
which seems to open way to using the Borel–Cantelli lemma. The ugly little problem, however, lies in upper bounding the difference
in terms of
.
To show some fairly promising path that fails, consider the following. Let
(9.111)
be the partitions of the probability space into cylinders of a fixed length and let
be their union. We note that we may bound uniformly
(9.112)
where
(9.113)
Subsequently, since class
has a finite Vapnik–Chervonenkis dimension, we may apply the uniform ergodic theorem by Adams and Nobel ( 2010 ) and the dominated convergence ( Theorem 3.10 ) to obtain
. But unfortunately, we have inequality
if the distribution of process
is nonatomic, so bound ( 9.112 ) is mostly useless when combined with inequality ( 9.110 ), see also Problem 8 .
Discussing bounds for the maximal repetition in terms of entropy functions, we should also take into account some basic algebraic links between maximal repetition, subword complexity, and recurrence times. The link between maximal repetition and subword complexity is captured by the following simple observation.
Theorem 9.20
We have
if and only if
.
Proof:
String
contains
substrings of length
. Among them there can be at most
different substrings. If
, there must be a repeat of length
. Hence
. Conversely, if
, there is a repeat of length
and
.
As a result we obtain these bounds.
Theorem 9.21
We have
(9.114)
(9.115)
Proof:
We have
if
and
if
. Hence
(9.116)
(9.117)
from which the claims follow.
Similarly, we can demonstrate the bound
(9.118)
We suppose that the variance of subword complexity and also its higher moments
are relatively small for stationary ergodic processes. If it is so, we may use the Taylor series
(9.119)
and consequently both probabilities
and
would be controlled by the difference
(9.120)
. We will not pursue it, however, since there are a few gaps on the way such as bounding the higher moments in equality ( 9.119 ), see also Problem 10 .
9.6 Logarithmic Power Laws
Eventually, we would like to be constructive and to present a few approaches to bounding the maximal repetition that do work in the general stationary ergodic case. Let us notice that formally the power‐law logarithmic growth of maximal repetition can be linked to a power‐law growth of some generalized block entropies and vanishing of some generalized entropy rates. We observe that condition ( 9.106 ) can be written as
(9.121)
for some generalized block entropy function
and its related entropy power
(9.122)
Let us observe that if
is an increasing function of block length
then the Hilberg exponent of random variable
is almost surely constant for a stationary ergodic process by Theorem 8.3 . In fact, in this case we can often state a stronger proposition that the Hilberg exponent of function
for some entropy function
is bounded away from zero and infinity. Having such a statement, we can then use this linking result.
Theorem 9.22
Let
be a stationary ergodic process. Suppose that
(9.123)
where
and
is an increasing function of
. Then for
we have implications
(9.124)
(9.125)
Proof:
We notice that for a stationary ergodic process
, the upper and the lower limit of
are almost surely constant by a reasoning similar to the proof of Theorem 8.3 . Hence, first, we have
(9.126)
Second, we have
(9.127)
Hence, by contradiction, we obtain the second implication.
Resuming, by Theorem 9.22 , if the Hilberg exponent of function
for some entropy
is bounded away from zero and infinity then the power‐law logarithmic growth of maximal repetition is roughly equivalent to the power‐law growth of the generalized entropy function
and implies in particular that the respective entropy rate satisfies
. In the following, we will produce a few bounds of form ( 9.123 ) using Rényi–Arimoto entropies.
Let us observe that the result of Szpankowski ( 1993a , b ) for processes
that satisfy both conditions ( 9.31 ) and ( 9.32 ) can be written in a slightly weaker form as
(9.128)
where
is the power of the collision entropy of the process. Unfortunately, this statement rests on the strong assumptions ( 9.31 ) and ( 9.32 ) which do not seem to hold for natural language. Thus we need some other bounds that hold more generally.
A simple application of Theorem 9.20 is the following lower bound applying the concept of Hartley entropy of a sequence, the largest of all Rényi entropies.
Theorem 9.23
For a sequence
over a finite alphabet, let
be the power of the Hartley entropy of the sequence. Assume that
. Then we have
(9.129)
Proof:
By Theorem 9.20 ,
, where
is cardinality of the alphabet. Consequently, since
, hence the claim follows.
This result has a stochastic counterpart.
Theorem 9.24
For a stationary process
over a finite alphabet, let
be the power of the block Hartley entropy of the process. Assume that
almost surely. Then we have
(9.130)
Proof:
By Theorem 9.18 ,
almost surely. Hence the claim is a corollary of Theorem 9.23 .
Abound similar to Theorem 9.24 was observed by Dębowski ( 2015b ).
Now we will derive an upper bound of a similar simplicity. The upper bound applies the concept of the conditional min‐entropy, which is the smallest of all Rényi–Arimoto entropies.
Theorem 9.25
For a stationary process
over a finite alphabet, let
be the power of the block conditional min‐entropy. We have
(9.131)
Proof:
For
we have
(9.132)
Thus by the Bonferroni inequality (2.31),
(9.133)
In particular, it follows that
(9.134)
Since
for a positive random variable
, using substitution
, we obtain that
(9.135)
. Hence by Theorem 8.4 , we infer in this case
(9.136)
Bounds similar to Theorem 9.25 were observed in part by Erdös and Rényi ( 1970 ), Shields ( 1997 ), and Kontoyiannis and Suhov ( 1994 ).
Subsequently, we will strengthen Theorems 9.24 and 9.25 , narrowing the sandwich bound for the maximal repetition. We will show that we may replace the block Hartley entropy
with the block Shannon entropy
and the conditional block min‐entropy
with the conditional block Rényi entropies
, where
, slightly improving the constants. For this goal we will apply recurrence times and the Kontoyiannis bounds from Section 9.3 .
Theorem 9.26
For a stationary process
over a countable alphabet, we have
(9.137)
Proof:
By relationships ( 9.101 ) and ( 9.59 ) respectively, we have
(9.138)
(9.139)
Hence, claim follows by stationarity and the Bonferroni inequality (2.31).
Now we will state the strengthening of Theorem 9.24 . A bound similar to the following proposition, albeit slightly weaker, was established by Dębowski ( 2018b ).
Theorem 9.27
For a stationary process
over a countable alphabet, let
be the power of the block Shannon entropy. Assume that
(9.140)
Then we have
(9.141)
Proof:
By inequality ( 9.137 ), the Markov inequality ( Theorem 3.11 ), and inequality ( 9.55 ), we obtain
(9.142)
Hence,
(9.143)
and in particular, for
, the respective quantile of the entropy power satisfies
(9.144)
It follows hence that
for any
and we obtain the claim by Theorem 8.5 .
An alternative proof of Theorem 9.27 can make use of inequalities ( 9.91 ) and ( 9.114 ). See Dębowski ( 2018b ).
Finally, we will state the strengthening of Theorem 9.25 . A bound similar to the following proposition was shown by Dębowski ( 2018b ).
Theorem 9.28
For a stationary process
over a finite alphabet, let
and
be the power of the block conditional Rényi–Arimoto entropy. Assume that
(9.145)
Then we have
(9.146)
Proof:
Let
be the cardinality of the alphabet of process
. By inequality ( 9.137 ), the second Kontoyiannis bound ( 9.46 ), and the Markov inequality ( Theorem 3.11 ), we obtain
(9.147)
Hence in particular for
we obtain
(9.148)
Let us write
. Since
for a positive random variable
, we obtain
(9.149)
Substituting
, we further derive
(9.150)
where integrals
(9.151)
are finite for
. Hence by Theorem 8.4 , we infer in this case
(9.152)
It remains an open question whether Theorems 9.27 and 9.28 can be sharpened.
Problems
-
9.1 Let random variables
be independent. Show that equality
holds for the Rényi entropies for any
. -
9.2 Show that Definitions 9.1–9.2 and the theorems from Section 9.1 can be generalized to random variables with a countably infinite alphabet.
-
9.3 Prove inequality
. Compare your solution with Fehr and Berens ( 2014 ) afterwards. -
9.4 and ( 9.32 ) show that
(9.153)
-
9.5 Let
be an arbitrary process over a countable alphabet. For any
show that (9.154)
for all but finitely many
almost surely. -
9.6 Prove relationships ( 9.102 ) for a stationary ergodic process over a finite alphabet.
-
9.7 Show that subword complexity satisfies
for
, whereas
for
, where
is the maximal repetition of
. Having completed the task, compare your solution with de Luca ( 1999 ). -
9.8 Let
be the cardinality of the alphabet of process
. Show that (9.155)
-
9.9 Let
be an arbitrary process over a countable alphabet. Let us define the empirical distribution (9.156)
and let
be the Shannon entropy of distribution
. Argue that
, whereas
if process
is stationary. Finally, show that for
we have (9.157)
-
9.10 Consider a bounded random variable
. Show that (9.158)
Hint : Use
.