context-free grammar
38 papers tagged with this keyword
Binomial coefficients and multifactorial numbers through generative grammars
In this paper, the formal derivative operator defined with respect to context-free grammars is used to prove some properties about binomial coefficients and multifactorial numbers. In addition, we extend the formal derivative operator to matrix grammars and show that multifactorial numbers can also be generated.
Almost optimal Boolean matrix multiplication [BMM]-by multi-encoding of rows and columns
The Boolean product $R = P \cdot Q$ of two $\{ 0, 1\} \; m \times m \; $ matrices is $$R(j,k) = 1 \; \mathrm{\ IF\ for\ some\ } \; t \; \,P(j, t) = Q(t, k) = 1\; \; \mathrm{ELSE\ } \, R(j, k) = 0. $$ The near-optimal design reduces the complexity of computing $R$ from the standard $m^3$ to $O(m^{(2+e)})$, for arbitrary small $e > 0$, by a practical algorithm. This renders reduced complexity to several graph-property tests: Finding triangles and higher-size cliques; finding all-pairs shortest paths, and more. Also, parsing a string $w$ by a context-free grammar is reduced to near quadratic in $w$-size. The design uses several distinct 2-digit encodings: $j$ by $(j_1, j_2), \; k \, $ by $\, (k_1, k_2)$. Each one gives rise to bunches of short digraphs from sources $j$'s to sinks $k$'s via switching nodes, and walks between them. The combined information, using the Chinese remainder theorem, leads to the correct values of $R(j, k)$.
Gamma-positivity and partial gamma-positivity of descent-type polynomials
Published
• View Publication
• BIB
In this paper, we study gamma-positivity of descent-type polynomials by introducing the change of context-free grammars method. We first present grammatical proofs of the gamma-positivity of the Eulerian polynomials, type B Eulerian polynomials, derangement polynomials, Narayana polynomials and type B Narayana polynomials. We then provide partial gamma-positive expansions for several multivariate polynomials associated to Stirling permutations, Legendre-Stirling permutations, Jacobi-Stirling permutations and type B derangements, and the recurrences for the partial gamma-coefficients of these expansions are also obtained. Moreover, we define variants of the Foata-Strehl group action which are used to give combinatorial interpretations for the coefficients of most of these partial gamma-positive expansions.
The ascent-plateau statistics on Stirling permutations
Published
• View Publication
• BIB
In this paper, several variants of the ascent-plateau statistic are introduced, including flag ascent-plateau, double ascent and descent-plateau. We first study the flag ascent-plateau statistic on Stirling permutations by using context-free grammars. We then present a unified refinement of the ascent polynomials and the ascent-plateau polynomials. In particular, by using Foata and Strehl's group action, we prove two bistatistics over the set of Stirling permutations of order n are equidistributed.
A Context-free Grammar for Peaks and Double Descents of Permutations
Published
• View Publication
• BIB
This paper is concerned with the joint distribution of the number of exterior peaks and the number of proper double descents over permutations on $[n] =\{1,2,\ldots,n\}$. The notion of exterior peaks of a permutation was introduced by Aguiar, Bergeron and Nyman in their study of the peak algebra. Gessel obtained the generating function of the number of permutations on $[n]$ with a given number of exterior peaks. On the other hand, by establishing differential equations, Elizalde and Noy derived the generating function for the number of permutations on $[n]$ with a given number of proper double descents. Barry and Basset independently deduced the generating function of the number of permutations on $[n]$ with no proper double descents. We find a context-free grammar which can be used to compute the number of permutations on $[n]$ with a given number of exterior peaks and a given number of proper double descents. Based on the grammar, the recurrence relation of the number of permutations on $[n]$ with a given number of exterior peaks can be easily obtained. Moreover, we use the grammatical calculus to derive the generating function without solving differential equations. Our formula reduces to the formulas of Gessel, Elizalde-Noy, Barry, and Basset. Finally, from the grammar we establish a relationship between our generating function and the generating function of the joint distribution of the number of peaks and the number of double descent derived by Carlitz and Scoville.
Juxtaposing Catalan permutation classes with monotone ones
Published
• View Publication
• BIB
This paper enumerates all juxtaposition classes of the form "Av($abc$) next to Av($xy$)", where $abc$ is a permutation of length three and $xy$ is a permutation of length two. We use Dyck paths decorated by sequences of points to represent elements from such a juxtaposition class. Context-free grammars are then used to enumerate these decorated Dyck paths.
Context-free grammars for several polynomials associated with Eulerian polynomials
Published
• View Publication
• BIB
In this paper, we present grammatical descriptions of several polynomials associated with Eulerian polynomials, including q-Eulerian polynomials, alternating run polynomials and derangement polynomials. As applications, we get several convolution formulas involving these polynomials.
Colored operads, series on colored operads, and combinatorial generating systems
Published in Discrete Mathematics, 342, Issue 6, 1624--1657, 2019
• View Publication
• BIB
We introduce bud generating systems, which are used for combinatorial generation. They specify sets of various kinds of combinatorial objects, called languages. They can emulate context-free grammars, regular tree grammars, and synchronous grammars, allowing us to work with all these generating systems in a unified way. The theory of bud generating systems uses colored operads. Indeed, an object is generated by a bud generating system if it satisfies a certain equation in a colored operad. To compute the generating series of the languages of bud generating systems, we introduce formal power series on colored operads and several operations on these. Series on colored operads are crucial to express the languages specified by bud generating systems and allow us to enumerate combinatorial objects with respect to some statistics. Some examples of bud generating systems are constructed; in particular to specify some sorts of balanced trees and to obtain recursive formulas enumerating these.
Context-free Grammars for Permutations and Increasing Trees
Published
• View Publication
• BIB
In this paper, we introduce the notion of a grammatical labeling to describe a recursive process of generating combinatorial objects based on a context-free grammar. For example, by labeling the ascents and descents of a Stirling permutation, we obtain a grammar for the second-order Eulerian polynomials. By using the grammar for $0$-$1$-$2$ increasing trees given by Dumont, we obtain a grammatical derivation of the generating function of the André polynomials obtained by Foata and Schützenberger, without solving a differential equation. We also find a grammar for the number $T(n,k)$ of permutations of $[n]=\{1,2,\ldots, n\}$ with $k$ exterior peaks, which was independently discovered by Ma. We demonstrate that Gessel's formula for the generating function of $T(n,k)$ can be deduced from this grammar. Moreover, by using grammars we show that the number of the permutations of $[n]$ with $k$ exterior peaks equals the number of increasing trees on $[n]$ with $2k+1$ vertices of even degree. A combinatorial proof of this fact is also presented.
Zigzag Stacks and m-Regular Linear Stacks
Published
• View Publication
• BIB
The contact map of a protein fold is a graph that represents the patterns of contacts in the fold. It is known that the contact map can be decomposed into stacks and queues. RNA secondary structures are special stacks in which the degree of each vertex is at most one and each arc has length at least two. Waterman and Smith derived a formula for the number of RNA secondary structures of length $n$ with exactly $k$ arcs. Höner zu Siederdissen et al. developed a folding algorithm for extended RNA secondary structures in which each vertex has maximum degree two. An equation for the generating function of extended RNA secondary structures was obtained by Müller and Nebel by using a context-free grammar approach, which leads to an asymptotic formula. In this paper, we consider $m$-regular linear stacks, where each arc has length at least $m$ and the degree of each vertex is bounded by two. Extended RNA secondary structures are exactly $2$-regular linear stacks. For any $m\geq 2$, we obtain an equation for the generating function of the $m$-regular linear stacks. For given $m$, we can deduce a recurrence relation and an asymptotic formula for the number of $m$-regular linear stacks on $n$ vertices. To establish the equation, we use the reduction operation of Chen, Deng and Du to transform an $m$-regular linear stack to an $m$-reduced zigzag (or alternating) stack. Then we find an equation for $m$-reduced zigzag stacks leading to an equation for $m$-regular linear stacks.
Some combinatorial arrays related to the Lotka-Volterra system
Published
• View Publication
• BIB
The purpose of this paper is to investigate the connection between the Lotka-Volterra system and combinatorics. We study several context-free grammars associated with the Lotka-Volterra system. Some combinatorial arrays, involving the Stirling numbers of the second kind and Eulerian numbers, are generated by these context-free grammars. In particular, we present grammatical characterization of some statistics on cyclically ordered partitions.
Normal ordering problem and the extensions of the Stirling grammar
Published
• View Publication
• BIB
The purpose of this paper is to investigate the connection between context-free grammars and normal ordering problem, and then to explore various extensions of the Stirling grammar. We present grammatical characterizations of several well known combinatorial sequences, including the generalized Stirling numbers of the second kind related to the normal ordering problem and the $r$-Dowling polynomials. Also, possible avenues for future research are described.
Bessel polynomials, double factorials and context-free grammars
The purpose of this paper is to show that Bessel polynomials, double factorials and Catalan triangle can be generated by using context-free grammars.
Some combinatorial sequences associated with context-free grammars
The purpose of this paper is to show that some combinatorial sequences, such as second-order Eulerian numbers and Eulerian numbers of type $B$, can be generated by context-free grammars.
Context-free Grammars and Multivariate Stable Polynomials over Stirling Permutations
Published
• View Publication
• BIB
Recently, Haglund and Visontai established the stability of the multivariate Eulerian polynomials as the generating polynomials of the Stirling permutations, which serves as a unification of some results of Bóna, Brenti, Janson, Kuba, and Panholzer concerning Stirling permutations. Let $B_n(x)$ be the generating polynomials of the descent statistic over Legendre-Stirling permutations, and let $T_n(x)=2^nC_n(x/2)$, where $C_n(x)$ are the second-order Eulerian polynomials. Haglund and Visontai proposed the problems of finding multivariate stable refinements of the polynomials $B_n(x)$ and $T_n(x)$. We obtain context-free grammars leading to multivariate stable refinements of the polynomials $B_n(x)$ and $T_n(x)$. Moreover, the grammars enable us to obtain combinatorial interpretations of the multivariate polynomials in terms of Legendre-Stirling permutations and marked Stirling permutations. Such stable multivariate polynomials provide solutions to two problems posed by Haglund and Visontai.
Enumerating regular expressions and their languages
Published
• View Publication
• BIB
In this chapter we discuss the problem of enumerating distinct regular expressions by size and the regular languages they represent. We discuss various notions of the size of a regular expression that appear in the literature and their advantages and disadvantages. We consider a formal definition of regular expressions using a context-free grammar.
We then show how to enumerate strings generated by an unambiguous context-free grammar using the Chomsky-Schützenberger theorem. This theorem allows one to construct an algebraic equation whose power series expansion provides the enumeration. Classical tools from complex analysis, such as singularity analysis, can then be used to determine the asymptotic behavior of the enumeration.
We use these algebraic and analytic methods to obtain asymptotic estimates on the number of regular expressions of size n. A single regular language can often be described by several regular expressions, and we estimate the number of distinct languages denoted by regular expressions of size n. We also give asymptotic estimates for these quantities. For the first few values, we provide exact enumeration results.
Asymptotic distribution of motifs in a stochastic context-free grammar model of RNA folding
We analyze the distribution of RNA secondary structures given by the Knudsen-Hein stochastic context-free grammar used in the prediction program Pfold. We prove that the distribution of base pairs, helices and various types of loops in RNA secondary structures in this probabilistic model is asymptotically Gaussian, for a generic choice of the grammar probabilities. Our proofs are based on singularity analysis of probability generating functions. Finally, we use our results to discuss how this model reflects the properties of some known ribosomal secondary structures.
Topology of RNA-RNA interaction structures
Published
• View Publication
• BIB
The topological filtration of interacting RNA complexes is studied and the role is analyzed of certain diagrams called irreducible shadows, which form suitable building blocks for more general structures. We prove that for two interacting RNAs, called interaction structures, there exist for fixed genus only finitely many irreducible shadows. This implies that for fixed genus there are only finitely many classes of interaction structures. In particular the simplest case of genus zero already provides the formalism for certain types of structures that occur in nature and are not covered by other filtrations. This case of genus zero interaction structures is already of practical interest, is studied here in detail and found to be expressed by a multiple context-free grammar extending the usual one for RNA secondary structures. We show that in $O(n^6)$ time and $O(n^4)$ space complexity, this grammar for genus zero interaction structures provides not only minimum free energy solutions but also the complete partition function and base pairing probabilities.