A Technology for Reverse-Engineering a Combinatorial Problem from a Rational Generating Function

A Technology for Reverse-Engineering a Combinatorial Problem from a Rational Generating Function

Advances in Applied Mathematics 26, 129᎐153 Ž2001. doi:10.1006raama.2000.0711, available online at http:rrwww.idealibrary.com on A Technology for Rev...

178KB Sizes 0 Downloads 10 Views

Advances in Applied Mathematics 26, 129᎐153 Ž2001. doi:10.1006raama.2000.0711, available online at http:rrwww.idealibrary.com on

A Technology for Reverse-Engineering a Combinatorial Problem from a Rational Generating Function E. Barcucci Dipartimento di Sistemi e Informatica, Uni¨ ersita ` di Firenze, Via Lombroso 6r17, 50134 Firenze, Italy E-mail: [email protected]

A. Del Lungo and A. Frosini Dipartimento di Matematica, Uni¨ ersita ` di Siena, Via del Capitano 15, 53100 Siena, Italy E-mail: [email protected], [email protected]

and S. Rinaldi Dipartimento di Sistemi e Informatica, Uni¨ ersita ` di Firenze, Via Lombroso 6r17, 50134 Firenze, Italy E-mail: [email protected] Received June 4, 2000; accepted September 15, 2000

In this paper, we tackle the problem of giving, by means of a regular language, a combinatorial interpretation of a positive sequence Ž f n . defined by a linear recurrence with integer coefficients. We propose two algorithms able to determine if the rational generating function of Ž f n ., f Ž x ., is the generating function of some regular language, and, in the affirmative case, to find it. We illustrate some applications of this method to combinatorial object enumeration problems and bijective combinatorics and discuss an open problem regarding languages having a 䊚 2001 Academic Press rational generating function.

INTRODUCTION In several papers of enumerative and bijective combinatorics a combinatorial interpretation is requested of some positive sequence Ž f n . defined by a linear recurrence with integer coefficients, that is, positive sequences 129 0196-8858r01 $35.00 Copyright 䊚 2001 by Academic Press All rights of reproduction in any form reserved.

130

BARCUCCI ET AL.

having a rational generating function f Ž x . s Ý nG 0 f n x n. Many papers are indeed devoted to finding classes of combinatorial objects which are enumerated by the given sequence to an enumerative parameter. To provide interesting examples we only quote some of them: Ž1. f n s 6 f ny1 y f ny2 , with f 0 s 1, f 1 s 7. This recurrence defines the numbers known as NSW numbers Žsequence M4423 of w20x.. They count the total area of the region under elevated Schroder paths w1, ¨ 16, 22x. Ž2. f n s 2 f ny1 q f ny2 , with f 0 s 0, f 1 s 1. These are the well-known Pell numbers Žsequence M1413 of w20x.. Ž3. f n s 3 f ny1 y f ny2 , with f 0 s 1, f 1 s 2. These are the Fibonacci numbers having an odd index Žsequence M1439 of w20x.. They enumerate dcc-polyominoes according to the cell’s number w3x. Ž4. f n s f ny1 q 3 f ny2 q 2 f ny3 y 3 f ny4 q f ny5 q f ny6 for n ) 7, with f 0 s 1, f 1 s 3, f 2 s 6, f 3 s 12, f 4 s 20, f5 s 36, f6 s 58, f 7 s 100. These numbers do not appear in w20x. They enumerate the n-step self avoiding walks contained in the strip  0, 14 = wy⬁, ⬁x w24x. In October 1999, Jim Propp posted on the ‘‘domino’’ mailing list the problem of determining a combinatorial interpretation of a sequence of positive numbers defined by a linear recurrence, and then he asked: ‘‘Is there a technology for reverse-engineering a combinatorial problem from a rational generating function?’’ This means that, given a sequence Ž f n . of integer numbers defined by a linear recurrence, we have to determine classes of combinatorial objects which are enumerated by it. Our aim is to provide such a technology based on regular languages and on the theory of their generating functions. The generating function f L Ž x . of a language L is the formal power series f L Ž x . s Ý nG 0 f n x n, such that ᭙ n g ⺞, f n s 5 w g L : lgŽ w . s n45, where lgŽ w . denotes the length of w. We reach our goal by determining the ‘‘inverse’’ of the so-called Schutzenberger methodology. In an earlier paper, Chomsky and Schutzen¨ ¨ berger w7x proposed a methodology for determining the generating function of an unambiguous context free Žu.c.f.. language L from an unambiguous grammar G, such that LŽ G . s L . Let G s ² V, ⌺, P, S : be an u.c.f. grammar Žwhere V denotes the set of variables and ⌺ the alphabet.; the following morphism ⌰ on Ž ⌺ j V .U is defined: ⌰ Ž a. s x

if a g ⌺,

⌰ Ž ␭ . s 1, ⌰Ž ␣ . s ␣ Ž x .

if ␣ g V .

RATIONAL FUNCTIONS AND COMBINATORICS

131

By applying ⌰ to the set P of G’s productions, we obtain an algebraic system of equations in ␣ Ž x ., for all ␣ in V, ni

⌰Ž ␣i . s

Ý ⌰ Ž ␤i . ,

jis1

ji

where ␣ i ª ␤i1 < . . . < ␤i n is a production of P. i

Now let ⌰Ž L. s Ý w g L⌰Ž w . s Ý nG 0 f n x n. One can prove that there is a unique solution SŽ x . which represents the generating function for L . We usually use fG Ž x . instead of f LŽG .Ž x . to indicate this function. We quote w7x the following theorems: Ži. If G is an u.c.f. grammar, then fG Ž x . is algebraic. Žii. If G is an unambiguous regular Žu.r.. grammar, then fG Ž x . is rational. This technique is called the Schutzenberger methodology and represents a ¨ very powerful tool for solving many combinatorial objects enumeration problems, when it is possible to describe the class of objects by means of a context free grammar Žsee also w8, 9x.. An example of this is the Dyck walks, bijectively corresponding to the Dyck words, generated by the grammar G s S ª aSbS ¬ ␭. By applying the Schutzenberger methodology we obtain ¨ S Ž x . s x 2 S 2 Ž x . q 1, SŽ x . s

1 y '1 y 4 x 2 2 x2

s 1 q x 2 q 2 x 4 q 5 x 6 q 14 x 8 . . . .

The problem concerning the ‘‘inverse’’ of the Schutzenberger methodology ¨ can be defined as follows: given a function F Ž x ., we want to establish if there exists an unambiguous context-free language L such that FL Ž x . s F Ž x .. This problem on rational functions was previously raised by Cori during a talk given by Del Ristoro ŽLabri, 1997, ‘‘Une interpretation ´ combinatoire de la recurrence f nq 1 s 6 f n y f ny1’’.. Providing the ‘‘inverse’’ of the Schutzenberger methodology for rational ¨ functions Ži.e., F Ž x . is rational., we solve both the problems proposed by Cori and by Propp Ži.e., we give a reverse technology for the combinatorial problems that can be solved on the class of regular languages.. The first non-trivial problem when working with a rational function F Ž x . s Ý nG 0 f n x n is that of deciding if every coefficient f n is non-negative. This problem was proposed originally in w19x. The S-unit Theorem w10, Sect. 4.3x guarantees that it suffices to look at sufficiently many initial terms of the sequence Ž f n . to determine positivity.

132

BARCUCCI ET AL.

Going further in determining the inverse methodology, we give a characterization of the set R of regular languages’ generating functions. A powerful tool for obtaining an analytic characterization of R is the theory of formal power series, and, in particular, the ⺞-rational series, proposed in the 1970s by Eilenberg and Soittola and Salomaa w11, 19, 21x, and most recently treated by Berstel and Reutenauer w6x and Perrin w17x. Many important theorems of these authors helped us to determine two algorithms for: Ži. deciding if a given rational function lies in R ŽAlgorithm 1, Section 3.; Žii. building an unambiguous regular expression for a function in R ŽAlgorithm 2, Section 3.. These algorithms define the inverse of the Schutzenberger methodology ¨ for rational functions, thus solving Propp’s problem in terms of languages. This, in turn, means that given an integer positive sequence Ž f n . defined by a linear recurrence with integer coefficients, we can decide if a regular language enumerated by this sequence exists and, if so, we can find it. Now the question concerning our reverse technology is how ‘‘large’’ is the class of combinatorial problems that can be solved on regular languages, with respect to the class of all integer positive sequences defined by linear recurrences with integer coefficients. Unfortunately, there are classes of rational functions giving positive integer sequences but not deriving from any regular language. We wish to point out that considering combinatorial problems on the class of unambiguous context-free languages does not improve the reverse technology. In fact, it is possible to prove that if an unambiguous contextfree grammar has a rational generating function, then it must be ⺞-rational; i.e., a regular language having the same generating function does exist Žsee Open Problems.. We conclude that the problem of discovering a language, or another combinatorial object, whose generating function is ⺪-rational but not ⺞-rational is still open.

1. FROM REGULAR LANGUAGES TO RATIONAL FUNCTIONS In this section we deal with regular languages and give a characterization of the set of generating functions for a regular language L . By Kleene’s Theorem w13x, we can work on regular expressions instead of languages. It is known that for every regular language, L , it is possible to find an unambiguous regular expression Žu.r.e.., such that LŽ E . s L Žwith

RATIONAL FUNCTIONS AND COMBINATORICS

133

regard to the concept of unambiguity of regular expressions, see w14x.. Furthermore, given an unambiguous regular expression E, we use a simple method for obtaining its generating function f E Ž x . s f LŽ E .Ž x .: Ž1. if E s a, ⭋, ␭ with a g ⌺, then f E Ž x . s x, 0, 1, respectively; Ž2. if E s F k G, FG, E s F U then f F Ž x . fG Ž x ., f E Ž x . s 1rŽ1 y f F Ž x .., respectively.

f E Ž x . s f F Ž x . q fG Ž x .,

We denote the set of the generating functions of a regular expression by FR . Obviously, this set coincides with the set of the generating functions of a u.r.e. Now we define a set of rational functions R as follows: Ž1. 0, 1, kx g R, with k g ⺞; Ž2. if f Ž x ., g Ž x . g R, and f Ž0. q g Ž0. F 1, then f Ž x . q g Ž x . g R; Ž3. if f Ž x ., g Ž x . g R, then f Ž x . g Ž x . g R; Ž4.

f Ž x . g R, and f Ž0. s 0, then

1 1 y fŽx.

g R.

Let h be a function from the class of regular expressions into ⺞ such that: Ž1.

hŽ⭋. s hŽ a. s 0 with a g ⌺U ;

Ž2.

hŽ F k G . s hŽ FG . s max hŽ G ., hŽ F .4 ;

Ž3.

hŽ F U . s hŽ F . q 1.

hŽ E . is called the star-height of a regular expression E and represents the maximal number of nested stars in the regular expression. The star-height of the generating function f E Ž x . s Ý nG 0 f n x n is the minimum among the star-heights of the regular expressions describing the language LŽ E . Žsee w11x.. We now inductively define a procedure ren : r.e.ª r.e. that maps a r.e. into a new r.e. such that all symbols are distinct and preserves unambiguity, by simply extending its alphabet. Let E be the input r.e.; we initialize an alphabet ⌺ as empty. We define renŽ E . in the following way: ᎏif E s ␭, then renŽ E . [ ␭; ᎏif E s a and a f ⌺, then renŽ E . [ a and ⌺ [ ⌺ j  a4 ; ᎏif E s a and a g ⌺, then renŽ E . [ b with b f ⌺ and ⌺ [ ⌺ j  b4 ; ᎏif E s y k z, E s yz, E s yU Žwith y, z r.e.., then renŽ E . [ renŽ y . k renŽ z ., renŽ y . renŽ z ., Ž renŽ y ..U .

134

BARCUCCI ET AL.

EXAMPLE 1.1. Let E s ŽŽŽ ab k aa.U a.U cd . and ⌺ s ⭋: U

ren Ž E . s ren Ž Ž Ž ab k aa. a . s Ž ren Ž Ž ab k aa.

U

U

. ren Ž cd . U

. ren Ž a. . ren Ž c . ren Ž d . U

U

s Ž Ž ren Ž ab . k ren Ž aa. . a . cd U

U

s Ž Ž ren Ž a . ren Ž b . k ren Ž a . ren Ž a . . a . cd U

U

s Ž Ž eb k fg . a . cd

LEMMA 1.1.

Ž with ⌺ s  a, b, c, d, e, f , g 4 . .

Let E be a u.r.e.; we ha¨ e:

Ži.

renŽ E . is u.r.e.;

Žii.

f E Ž x . s f r enŽ E .Ž x .;

Žiii.

if f E Ž0. s 0, then w renŽ E .xU is an unambiguous regular expression.

Proof. Parts Ži., Žii. trivially follow from the definition of the ren procedure. Žiii. We only have to prove that renŽ E . is a code. It follows from the fact that renŽ E . is constructed on an arbitrarily large alphabet Žsee also the theory of codes w5x.. THEOREM 1.1.

R s FR .

Proof. Ž=. By induction on the number of steps to get f Ž x . s FR : Base. If f Ž x . s 0, 1, kx, then f Ž x . g R. Step. ᎏf Ž x . s g Ž x . q hŽ x .. g Ž x ., hŽ x . g R by inductive hypothesis; moreover, there are two u.r.e. G, H, such that G l H s ⭋, G k H s F, f Ž x . s f F Ž x ., and F u.r.e. It is clear that g Ž0. q hŽ0. F 1; otherwise, ␭ g G l H would go against our hypothesis. Finally, g Ž x . q hŽ x . s f Ž x . g R. ᎏf Ž x . s g Ž x . hŽ x .. g Ž x ., hŽ x . g R by inductive hypothesis, so g Ž x . hŽ x . s f Ž x . g R. ᎏf Ž x . s 1 y 1g Ž x . . By inductive hypothesis g Ž x . g R; let F and G be two u.r.e., such that f F Ž x . s f Ž x . and fG Ž x . s g Ž x .. We therefore get g Ž0. s 0; otherwise, ␭ g G 0 l G 1, with F being a code. Consequently, f Ž x . g R.

RATIONAL FUNCTIONS AND COMBINATORICS

135

Ž:. By induction on f Ž x . g R: Base. 0, 1, kx g FR by definition. Step. ᎏf Ž x . s g Ž x . q hŽ x . and g Ž0. q hŽ0. F 1. The proof is obvious if g Ž0. q hŽ0. s 0. Let us then assume that g Ž0. q hŽ0. s 1. By inductive hypothesis two u.r.e. G, H exist, such that ␭ f G l H and fG Ž x . s g Ž x ., f H Ž x . s hŽ x .. By Lemma 1.1, we know that f r enŽG .Ž x . s g Ž x . and f r enŽ H .Ž x . s hŽ x . and renŽ G . l renŽ H . s ⭋. It trivially follows that Fr enŽG . k r enŽ H .Ž x . s Fr enŽG .Ž x . q Fr enŽ H .Ž x . s g Ž x . q hŽ x . s f Ž x . and f Ž x . g FR . ᎏf Ž x . s g Ž x . hŽ x .. By inductive hypothesis, two u.r.e. G, H exist, such that fG Ž x . s g Ž x ., f H Ž x . s hŽ x .. By Lemma 1.1 we obtain f r enŽG .Ž x . s g Ž x . and f r enŽ H .Ž x . s hŽ x .. It follows that f r enŽG . r enŽ H .Ž x . s f r enŽG .Ž x . f r enŽ H .Ž x . s g Ž x . hŽ x . s f Ž x . and f Ž x . g FR . ᎏf Ž x . s 1 y 1g Ž x . . We know that g Ž x . g R and g Ž0. s 0. By inductive hypothesis ᭚G u.r.e., such that fG Ž x . s g Ž x . and ␭ f G. By Lemma 1.1, we get f r enŽG .Ž x . s g Ž x . and renŽ G .U u.r.e., so f r enŽG .U Ž x . s 1 y 1g Ž x . s f Ž x . and f Ž x . g FR . 2. AN ANALYTIC CHARACTERIZATION OF ⺞-RATIONAL SERIES In this section, we quote some definitions and well-known properties of ⺞-rational series Žfor further details, see w6, 19x.. Let K be a sub-semi-ring contained in ⺢, and K ²² x :: be the semi-ring of formal power series in one variable over K. A series f Ž x . s Ý nG 0 f n x n of K ²² x :: is K-rational if f Ž x . can be obtained from polynomials whose coefficients are in K by means of the rational operations of sum, convolution product, and quasiin¨ ersion, defined as 1 if f Ž 0 . s 0, then f U Ž x . s . 1 y f Ž x. A sequence Ž f n . ; K is called K-rational if its generating function f Ž x . s Ý nG 0 f n x n is K-rational. In this paper, we deal with K s ⺪ and K s ⺞, and all the definitions and results refer to this case. The following statements are equivalent: Ži. Ž f n . is ⺪-rational; Žii. the generating function f Ž x . s Ý nG 0 f n x n is f Ž x . s QP ŽŽ xx .. , with P Ž x ., Q Ž x . g ⺪w x x, Q Ž0. s 1 Ži.e., f Ž x . s Ž a0 q a1 x q ⭈⭈⭈ qa l x l .rŽ1 y b1 x y ⭈⭈⭈ ybm x m ., a i , bj g ⺪.;

136

BARCUCCI ET AL.

Žiii. Ž f n . satisfies the linear recurrence relation f n s b1 f ny1 q ⭈⭈⭈ qbm f nym ,

n G max  l q 1, m4 .

Ž 1.

Let f Ž x . s P Ž x .rQ Ž x . s Ž a 0 q a1 x q ⭈⭈⭈ qa l x l .rŽ1 y b 1 x y ⭈⭈⭈ ybm x m . be a ⺪-rational function, where P Ž x . and Q Ž x . have no common factor. The roots of Q Ž x . are called the poles of f Ž x .. The only monic polynomial m

QŽ x. s x m y

Ý bi x myi is1

is called the reciprocal polynomial of Q Ž x ., and its roots are called f Ž x .’s roots. A polynomial Q Ž x . has a dominating root if it has a real positive root ␣ such that ␣ ) < ␤i < for any other root ␤i / ␣ . A series f Ž x . has a dominating root if its minimal polynomial does. A sequence Ž rn . is a merge of sequences Ž sni . 0 F iF py1 if, for 0 F i F p y 1, rn pqi s sni , ᭙ n G 0. We denote the generating functions of Ž rn . and Ž sni . as f Ž x . and Fi Ž x .. It can be proved that: py 1 i Ž p . ᎏf Ž x . s Ý is0 x Fi x ; ᎏif ␣ 1 , . . . , ␣ n are f Ž x .’s roots, then Fi Ž x .’s roots are among ␣ 1p , . . . , ␣ mp .

The following results bring us to an analytic characterization of ⺞-rational series: THEOREM 2.1 w19, p. 57x. Let K be the ring ⺪ or a subfield of ⺓, Ž rn . a nonterminating sequence of elements of K ha¨ ing f Ž x . as generating function. Then the following conditions are equi¨ alent: Ži. Ž rn . is K-rational; Žii. for large ¨ alues of n we ha¨ e rn s

Ý Pi Ž n . ␣ in ,

Ž 2.

i

where the numbers ␣ i ’s are the roots of f Ž x ., the Pi ’s are algebraic o¨ er A, and the degree of each Pi is equal to the multiplicity of the root ␣ i minus one. Consider the terms of the sum Ž2.. Clearly the term where the absolute value of ␣ i is greatest determines the behavior of f Ž x . for large values of n. For ⺢q-rational series the ␣ coming from such terms must be obtained

RATIONAL FUNCTIONS AND COMBINATORICS

137

by multiplying a positive number by a root of unity. More precisely, we have: THEOREM 2.2 ŽBerstel w19, p. 61x.. If r Ž x . g ⺢q ²² x ::, then the roots of its generating function ha¨ ing maximal modulus Ž if any . are of the form D␰ , where D ) 0, and ␰ is a root of unity; D is one of these roots. By means of this theorem, Berstel and Reutenauer prove in w6x that for a ⺢q-rational sequence Ž rn . we can always get a decomposition showing the dominant term: THEOREM 2.3. If r Ž x . g ⺢q ²² x ::, then there are positi¨ e integers m and p such that if 0 F j F p y 1, then rmq jqn p s Pj Ž n . ␣ jn q

Ý Pi j Ž n . ␣ inj ,

Ž 3.

i

where, for e¨ ery i, j, ␣ j G 0, and ␣ j ) max< ␣ i j <4 , and Pj , Pi j are polynomials. Indeed the decomposition Ž3. is obtained by choosing a p such that the roots of unity involved become 1. The property characterizing ⺢q-rational series within the family of ⺢-rational sequences is the existence of a decomposition Ž3.. THEOREM 2.4 ŽSoittola w19, p. 64x.. Let K be the ring ⺪ or a subfield of ⺢. A K-rational sequence of positi¨ e numbers Ž rn ., such that for large ¨ alues of n, rn s P Ž n . ␣ n q

Ý Pi Ž n . ␣ in i

Ž where ␣ ) max< ␣ i <4 , and P / 0, P, Pi are polynomials. is Kq-rational. The following corollary is mostly used in the algorithms of the next section. To this purpose, we now give a sketch of a proof which relies on the previously cited theorems and on a technical lemma w6, Lemma 2.5, p. 84x which we do not quote for brevity’s sake. COROLLARY 2.1 w6, p. 90x. A ⺪-rational series f Ž x . ha¨ ing positi¨ e coefficients is ⺞-rational if and only if it is a merge of ⺪-rational series ha¨ ing a dominating root. Proof. Ž¥. Let f Ž x ., F0 Ž x ., . . . , Fpy1Ž x . be generating functions of Ž rn ., Ž sn0 ., . . . , Ž snpy 1 ., respectively. Let Ž rn . be merge of Ž sn0 ., . . . , Ž snpy 1 . and for all i - p, let ␣ i1 , . . . , ␣ i m be Fi Ž x .’s roots with ␣ i1 dominating. Each Fi Ž x . is ⺪-rational, so by Theorem 2.1 for large values of n we have Ž sni . s Pi1Ž n. ␣ i1n q Ý mjs2 Pi j Ž n. ␣ inj . By Theorem 2.4, each Ž sni . is ⺞-rational and consequently f Ž x . is ⺞-rational too.

138

BARCUCCI ET AL.

Ž«. Let f Ž x . be a ⺞-rational series. By Theorem 2.2, any root of f Ž x ., with maximal modulus has the form D␰ with ␰ root of unity and D ) 0. Let p be a common order of all these roots of unity and let F0 Ž x ., F1Ž x ., . . . , Fpy1Ž x . be the series whose merge is f Ž x .. By w6, Lemma 2.5x, each Fi Ž x . is ⺞-rational, and thus has a dominating root. Soittola’s Theorem allows us to decide if a ⺪-rational series is ⺞-rational w21x. It also establishes that any ⺞-rational series is of star-height 2 at most. The series whose star-height is equal to zero are polynomials of ⺞w x x. Bassino w4x proved that if an ⺞-rational series of star-height 1 then it has exclusively Handelmann numbers as real positive roots; if the series has also a dominating root the condition is also sufficient.

3. TWO ALGORITHMS The following algorithm allows us to establish if a rational function f Ž x . is ⺞-rational. ALGORITHM 1. Input: A ⺪-rational function f Ž x . s P Ž x .rQŽ x . s Ž a0 q a2 x q ⭈⭈⭈ q a l x l .rŽ1 y b1 x y ⭈⭈⭈ ybm x m ., where a i , bi g ⺪, and l - m, and P Ž x . and Q Ž x . have no common factor. The function is not a polynomial, and we denote its sequence by Ž f n . nG 0 . Output: f Ž x . is ⺞-rational or f Ž x . is not ⺞-rational. 1. Compute the roots ␣ 1 , . . . , ␣ k of f Ž x .. 2. Compute the least p so that the generating functions Fi Ž x . of the subsequences Ž f n pqi . nG 0 , 0 F i F p y 1 have no roots of the form D␰ , where D ) 0, and ␰ is a root of unity different from one. 3. Check if Fi Ž x . has a unique root of maximal modulus, for i s 0, . . . , p y 1. 4. Check if the coefficients of Fi Ž x . are all positive, for i s 0 . . . p y 1. 5. If 3. and 4. hold, each Fi Ž x . is ⺞-rational, and f Ž x . is ⺞-rational; otherwise f Ž x . is not ⺞-rational. We now propose some methods for performing the steps indicated in the algorithm. 1. We consider a root-finding algorithm based on numerical approximation and which works in polynomial time. The following statement holds w15x: If G g K w x x is a monic polynomial, n s deg G ) 0, < G < s Ý i < a i <, then all G’s zeros can be computed with absolute error ⑀ ) 0 using O Ž n2 log nŽ n

RATIONAL FUNCTIONS AND COMBINATORICS

139

< < log n. q log G⑀ . arithmetical operations. Moreover, in w12x a proof is given of the fact that two different roots of a polynomial having integer coefficients cannot be too close; that is, for such roots < ␣ i < / < ␣ j <, implies < < ␣ i < y < ␣ j < < G k Ž G ., where k Ž G . entirely depends on G. A precise expression for k Ž G . can be found in w12, p. 156x.

2. For this we need the following sub-steps: Ž1. we find the D␰ roots of f Ž x ., with D ) 0 and ␰ root of unity, and we denote them as ␣ i1, . . . , ␣ i h, among the roots ␣ 1 , . . . , ␣ k of f Ž x .: Ž2. we find the smallest integer p for which each ␣ ip is not of the j form D␰ , with D ) 0, and ␰ a root of unity different from one; Ž3. we go on to examine separately the series Fi Ž x . s Ý n f n pqi x n, 0 F i F p y 1, whose roots are among ␣ 1p , . . . , ␣ kp. Sub-step Ž1. can be carried on by taking the roots ␣ 1 , . . . , ␣ k of f Ž x . and constructing the symmetrical polynomial having integer coefficients, RŽ x . s

Ł Ž ␣i x y ␣ j . . i, j

Let n Q - deg R, such that, for each n ) n Q , we have ␸ Ž n. ) deg R Žwhere ␸ Ž n. is the Euler function and indicates the degree of a primitive root of unity.; we then divide R by the first n Q cyclotomic polynomials and find the roots of unity of RŽ x .. The generating function Fi Ž x . of the sequence Ž f n pqi . n can be calculated by means of the k-section formulas w18x: if s is a primitive p-root of unity, then

Fi Ž x . s

Ý nG0

f n pqi x n s

1 px 1r p

p

Ý s pyi j f Ž s j , x 1r p . ,

i s 0, . . . , p y 1.

js1

Now, f Ž x . is a merge of the functions Fi Ž x .. EXAMPLE 3.1. Apply step 2 to the function f Ž x . s 1rŽ1 y x q x 2 .Ž1 y 2 x 2 .Ž1 y 5 x .. Ž1. The roots of Ž1 y 2 x 2 .Ž1 y 5 x .Ž1 y x q x 2 . are ␣ 1 s '2 , ␣ 2 s y '2 , ␣ 3 s 5, ␣ 4 s e Ž␲ r3.i, ␣ 5 s e Ž2 ␲ r3.i. Ž2. ␣ 1 , ␣ 3 have the form desired for p s 1, while Ž ␣ 4 . 6 s Ž ␣ 5 . 3 s 1 and Ž ␣ 2 . 2 s 2; so we take p s 6.

140

BARCUCCI ET AL.

Ž3. It now suffices to study separately the sequences Ž f6 nqi . n , i s 0, . . . , 5, whose generating functions are F0 Ž x . s

Ý

f6 n x s

nG0

F1 Ž x . s

Ý

1 q 4583 x y 15000 x 2

n

Ž 1 y 8 x . Ž 1 y x . Ž 1 y 56 x .

f6 nq1 x n s

nG0

F2 Ž x . s

Ý

f6 nq2 x n s

nG0

F3 Ž x . s

Ý

f6 nq3 x n s

nG0

F4 Ž x . s

Ý

f6 nq4 x n s

nG0

F5 Ž x . s

Ý

f6 nq5 x n s

nG0

,

6 q 7286 x y 12500 x 2

Ž 1 y 8 x . Ž 1 y x . Ž 1 y 56 x . 32 q 5176 x

Ž 1 y 8 x . Ž 1 y x . Ž 1 y 56 x . 161 q 10255 x

Ž 1 y 8 x . Ž 1 y x . Ž 1 y 56 x . 808 q 4400 x

Ž 1 y 8 x . Ž 1 y x . Ž 1 y 56 x . 4042 y 9250 x

Ž 1 y 8 x . Ž 1 y x . Ž 1 y 56 x .

, , , , .

The roots of the functions F0 Ž x ., . . . , F5 Ž x . now have the desired form. 3. For simplicity’s sake, let us assume we are working with the generic series F Ž x . s Ý nG 0 Fn x n s Ž aX0 q aX1 x q ⭈⭈⭈ qaXl x l .rŽ1 y bX1 x X y ⭈⭈⭈ ybm x m ., having roots of the desired form. Now the roots of F Ž x . are p among ␣ 1 , . . . , ␣ kp. Then a unique root of maximal modulus must be real and positive. Now Soittola’s Theorem ensures that F Ž x . is ⺞-rational if and only if the following two conditions hold: Ž1. F Ž x . has a positive dominating root; Ž2. all F Ž x . coefficients are non-negative. 4. We assume F Ž x . has a positive dominating root ␣ ) 0, ␣ ) max< ␣ i <4 . It is therefore possible to establish if the coefficients Fn are all nonnegative. For n sufficiently large, we have Fn s P Ž n . ␣ n q

Ý Pi Ž n . ␣ in . i

Let u s deg P y 1 and u i s deg Pi y 1, for all i, u 0 s max u i 4 , and a, b be rational numbers such that ␣ ) a ) b ) < ␣ i < for all i. By standard techniques we can find a positive rational number A 0 smaller than the leading coefficient A of P and a rational number C G max moduli of coefficients of Pi 4 . Since Fn ª A 0 n u␣ n as n ª ⬁, it follows that

␹ Ž n. s

Ý i Pi Ž n . ␣ in A 0 n u␣ n

ª 0;

RATIONAL FUNCTIONS AND COMBINATORICS

141

that is, for all ⑀ ) 0, N exists such that for all n ) N, ␹ Ž n. - ⑀ . Since iu 0 Cn u 0 b nrA 0 n ua n ) ␹ Ž n., iu 0 Cn u 0 b n A 0 n ua n

- ⑀ ª ␹ Ž n. - ⑀ .

We thus get a inequality ␦ n ␳␴ n - ⑀ , where ␴ - 1. By solving this inequality for ⑀ s 1, we find an index nq such that if Fn G 0 for all n F nq, then Fn G 0 for all n g ⺞. The first nq coefficients can be computed by using the recurrence relation Ž1.. EXAMPLE 3.2. The rational function f Ž x . s 1rŽ1 y 3 x q 5 x 2 y 8 x 3 . is ⺞-rational. Indeed, x 3 y 3 x 2 q 5 x y 8 has three roots, ␣ 1 f 2, 32, ␣ 2 f 0, 33 q 1, 82 i and ␣ 3 f 0, 33 y 1, 82 i, and ␣ 1 is the dominating root. By some simple calculations, we find that nqs 3 works: since f 0 s 1, f 1 s 3, f 2 s 4, f 3 s 5, we can conclude that f n ) 0 for all n. The following theorem states that the generating functions of regular languages are the ⺞-rational functions whose first coefficient is 0 or 1. Therefore, we have a criterion for establishing if there is a u.r.e. corresponding to a ⺪-rational series. THEOREM 3.1.

f Ž x . g R if and only if f Ž x . is ⺞-rational and f Ž0. g  0, 14 .

Proof. The necessary condition is obvious. To show the other direction it suffices to use induction on the ⺞-rational function f Ž x ., having f Ž0. g  0, 14 . Let us now assume that f Ž x . g R. Our task is to determine an algorithm able to provide an unambiguous regular expression E of star-height at most 2, having f Ž x . as generating function. Algorithm 2 relies on the original proof of Soittola’s Theorem ŽTheorem 2.4. and the proof given by Perrin in w17x, which uses positive matrices. DEFINITION 3.1. Let f Ž x . be a ⺞-rational function, f Ž x . s P Ž x .rQŽ x . s Ž a0 q a1 x q ⭈⭈⭈ qa l x l .rŽ1 y b1 x y ⭈⭈⭈ ybm x m . having roots ␣ 1 ) < ␣ 2 < G ⭈⭈⭈ G < ␣ m <; f Ž x . satisfies the K-condition if there is a positive integer k such that ␣ i - k - ␣ 1 , and G 1 s b1 y k G 0 G 2 s b 2 q b1 k y k 2 G 0 G 3 s b 3 q b 2 k q b1 k 2 y k 3 G 0 .. .. .. .. . . . . Gm s bm q bmy1 k q ⭈⭈⭈ qb1 k my 1 y k m G 0.

142

BARCUCCI ET AL.

The last request is equivalent to asking that Ž1 y Ž1 y b1 x y ⭈⭈⭈ ybm x m .r Ž1 y kx .. g R. ALGORITHM 2. Input: A ⺞-rational function f Ž x . s P Ž x .rQŽ x . s Ž a0 q a1 x q ⭈⭈⭈ qa l x l .r Ž1 y b1 x y ⭈⭈⭈ ybm x m . Žby Algorithm 1, with no loss of generality, we assume that f Ž x . has no roots of the form ␳␰ , with ␳ ) 0 and ␰ a root of unity different from one., such that a0 g  0, 14 . We denote its sequence by Ž f n .. Output: An unambiguous regular expression of star-height at most 2 and having generating function f Ž x .. 1. Compute the smallest integer p such that all the generating functions Fi Ž x . of the subsequences Ž f n pqi . n) 0 , with 0 F i F p y 1, satisfy the K-condition for a certain k. 2. Find an expression for each Fi Ž x . involving rational operators q, ⭈ , ) and polynomials in ⺞w x x, by means of k, determined in step 1. 3. Construct the unambiguous regular expression E having generating function f Ž x .. 1. The proof of the existence of such a p is given in Soittola’s Theorem and it can be used to determine the final expression of f Ž x . in terms of rational operations Žstep 2.. For every i, let Fi Ž x . s Pi Ž x .rQ i Ž x . and Q i Ž x . s Ž1 y G 1 x y ⭈⭈⭈ yGm iy1 x m iy1 .Ž1 y kx . y Gm , x m i , where the Gi are defined in Definition 3.1, and let ␣ i1p , . . . , ␣ ipk i be Fi Ž x .’s roots with ␣ i1p dominating. We find an upper bound for p such that each Fi Ž x . satisfies the K-condition: ᎏFrom Q i Ž x . s 1 y bi , 1 x y ⭈⭈⭈ ybi , m i x m i , bi , j s

Ý

t1-⭈ ⭈ ⭈-t jFm i

Ž y1.

jq1

␣ tp1 ⭈ ⭈⭈⭈ ⭈ ␣ tpj ,

Q i Ž x . s Ž 1 y G 1 x y ⭈⭈⭈ yGm iy1 x m iy1 . Ž 1 y kx . y Gm i x m i , and after defining u j s Ý1 - t 1 - ⭈ ⭈ ⭈- t j F m i ␣ tp1 ⭈ ⭈⭈⭈ ⭈ ␣ tpj , we obtain j

Gj s ␣ 1p k jy1 y k jy2 u1 q ⭈⭈⭈ q Ž y1 . u jy1

ž

y k j q k jy1 u1 y ⭈⭈⭈ q Ž y1 .

jq1

uj.

/ Ž 4.

143

RATIONAL FUNCTIONS AND COMBINATORICS

Equation Ž4. provides the same expression for Gj as in w17, p. 360x. ᎏLet < ␣ < s max 1 - iF k i< ␣ i <4 . Gj kj

G

␣ 1p k

ž

1 y mi

y 1 y mi G

␣ 1p k

ž

1y

<␣ p< k

<␣ p<

y m2i



Ý

ž

mi

<␣ p< k

y ⭈⭈⭈

k2

y ⭈⭈⭈ ym ij

k

ns1

<␣ p<2

/

<␣ p< j kj

n

//



y1y

Ý ns1

ž

mi

<␣ p< k

n

/

.

Ž 5.

In order that Gj be non-negative, it is sufficient to impose Ž5. ) 0: Ý⬁ns 1Ž m i Ž< ␣ p
P1 Ž x . q P2 Ž x . r Ž 1 y kx . 1 y Ž Q1 Ž x . q Q 2 Ž x . r Ž 1 y kx . .

.

Soittola’s Theorem ensures that F Ž x . can be written as F Ž x . s A 0 q A1 x q ⭈⭈⭈ qA uy1 x uy1 q q

1 1 y kx

ž

Au x u 1 y kx

N1 Ž x . q N2 Ž x . r Ž 1 y kx . 1 y Ž G 1 x q G 2 x 2 q ⭈⭈⭈ qGm x m r Ž 1 y kx . .

/

,

where u G max deg O, deg T q 14 and N1 , N2 g ⺞w x x. A 0 , . . . , A u u can be easily computed by means of the well-known recurrence relation Ž1.; N1 and N2 can be determined by some simple operations on polynomials. We set aside the first u terms of the sequence in order to eliminate the initial conditions. 3. Since f Ž x . is a merge of F0 Ž x ., . . . , Fy1Ž x ., by applying step 2 we are able to write f Ž x . in terms of some polynomials in ⺞w x x and rational operations. It should be also remarked that this way of writing the function f Ž x . is not unique. We now define a procedure Exp which works recur-

144

BARCUCCI ET AL.

sively on f Ž x . Žwritten as above., and provides a regular expression on the alphabet ⌺ s  a4 , Exp Ž 1 . s ␭ ,

Exp Ž x . s a,

Exp Ž 0 . s ⭋

Exp Ž f Ž x . q g Ž x . . s Exp Ž f Ž x . . k Exp Ž g Ž x . . Exp Ž f Ž x . ⭈ g Ž x . . s Exp Ž f Ž x . . ⭈ Exp Ž g Ž x . . Exp

ž

1

/

1 y f Ž x.

U

s Ž Exp Ž f Ž x . . . .

E s renŽExpŽ f Ž x ... is an unambiguous regular expression whose generating function is f Ž x .. EXAMPLE 3.3. Find a u.r.e. for f Ž x . s Ž1 y 2 x q 3 x 2 y 3 x 3 .rŽ1 y 3 x q 2 x 2 .. The roots of 1 y 3 x q 2 x 2 s 0 are ␣ 1 s 2 and ␣ 2 s 1. f Ž x . satisfies the K-condition for k s 1. By applying Algorithm 2 step by step, we get f Ž x . s 1 q x q 4 x q 7x q 2

s1qxq

4 x2 1yx

3

q

13 x 4 1yx

q

12 x 5

Ž1 y x. Ž1 y 2 x.

3 x3

Ž1 y x. Ž1 y 2 x.

.

Exp Ž f Ž x . . s ␭ k a k w aa k aa k aa k aa x aU U

k w aaa k aaa k aaa x aU w a k a x . After applying the ren procedure and minimalizing the alphabet ⌺, we get the u.r.e., U

E s ␭ k a k w bb k cc k dd k ee x aU k w bbb k ccc k ddd x eU w a k b x

with the alphabet ⌺ s  a, b, c, d, e4 . Algorithm 2 may often not work so quickly. For instance, consider the following cases: Ži. f Ž x . s 1 yP ŽQx Ž. x . and P Ž x ., Q Ž x . g ⺞w x x, where f Ž x . s P Ž x . w Q Ž x .xU ; Žii. f Ž x . s P Ž x .rŁ i Ž1 y ␣ i x . and ␣ i g ⺞, where f Ž x . has starheight 1. Now we examine the case deg Q s 2, to which Algorithms 1 and 2 can be very easily applied. COROLLARY 3.1. Let f Ž x . s QP ŽŽ xx .. be ⺪-rational and deg Q s 2. Then f Ž x . g R if and only if f n G 0 for all n g ⺞.

RATIONAL FUNCTIONS AND COMBINATORICS

145

Proof. The sufficient condition follows from the fact that if a ⺪-rational series has non-negative coefficients, then it must have a real pole of minimum modulus. Given deg Q s 2, the two roots of Q must be real numbers. COROLLARY 3.2. Let f Ž x . s P Ž x .rŽ1 y ax y bx 2 . g R, and let ␣ 1 , ␣ 2 be the real roots of f Ž x . Ž assume ␣ 1 F ␣ 2 .. We distinguish the following cases: Ž1. if a s 0, then b must be positi¨ e and f Ž x . can be easily expressed in terms of rational operations; Ž2. if a ) 0, then Ž2.1. if b G 0 or ⌬ s 0, then f Ž x . has star height 1; Ž2.2. if b - 0, then f Ž x . satisfies the K-condition for all integers k g ⺞, ␣ 1 F k F ␣ 2 ; f Ž x . has star-height 2 if and only if its roots are not integers; Ž3. if a - 0, then f Ž x . f R. Proof. Parts Ž1., Ž2.1., and Ž3. are obvious since f n G 0 for all n g ⺞. In case Ž2.2. we have f Ž x . s P Ž x .rŽ1 y ax q bx 2 . with a, b ) 0. Therefore f Ž x . has two distinct positive real roots Žbecause a s ␣ 1 q ␣ 2 and b s ␣ 1 ␣ 2 .; ␣ 2 y ␣ 1 s ⌬ G 1, so there is at least one positive integer k such that ␣ 1 F k F ␣ 2 . We prove that f Ž x . satisfies the K-condition for k. That is, aykG0 ak y b y k 2 G 0. Clearly a G k. The second condition is equivalent to Ž ak y k 2 .rb G 1. Let O 1 , O 2 be positive numbers, such that ␣ 1 s k y O 1 , ␣ 2 s k q O 2 . Then

½

ak y k 2

s1q

O 1O 2

) 1. b b If the roots are not integers, then f Ž x . has star-height 2, because it has a real dominating root and its roots ␣ 1 , ␣ 2 are not Handelmann numbers w4x. EXAMPLE 3.4. Let f Ž x . s 1rŽ1 y 6 x q 6 x 2 . g R. The roots of x 2 y 6 x q 6 are ␣ 1 s 3 y '3 and ␣ 2 s 3 q '3 ; the integers between the two roots are 2, 3, 4, so we can use k s 2, 3, 4. Corollary 3.2 establishes that f Ž x . can be written as f Ž x. s s

1r Ž 1 y 2 x . 1 y Ž 3 x q xr Ž 1 y 2 x . .

s

1r Ž 1 y 4 x . 1 y Ž 2 x q 2 x 2r Ž 1 y 4 x . .

.

1r Ž 1 y 3 x . 1 y Ž 2 x q xr Ž 1 y 3 x . .

146

BARCUCCI ET AL.

Finally, we take a harder example into consideration. EXAMPLE 3.5. Let f Ž x . s 1rŽ1 y 3 x q 5 x 2 y 8 x 3 .. It is easy to verify that, for p s 1 and p s 2, there is no k satisfying the K-condition; for p s 3, the generating functions of the sequences f 0 Ž x ., f 1Ž x ., f 2 Ž x . are f0 Ž x . s

1 y x q 64 x 2

Ý f3n x n s

1 y 6 x y 43 x 2 y 512 x 3

n

f 1Ž x . s

3qx 1 y 6 x y 43 x y 512 x 2

3

,

f2 Ž x . s

,

4qx 1 y 6 x y 43 x 2 y 512 x 3

.

In order to establish that there is a k g ⺞ satisfying the K-condition, we only have to examine f 0 Ž x . Ž f 1Ž x . and f 2 Ž x . have the same denominator., and find out that f Ž x . has star-height equal to 1, f Ž x . s f 0 Ž x 3 . q xf Ž x 3 . q x 2 f Ž x 3 . s1q

3 x q 4 x 2 q 5 x 3 q x 4 q 40 x 5 q 107x 6 q 512 x 9 1 y Ž 6 x 3 q 43 x 6 q 512 x 9 .

.

4. THE APPLICATION OF THIS METHOD TO THE ENUMERATION OF RECURRENCES By applying Algorithm 2, we answer some questions regarding the enumeration of combinatorial objects. 4.1. Regular Languages and Recurrence Relations It is common knowledge that every regular language is enumerated by a linear recurrence relation whose first term is 0 or 1; thanks to our algorithms we are now able to invert this statement when it is possible. This means that we can solve the problem of giving a combinatorial interpretation of a linear recurrence relation with integer coefficients, in almost all cases. This can be done as follows. Let Ž f n . be a sequence of positive integer numbers Ž f 0 s 0, 1. described by a linear recurrence; Ž1. determine the generating function f Ž x . s Ý nG 0 f n x n of the sequence by standard methods; Ž2. by means of Algorithm 1, state if f Ž x . is ⺞-rational; Ž3. if f Ž x . is ⺞-rational, apply Algorithm 2 to f Ž x . and find a regular language enumerated by Ž f n . Ža combinatorial interpretation .; otherwise, there is no regular language enumerated by the sequence Ž f n ..

RATIONAL FUNCTIONS AND COMBINATORICS

147

EXAMPLE 4.1. Let Ž f n . s 0, 1, 2, 4, 9, 21, 49, . . . be the sequence described by the recurrence relation

½

f 0 s 0, f 1 s 1, f2 s 2 f n s 3 f ny1 y 2 f ny2 q f ny3 .

The generating function of the sequence Ž f n . is f Ž x . s Ž x y x 2 .rŽ1 y 3 x q 2 x 2 y x 3 .. Algorithm 1 establishes that f Ž x . is ⺞-rational. By means of Algorithm 2, we find an unambiguous regular expression enumerated by Ž f n .. We write f Ž x . as x ⭈ Ž1rŽ1 y Ž2 x q x 3rŽ1 y x .... and build E on the alphabet ⌺ s  a, b, c4 : E s aŽ a k b k caccU .U . The following example shows how our reverse technology can be applied to the already mentioned problem raised by Propp. EXAMPLE 4.2. In October 1999, Jim Propp posted on the ‘‘domino’’ mailing list, [email protected], the mail ‘‘1, 1, 1, 2, 3, 7, 11, 26, . . . and re¨ erse-engineered combinatorics,’’ with the request for a combinatorial interpretation of the sequence of positive numbers defined by the recurrence relation

½

f 0 s 1, f 1 s 1, f n s 4 f ny2 y f ny4 .

f 2 s 1,

f3 s 2

In particular he asked: ‘‘Is there a technology for reverse-engineering a combinatorial problem from a rational generating function?’’ Our way to approach the problem easily answers these two questions. Indeed we calculate the generating function for Ž f n ., f Ž x. s

1 q x y 3 x2 y 2 x3 1 y 4 x2 q x4

.

By means of our method we easily see that f Ž x . g R, so there is a rational language having f Ž x . as its generating function. Moreover we can write f Ž x . in terms of rational operations: f Ž x. s

1 q x Ž 1 q x 2r Ž 1 y 3 x 2 . . 1 y x 2 Ž 1 q 2 x 2r Ž 1 y 3 x 2 . .

.

Then we can construct a regular expression E enumerated by the given sequence, U

E s Ž ⑀ k a ⑀ k aaw bb k cc k dd x

on the alphabet ⌺ s  a, b, c, d, e, f 4 .

U U

. Ž cc Ž ⑀ k bb k cc . Ž ee k aa k ff . .

148

BARCUCCI ET AL.

EXAMPLE 4.3. On the bisection of Fibonacci numbers, let us take into consideration the well-known sequence of integer numbers 1, 2, 5, 13, 34, . . . , defined by the recurrence relation,

½

f 0 s 1, f1 s 2 f n s 3 f ny1 y f ny2 ,

having f Ž x . s Ž1 y x .rŽ1 y 3 x q x 2 . as its generating function. The application of the previous methods enables us to write f Ž x . in terms of rational operations and polynomials in ⺞w x x: f Ž x. s

1 1 y Ž x q xr Ž 1 y x . .

.

The corresponding u.r.e. is E s Ž a k bcU .U on the alphabet ⌺ s  a, b, c4 . We also point out that each language having f Ž x . as its generating function must have at least three nonterminal symbols, since f 2 s 5 ) f 12 . Now we take into consideration two classes of objects which are proved to be enumerated by the sequence f n , and in both cases we find an explicit bijection with the words of the language LŽ E ., where LŽ E . is the regular language represented by E. Directed Column-Con¨ ex Polyominoes. A polyomino is a finite-connected union of cells in ⺪ = ⺪ having no cut point; polyominoes are defined up to translations. In the general setting of polyominoes, the qualification of directed column-con¨ ex Žbriefly, dcc . refers to the following characteristics: Ži. they are directed in the sense that they can be built by starting with a single cell Žthe origin. and then by adding new cells on the right or on the top of an existing cell; Žii. every column must be formed by contiguous cells. The area of a dcc-polyomino is the number of its cells. Figure 1 shows the 5 dcc-polyominoes having area 3. In several papers it is proved that the number of dcc-polyominoes having area n q 1 is f n , with n G 0 Žfor example, see w3x.. We prove this statement by establishing a bijection

FIG. 1. The 5 dcc-polyominoes having area 2 and the corresponding words of LŽ E ..

RATIONAL FUNCTIONS AND COMBINATORICS

149

between the dcc-polyominoes of area n q 1 and the words of length n of LŽ E .. To do this, we observe that each dcc-polyomino of area n q 2 can be obtained in a unique way by a dcc-polyomino having area n q 1 by means of the following recursive construction: Ž1. if the first two columns of the polyomino start at the same level, we add a cell under the first column, a cell next to the first column, and a cell above the first column Žsee Fig. 2a.; Ž2. otherwise, we add a cell under the first column and a cell next to the first column Žsee Fig. 2b.. This construction can be translated into a construction on the words of LŽ E .. Let w be a word having length n y 1; a word of length n can be obtained: ᎏby adding a final a, b, or c to w, if w ends by b or c Žthis operation corresponds to the construction of step Ž1. on dcc-polyominoes.; ᎏby adding a final a, or b to w, if w ends by a Žstep Ž2... D Ž2. Polyominoes. The class of D Ž2. polyominoes was studied in w2x. We denote by l s Ž l 1 , . . . , l w . and u s Ž u1 , . . . , u w . the two vectors whose elements l i and u i are the level of the lowest and uppermost cells in the ith column, respectively Žsee Fig. 3.. Let D Ž2. be the class of parallelogram polyominoes satisfying the conditions, u i F l iq2 ,

1 F i F w y 1.

Thus, each element of D Ž2. has no more than two columns of height greater than or equal to 2 starting at the same level.

FIG. 2. The construction for dcc-polyominoes and the corresponding words of LŽ E ..

150

BARCUCCI ET AL.

FIG. 3. A D Ž2. parallelogram polyomino.

The number of D Ž2. polyominoes having semi-perimeter n q 2 is f n . Figure 4 shows that 5-polyominoes of D Ž2. having semiperimeter equal to 4. Each D Ž2. polyomino of semi-perimeter n q 3 can be obtained in a unique way by a D Ž2. polyomino having semi-perimeter n q 2 by means of the following recursive construction: Ž1. if the first two columns of the polyomino start at the same level, we add a cell under the first column, a cell next to the first column, and a row made up of two cells under the first row Žsee Fig. 5a.; this operation corresponds to adding a final a, b, or c to the word w, ending by b or c, corresponding to the polyomino; Ž2. otherwise, we add a cell under the first column and a cell next to the first column Žsee Fig. 5b.; this operation corresponds to adding a final a or b to the corresponding word w, ending by a.

5. OPEN PROBLEMS There are several open problems related to our initial purpose of providing a combinatorial interpretation, in terms of languages, of a given recurrence relation: Ž1. Determine the minimal number of alphabetical symbols for a language enumerated by a rational function f Ž x . g R. It would be useful to improve Algorithm 2 in such a way that, given a rational function f Ž x ., the constructed unambiguous regular expression uses the least number of

FIG. 4.

D Ž2. polyominoes having semi-perimeter 4.

151

RATIONAL FUNCTIONS AND COMBINATORICS

FIG. 5. The construction for D Ž2. polyominoes and the corresponding words of LŽ E ..

terminal symbols as possible. To the authors’ knowledge this can be done only in a few cases. Ž2. Linear recurrences that do not count any regular language. Eilenberg w11x gives an example of a ⺪-rational series with non-negative coefficients, which is not ⺞-rational. Let f n s c 2 n cos 2 Ž n␪ ., where cos ␪ s ac , and 0 - a - c, a, c g ⺞ with ac / 12 . Consider f Ž x . s Ý nG 0 f n x n. By using Euler’s functions, we get

f Ž x. s s

1

ž

1 2 2 i␪

4 1 y xc e

q

1

/ ž

1 2 y2 i ␪

4 1 y xc e

q

1

1

/ ž

2 1 y xc 2

1 q Ž c 2 y 3a2 . x q a2 c 2 x 2 1 y Ž 4 a2 y c 2 . x q c 2 Ž 4 a2 y c 2 . x 2 y c 6 x 3

.

/ Ž 6.

It follows that the poles of f Ž x . are Ž1rc 2 . e 2 i ␪ , Ž1rc 2 . ey2 i ␪ , 1rc 2 , and f n G 0 for all n. The ⺪-rationality of f Ž x . is guaranteed. Berstel’s Theorem states that if e 2 i ␪ is not a root of unity, then f Ž x . is not ⺞-rational; this is so whenever c / 2 a. For example, if ac s 23 in Ž6., then we get

f Ž x. s

1 y 3 x q 36 x 2 1 y 7x q 63 x 2 y 729 x 3

.

Ž 7.

The linear recurrence associated to Ž7. is not enumerated by any regular language. Moreover, it can be proved that no unambiguous context-free language can be enumerated by this recurrence. On the other hand, it is still unknown if a language Žor a class of combinatorial objects. exists which can be enumerated by these recurrences.

152

BARCUCCI ET AL.

Ž3. The in¨ ersion of Schutzenberger methodology for some larger classes ¨ of algebraic functions. This means to provide a combinatorial interpretation of some polynomial recurrence Ž P-recurrences .. Are there classes for which this can be easily done? On the other side, are there classes of algebraic functions for which the inversion problem is undecidable?

ACKNOWLEDGMENT The authors thank C. Reutenauer for helpful suggestions.

REFERENCES 1. E. Barcucci, S. Brunetti, A. Del Lungo, and F. Del Ristoro, A combinatorial interpretation of the recurrence f nq 1 s 6 f n y f ny1 , Discrete Math. 190 Ž1998., 235᎐240. 2. E. Barcucci, S. Brunetti, and F. Del Ristoro, Succession rules and Deco polyominoes, Theoret. Inform. Appl. 34 Ž2000., 1᎐14. 3. E. Barcucci, R. Pinzani, and R. Sprugnoli, Directed column-convex polyominoes by recurrence relations, in ‘‘TAPSOFT’93’’ ŽM.-C. Gaudel and J.-P. Jouannaud, Eds.., LLNCS, Vol. 668, pp. 282᎐298, Springer-Verlag, New YorkrBerlin, 1993. 4. F. Bassino, Star-height of an ⺞-rational series, in ‘‘STACS 96’’ ŽC. Puech and R. Reischuk, Eds.., LLNCS, Vol. 1046, pp. 125᎐135, Springer-Verlag, New YorkrBerlin, 1996. 5. J. Berstel and D. Perrin, ‘‘Theory of Codes,’’ Academic Press, San Diego, 1985. 6. J. Berstel and C. Reutenauer, ‘‘Rational Series and Their Languages,’’ Springer-Verlag, Berlin, 1988. 7. N. Chomsky and M. P. Schutzenberger, The algebraic theory of context-free languages, in ¨ ‘‘Computer Programming and Formal Systems’’ ŽP. Braffort and D. Hirschberg, Eds.., pp. 118᎐161, North-Holland, Amsterdam, 1963. 8. R. Cori and B. Vauquelin, Planar maps are well labeled trees, Canad. J. Math. 33 Ž1981., 1023᎐1042. 9. M. P. Delest and G. Viennot, Algebraic languages and polyominoes enumeration, Theoret. Comput. Sci. 34 Ž1984., 169᎐206. 10. A. van der Poorten, Some facts should better be known; especially about rational functions, in ‘‘Number Theory and Applications’’ ŽR. A. Mollin, Ed.., pp. 497᎐528, Kluwer Academic, Dordrecht, 1989. 11. S. Eilenberg, ‘‘Automa, Languages, and Machines,’’ Vol. A, Academic Press, New York, 1974. 12. X. Gourdon and B. Salvy, Effective asymptotics of linear recurrences with rational coefficients, Discrete Math. 153 Ž1996., 145᎐163. 13. J. E. Hopcroft and J. D. Ullman, ‘‘Introduction to Automata Theory, Languages, and Computation,’’ Addison᎐Wesley, Reading, MA, 1979. 14. D. Krob, ‘‘Elements de combinatoire,’’ Magistere ´ ` 1-ere ` annee, ´ Ecole Normale Superieure, 1995. 15. V. Pan, Algebraic complexity of computing polynomial zeroes, Comput. Math. Appl. Ž1987., 285᎐304.

RATIONAL FUNCTIONS AND COMBINATORICS

153

16. E. Pergola and R. Pinzani, A combinatorial interpretation of the area of Schroder ¨ paths, Electron. J. Combin. 6 Ž1999.. 17. D. Perrin, On positive matrices, Theoret. Comput. Sci. 94 Ž1992., 357᎐366. 18. J. Riordan, ‘‘Combinatorial Identities,’’ Wiley, New York, 1958. 19. A. Salomaa and M. Soittola, ‘‘Automata-Theoretic Aspects of Formal Power Series,’’ Springer-Verlag, New York, 1978. 20. N. J. A. Sloane and S. Plouffe, ‘‘The Encyclopedia of Integer Sequences,’’ Academic Press, San Diego, 1996. 21. M. Soittola, Positive rational sequences, Theoret. Comput. Sci. 2 Ž1976., 317᎐322. 22. R. A. Sulanke, Bijective recurrences concerning Schroder paths, Electron. J. Combin., ¨ http:rrwww.combinatorics.orgrvolume5rv5iltoc.html. 23. J. West, Generating trees and the Catalan and Schroder numbers, Discrete Math. 146 ¨ Ž1995., 247᎐262. 24. D. Zeilberger, Self avoiding walks, the language of science, and Fibonacci numbers, J. Statist. Plann. Inference 54 Ž1996., 135᎐138.