The asymptotic number of prefix normal words
Paul Balister, Stefanie Gerke

TL;DR
This paper establishes the asymptotic count of prefix normal binary words of length n, revealing their exponential growth with a subexponential correction, and analyzes the maximum number of words sharing a fixed prefix normal form.
Contribution
It provides the first precise asymptotic enumeration of prefix normal words and bounds the number of words with a given prefix normal form.
Findings
Number of prefix normal words of length n is 2^{n - Θ((log n)^2)}.
Maximum number of words with a fixed prefix normal form is 2^{n - O(√(n log n))}.
Shows the growth rate and structural properties of prefix normal words.
Abstract
We show that the number of prefix normal binary words of length is . We also show that the maximum number of binary words of length with a given fixed prefix normal form is .
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAlgorithms and Data Compression · semigroups and automata theory · Coding theory and cryptography
The asymptotic number of prefix normal words
Paul Balister Department of Mathematical Sciences, University of Memphis, Memphis TN 38152. Email: [email protected]. Partially supported by NSF grant DMS 1600742.
Stefanie Gerke Mathematics Department, Royal Holloway University of London, Egham TW20 0EX, UK. Email: [email protected].
Abstract
We show that the number of prefix normal binary words of length is . We also show that the maximum number of binary words of length with a given fixed prefix normal form is .
Keywords: Prefix normal words, random construction
1 Introduction
Given a binary word of length , denote by the subword of length starting at position and ending at position , that is, . Let be the number of 1s in the word . We define the profile of by
[TABLE]
so that is the maximum number of 1s in any subword of of length . The word is called prefix normal if for all this number is maximized at , so that
[TABLE]
In other words, a word is called prefix normal if the number of s in any subword is at most the number of s in the prefix of the same length.
If then we can remove the common subword of and , so that iff . Thus to show that is prefix normal it is enough to check that
[TABLE]
Prefix normal words were introduced by G. Fici and Z. Lipták in [4] because of their connection to binary jumbled pattern matching. Recently, prefix normal words have been used because of their connection to trees with a prescribed number of vertices and leaves in caterpillar graphs [6].
The number of prefix normal words of length is listed as sequence A194850 in The On-Line Encyclopedia of Integer Sequences (OEIS) [7]. We prove the following result, conjectured in [2] (Conjecture 2) where also weaker upper and lower bounds were shown, see also [3].
Theorem 1**.**
The number of prefix normal words of length is .
Given an arbitrary binary word of length , the prefix normal form of is the unique binary word of length that satisfies
[TABLE]
Note that for any , , so is well-defined. Moreover, we can define an equivalence relation on binary words of length by
[TABLE]
Indeed, is just the lexicographically maximal element of the equivalence class of under this equivalence relation.
In [4] it is asked how large can an equivalence class be. In other words, what is the maximum number of words of length that have the same fixed prefix normal form. This maximum number is listed in the OEIS as sequence A238110 [7]. From Theorem 1 it is clear that it must be at least . However, we show that it is much larger.
Theorem 2**.**
For each there exists a prefix normal word such that the number of binary words of length with prefix normal form is .
2 Proofs
Proof of the lower bound of Theorem 1..
To prove the lower bound we will need to construct prefix normal words of length . We will do so by giving a random construction and showing that this construction almost always produces a prefix normal word.
Fix a constant and define
[TABLE]
Write so if , and for . Let be a random word with each letter chosen to be 1 with probability , independently for each . Clearly (1) holds for all , so assume . By comparing the integral with the corresponding Riemann sum, we note that
[TABLE]
uniformly for (and uniformly in ). Indeed, the approximation of the integral by the Riemann sum has error at most the maximum term, due to the monotonicity of the integrand, and the additive constant is also by considering the case . From this we estimate the expected difference
[TABLE]
as
[TABLE]
This expression is minimized when is as small as possible, i.e., . Thus
[TABLE]
for sufficiently large . By (2), can be considered as the sum of independent Bernoulli random variables (with an offset of ).
We recall the Hoeffding bound [5] that states that if is the sum of independent random variables in the interval then for all ,
[TABLE]
(Note that these two bounds are essentially the same bound as the second can be easily derived from the first by exchanging the roles of the [math]s and s but we state them both here for convenience.)
Let \mu^{*}=\mathbb{E}\big{(}\sum_{i=1}^{k}w_{i}+\sum_{i=j+1}^{k+j}(1-w_{i})\big{)}. Note that . We have
[TABLE]
Hence if is large enough () then . Taking a union bound over all possible values of and , we deduce that is prefix normal with probability .
It remains to count the number of such . For any discrete random variable , define the entropy of the distribution of as
[TABLE]
where the sum is over all possible values of and the logarithm is to base 2. If the random variable is a Bernoulli random variable, we call the binary entropy function . We use the following well-known (and easily verified) facts about the entropy.
- H1)
If are independent discrete random variables and , then . 2. H2)
If takes on at most possible values with positive probability then . 3. H3)
The Taylor series of the binary entropy function in a neighbourhood of is
[TABLE]
In particular, for a Bernoulli random variable with , . 4. H4)
If is subset of possible values of we have
[TABLE]
where denotes the distribution of conditioned on the event and denotes the indicator function of .
Applying these results to our random word we have
[TABLE]
On the other hand, if is the set of prefix normal words, then
[TABLE]
We deduce that and hence . ∎
Proof of the upper bound in Theorem 1..
We will prove the upper bound in two parts. Firstly we will show that most prefix normal words have to contain a good number of s in any prefix of reasonable size as we cannot extend a prefix with too few 1s to a prefix normal word in many ways. Secondly, we will show that there are at most ways to construct a word which has sufficiently many s in all reasonably sized prefixes.
Assume and consider the first blocks of size of . If then the number of choices for the second and subsequent blocks is at most , and hence the number of choices for is at most
[TABLE]
If , say, then there are far fewer than choices of such prefix normal words, even allowing for summation over all such and .
Using Stirling’s formula one can show that for and integral,
[TABLE]
see for example [1] for a detailed proof.
Thus, by H3), we have
[TABLE]
provided . Thus if and we can deduce that for some small universal constant . Thus, without loss of generality, we can restrict to prefix normal words with the property that
[TABLE]
Define , which for simplicity we shall assume is an integer. (One can reduce slightly to ensure this is the case.) Define to be the event that (4) holds with , i.e., that . Let be the smallest such that and let be the largest such that . We bound the probability that a uniformly chosen satisfies .
Write for the event that and for the event that . Thus is just . Write for the intersection .
Claim: For and ,
[TABLE]
where . Note that for all . For the case we simply use the Hoeffding bound (3) to obtain
[TABLE]
as required.
Now assume the claim is true for . We first want to give a bound on . Note that if holds then in particular holds and thus for to hold we still need at least
[TABLE]
s in the interval . Thus we get
[TABLE]
Note that there are elements in the interval and that we expect
[TABLE]
s in this interval. Hence by Hoeffding
[TABLE]
Note that the final inequality is even true for negative : for Hoeffding’s bound holds, and for the bound on the probability is larger than . If we let then we have
[TABLE]
Now by induction, . As we have
[TABLE]
as required. Thus the claim is proved.
Now we take and to deduce that . Recall , , and that was chosen so . Thus, for large , . Using the inequality , which holds for , we deduce that , and so . Also, we have as and thus . As the probability that a uniformly chosen word satisfies is at most , we deduce that the number of prefix normal words is at most . ∎
Proof of Theorem 2..
Fix an integer and assume for simplicity that is a multiple of . Define , where are arbitrary Catalan sequences of length . Here a Catalan sequence is a binary sequence of length such that for all and . It is well-known that the number of choices for is the Catalan number
[TABLE]
It is easy to see that the prefix normal form of any of this form is
[TABLE]
Indeed, there is a subword of for all . For , if we write with then we have a subword or which is of length and has the requisite number of 1s. On the other hand, the definition of a Catalan sequence implies no other subword of length containing the subword can possibly have more 1s. Any substring intersecting the and of length greater than can be replaced by one containing the with at least as many ones. And finally, any subword of length not intersecting the subword (so contained within the subword) can have at most 1s as an end-word of contains at most 1s and there are at most 1s in the initial subword of of length .
It remains to count the number of possible ’s. This is just
[TABLE]
Taking gives words satisfying (5). ∎
Acknowledgement: We would like to thank the anonymous referees for their helpful comments and their quick response.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Robert B. Ash, Information Theory , Interscience, Wiley 1966.
- 2[2] Péter Burcsi, Gabriele Fici, Zsuzsanna Lipták, Frank Ruskey, Joe Sawada. Normal, Abby Normal, Prefix Normal , in: A.Ferro, F. Luccio, P. Widmayer eds., Fun with Algorithms. FUN 2014, LNCS vol. 8496, Springer. pp. 74–88,
- 3[3] Péter Burcsi, Gabriele Fici, Zsuzsanna Lipták, Frank Ruskey, Joe Sawada. On Prefix Normal Words and Prefix Normal Forms , Theor. Comp. Science 658 (2017) 1–13.
- 4[4] Gabriele Fici, Zsuzsanna Lipták. On Prefix Normal Words , In Proc. of the 15th Intern. Conf. on Developments in Language Theory (DLT 2011), volume 6795 of LNCS, pages 228–238. Springer, 2011.
- 5[5] Wassily Hoeffding, Probability Inequalities for sums of bounded random variables Journal of the American Statistical Association 58 (1963) 13–30.
- 6[6] Alexandre Blondin Masse, Julien de Caruful, Alain Goupil, Mélodie Lapointe, Émile Nadeau, Élise Vandomme Leaf Realization problem, caterpillar graphs and prefix normal words , Theor. Comp. Science 732 (2018) 1–13.
- 7[7] The On-Line Encyclopedia of Integer Sequences , https://oeis.org/ .
