Pattern Frequency Sequences and Internal Zeros

Similar documents
Problem set 6 The Perron Frobenius theorem.

K a,k minors in graphs of bounded tree-width *

Separation of Variables and a Spherical Shell with Surface Charge

CS229 Lecture notes. Andrew Ng

#A48 INTEGERS 12 (2012) ON A COMBINATORIAL CONJECTURE OF TU AND DENG

On colorings of the Boolean lattice avoiding a rainbow copy of a poset arxiv: v1 [math.co] 21 Dec 2018

The ordered set of principal congruences of a countable lattice

arxiv: v1 [math.co] 17 Dec 2018

A Brief Introduction to Markov Chains and Hidden Markov Models

(f) is called a nearly holomorphic modular form of weight k + 2r as in [5].

Partial permutation decoding for MacDonald codes

FOURIER SERIES ON ANY INTERVAL

Homogeneity properties of subadditive functions

NOISE-INDUCED STABILIZATION OF STOCHASTIC DIFFERENTIAL EQUATIONS

MONOCHROMATIC LOOSE PATHS IN MULTICOLORED k-uniform CLIQUES

Cryptanalysis of PKP: A New Approach

Approximated MLC shape matrix decomposition with interleaf collision constraint

XSAT of linear CNF formulas

arxiv: v1 [math.co] 12 May 2013

A NOTE ON QUASI-STATIONARY DISTRIBUTIONS OF BIRTH-DEATH PROCESSES AND THE SIS LOGISTIC EPIDEMIC

A CLUSTERING LAW FOR SOME DISCRETE ORDER STATISTICS

Homework 5 Solutions

Generalized Bell polynomials and the combinatorics of Poisson central moments

Lecture Note 3: Stationary Iterative Methods

Approximated MLC shape matrix decomposition with interleaf collision constraint

Mat 1501 lecture notes, penultimate installment

THE THREE POINT STEINER PROBLEM ON THE FLAT TORUS: THE MINIMAL LUNE CASE

MARKOV CHAINS AND MARKOV DECISION THEORY. Contents

ORTHOGONAL MULTI-WAVELETS FROM MATRIX FACTORIZATION

Pricing Multiple Products with the Multinomial Logit and Nested Logit Models: Concavity and Implications

Reichenbachian Common Cause Systems

Small generators of function fields

Some Measures for Asymmetry of Distributions

An explicit Jordan Decomposition of Companion matrices

THE REACHABILITY CONES OF ESSENTIALLY NONNEGATIVE MATRICES

are left and right inverses of b, respectively, then: (b b 1 and b 1 = b 1 b 1 id T = b 1 b) b 1 so they are the same! r ) = (b 1 r = id S b 1 r = b 1

LECTURE NOTES 9 TRACELESS SYMMETRIC TENSOR APPROACH TO LEGENDRE POLYNOMIALS AND SPHERICAL HARMONICS

FRIEZE GROUPS IN R 2

Research Article On the Lower Bound for the Number of Real Roots of a Random Algebraic Equation

Restricted weak type on maximal linear and multilinear integral maps.

The Group Structure on a Smooth Tropical Cubic

Supplementary Appendix (not for publication) for: The Value of Network Information

Akaike Information Criterion for ANOVA Model with a Simple Order Restriction

Week 6 Lectures, Math 6451, Tanveer

CONGRUENCES. 1. History

Uniprocessor Feasibility of Sporadic Tasks with Constrained Deadlines is Strongly conp-complete

T.C. Banwell, S. Galli. {bct, Telcordia Technologies, Inc., 445 South Street, Morristown, NJ 07960, USA

Co-degree density of hypergraphs

Rate-Distortion Theory of Finite Point Processes

Stat 155 Game theory, Yuval Peres Fall Lectures 4,5,6

A UNIVERSAL METRIC FOR THE CANONICAL BUNDLE OF A HOLOMORPHIC FAMILY OF PROJECTIVE ALGEBRAIC MANIFOLDS

Algorithms to solve massively under-defined systems of multivariate quadratic equations

arxiv: v1 [math.fa] 23 Aug 2018

$, (2.1) n="# #. (2.2)

C. Fourier Sine Series Overview

Manipulation in Financial Markets and the Implications for Debt Financing

u(x) s.t. px w x 0 Denote the solution to this problem by ˆx(p, x). In order to obtain ˆx we may simply solve the standard problem max x 0

Families of Singular and Subsingular Vectors of the Topological N=2 Superconformal Algebra

Schedulability Analysis of Deferrable Scheduling Algorithms for Maintaining Real-Time Data Freshness

TAMENESS AND FRAMES REVISITED. Contents

B. Brown, M. Griebel, F.Y. Kuo and I.H. Sloan

PHYS 110B - HW #1 Fall 2005, Solutions by David Pace Equations referenced as Eq. # are from Griffiths Problem statements are paraphrased

The Partition Function and Ramanujan Congruences

Investigation on spectrum of the adjacency matrix and Laplacian matrix of graph G l

Gauss Law. 2. Gauss s Law: connects charge and field 3. Applications of Gauss s Law

Biometrics Unit, 337 Warren Hall Cornell University, Ithaca, NY and. B. L. Raktoe

MATH 172: MOTIVATION FOR FOURIER SERIES: SEPARATION OF VARIABLES

More Scattering: the Partial Wave Expansion

Monomial Hopf algebras over fields of positive characteristic

Global Optimality Principles for Polynomial Optimization Problems over Box or Bivalent Constraints by Separable Polynomial Approximations

VI.G Exact free energy of the Square Lattice Ising model

Assignment 7 Due Tuessday, March 29, 2016

Iterative Decoding Performance Bounds for LDPC Codes on Noisy Channels

Efficiently Generating Random Bits from Finite State Markov Chains

HAMILTON DECOMPOSITIONS OF ONE-ENDED CAYLEY GRAPHS

MIXING AUTOMORPHISMS OF COMPACT GROUPS AND A THEOREM OF SCHLICKEWEI

PREPUBLICACIONES DEL DEPARTAMENTO DE ÁLGEBRA DE LA UNIVERSIDAD DE SEVILLA

STABLE GRAPHS BENJAMIN OYE

Convergence Property of the Iri-Imai Algorithm for Some Smooth Convex Programming Problems

Coupling of LWR and phase transition models at boundary

are left and right inverses of b, respectively, then: (b b 1 and b 1 = b 1 b 1 id T = b 1 b) b 1 so they are the same! r ) = (b 1 r = id S b 1 r = b 1

PSEUDO-SPLINES, WAVELETS AND FRAMELETS

How many random edges make a dense hypergraph non-2-colorable?

Explicit overall risk minimization transductive bound

Schedulability Analysis of Deferrable Scheduling Algorithms for Maintaining Real-Time Data Freshness

8 Digifl'.11 Cth:uits and devices

SEMINAR 2. PENDULUMS. V = mgl cos θ. (2) L = T V = 1 2 ml2 θ2 + mgl cos θ, (3) d dt ml2 θ2 + mgl sin θ = 0, (4) θ + g l

The EM Algorithm applied to determining new limit points of Mahler measures

Rapporto di Ricerca CS P. Baldan, A. Corradini, H. Ehrig, R. Heckel, B. König

6 Wave Equation on an Interval: Separation of Variables

Lecture 17 - The Secrets we have Swept Under the Rug

Transcendence of stammering continued fractions. Yann BUGEAUD

Maximal Independent Sets In Graphs With At Most r Cycles

On the Goal Value of a Boolean Function

Discrete Techniques. Chapter Introduction

Math 124B January 31, 2012

On Non-Optimally Expanding Sets in Grassmann Graphs

Efficient Generation of Random Bits from Finite State Markov Chains

Continued fractions with low complexity: Transcendence measures and quadratic approximation. Yann BUGEAUD

(1 ) = 1 for some 2 (0; 1); (1 + ) = 0 for some > 0:

Transcription:

Advances in Appied Mathematics 28, 395 420 (2002 doi:10.1006/aama.2001.0789, avaiabe onine at http://www.ideaibrary.com on Pattern Frequency Sequences and Interna Zeros Mikós Bóna Department of Mathematics, University of Forida, Gainesvie, Forida 32611 E-mai: bona@math.uf.edu Bruce E. Sagan Department of Mathematics, Michigan State University, East Lansing, Michigan 48824 E-mai: sagan@math.msu.edu and Vincent R. Vatter Department of Mathematics, Rutgers University, Piscataway, New Jersey 08854 E-mai: vatter@math.rutgers.edu Received March 1, 2001; accepted Apri 30, 2001; pubished onine March 20, 2002 dedicated to the memory of rodica simion, who did some semina work in the area of pattern avoidance Let q be a pattern and et S n q c be the number of n-permutations having exacty c copies of q. We investigate when the sequence S n q c c 0 has interna zeros. If q is a monotone pattern it turns out that, except for q = 12 or 21, the nontrivia sequences (those where n is at east the ength of q aways have interna zeros. For the pattern q = 1 + 12 there are infinitey many sequences which contain interna zeros and when = 2 there are aso infinitey many which do not. In the atter case, the ony possibe paces for interna zeros are the next-to-ast or the second-to-ast positions. Note that by symmetry this competey determines the existence of interna zeros for a patterns of ength at most 3. 2002 Esevier Science (USA 395 0196-8858/02 $35.00 2002 Esevier Science (USA A rights reserved.

396 bóna, sagan, and vatter 1. INTRODUCTION Let q = q 1 q 2 q be a permutation in the symmetric group S. We ca the ength of q. We say that the permutation p = p 1 p 2 p n S n contains a q-pattern if and ony if there is a subsequence p i1 p i2 p i of p whose eements are in the same reative order as those in q; i.e., p ij <p ik if and ony if q j <q k whenever 1 j k. For exampe, 41523 contains exacty two 132 patterns, namey 152 and 153. We et c q p =the number of copies of q in p so that c 132 41523 = 2. Permutations containing a given number of q-patterns have been extensivey studied recenty [1 11]. In this paper, we consider permutations with a given number of q-patterns from a new ange. Let S n q c =the number of n-permutations with exacty c patterns of type q For n and q fixed, the sequence S n q c c 0 is caed the frequency sequence of the pattern q for n. Ceary this sequence consists entirey of zeros if n is ess than the ength of q and so we ca these sequences trivia and a others nontrivia. We aso say that an n-permutation p is q-optima if there is no n-permutation with more copies of q than p, and et M n q = c q p for an optima p The ony q for which the frequency sequence is we understood is q = 21 (or equivaenty q = 12. Occurences of this pattern are caed inversions. It is we known [12] that for a n, the frequency sequence of inversions is og-concave, and so is unimoda and has no interna zeros. An integer c is caed an interna zero of the sequence S n q c c 0 if for some c we have S n q c =0, but there exist c 1 and c 2 with c 1 <c<c 2 and S n q c 1, S n q c 2 0. When q has ength greater than 2, numerica evidence suggests that the frequency sequence of q wi no onger be unimoda, et aone og-concave. In fact, interna zeros seem to be present in most frequency sequences. In the rest of this paper we study the frequency sequences of the monotone pattern q = 12 and the pattern q = 1 + 12. We wi show that in the first case, when 3 (the case = 2 has aready been mentioned the nontrivia sequences aways have interna zeros. For 1 + 12-patterns there are infinitey many n where the sequence has interna zeros. For the 132 pattern there are aso infinitey many n where the sequence has no interna zeros. Furthermore, interna zeros can ony appear in positions M n 132 1orM n 132 2.

pattern frequency sequences 397 2. THE MONOTONE CASE We wi now consider the sequence S n q c c 0, where q = 12.For ater reference, we singe out the known case when = 2 discussed in the Introduction. Proposition 2.1. The sequence S n 12 c c 0 has no interna zeros (and is, in fact, og concave. The unique optima permutation is p = 12 n with ( n M n 12 = 2 It turns out that this is the ony monotone pattern (aside from 21 whose sequence has no interna zeros. To prove this resut, define an inversion (respectivey, noninversion inp = p 1 p 2 p n to be a pair p i p j such that i<jand p i >p j (respectivey, p i <p j. Theorem 2.2. Let q = 12, where 3. Then in S n, the unique optima permutation is p = 12 n and ( n M n 12 = The set of permutations having the next greatest number of copies of q are those obtained from p by an adjacent transposition and this number of copies is ( ( n 1 n 2 + (1 1 Proof. Consider any r S n different from p. Then r has an inversion r i r j. So the number of copies of q in r is the number not containing r i pus the number which do contain r i. The permutations in the atter case cannot contain r j. So (1 gives an upper bound for the number of copies of q, which is strict uness r has exacty one inversion. The theorem foows. Coroary 2.3. Let q = 12, where 3. Then for n the sequence S n 12 c c 0 has interna zeros. Proof. From the previous theorem, we see that the number of zeros directy before S n q M n q =1is ( ( ( ( n n 1 n 2 n 2 = n 2 1 1 2 since n 3. For use in the 132 case, we record the foowing observation. Lemma 2.4. For any integer c with 0 c ( n 2 there is a permutation p S n having c copies of the pattern 21 and no copies of 132.

398 bóna, sagan, and vatter Proof. We induct on n. The resut is ceary true if n 2. Assuming it is true for n 1, first consider c ( n 1 2 and et p Sn 1 satisfy the emma. ( Then the concatenation pn S n works for such c. On the other hand, if n 1 ( <c n 2 then consider c = c n 1 ( n 1. Pick p Sn 1 with c 2 copies of 21 and none of 132. Then np S n is the desired permutation. 2 3. THE CASE q = 1 + 12 AND LAYERED PATTERNS The rest of this paper is devoted to the study of the frequency sequences of the patterns 1 + 12 for 2. To simpify notation, write F n 1+12 for the sequence S n 1+12 c c 0. One crucia property of these patterns is that they are ayered. This section gives an overview of some important resuts on ayered patterns. A pattern is ayered if it is the concatenation of subwords (the ayers, where the entries decrease within each ayer and increase between the ayers. For exampe, 3 2 1548769 is a ayered pattern with ayers 321 54 87 6, and 9. Layered patterns are examined in Stromquist s work [14] and in Price s thesis [9]. The most important resut for our current purposes is the foowing theorem. Theorem 3.1 [14]. Let q be a ayered pattern. Then the set of q-optima n-permutations contains at east one ayered permutation. Layered 1 + 12-optima permutations have a simpe recursive structure. This comes from the fact, which we wi use many times, that to form a 1 + 12 pattern in a ayered permutation one must take a singe eement from some ayer and eements from a subsequent ayer. Proposition 3.2. Let p be a ayered 1 + 12-optima n-permutation whose ast ayer is of ength m. Then the eftmost k = n m eements of p form a 1 + 12-optima k-permutation. Proof. Let D k be the number of 1 + 12-copies of p that are disjoint from the ast ayer. The number of 1 + 12-copies of p is ceary k ( m + Dk So once k is chosen, p wi have the maximum number of copies ony if D k is maxima. We point out that the proof of this proposition uses the fact that 1 + 12 has ony two ayers, the first of which is a singeton. Let M n = M n 1+12. Then the previous proposition impies that ( M n = max M k + k 1 k<n ( m (2

pattern frequency sequences 399 The integer k for which the right-hand side attains its maximum wi pay a crucia roe throughout this paper. Therefore, we introduce specific notation for it. Definition 3.3. For any positive integer n, et k n = k n 1+12 be the positive integer for which M n = max k M k + k ( m is maxima. If there are severa integers with this property, then et k n be the argest among them. In other words, k n is the argest possibe ength of the remaining permutation after the ast ayer of a 1 + 12-optima n-permutation p is removed. When there is no danger of confusion, we wi ony write k to simpify notation. We wi aso aways use m = n k to denote the ength of the ast ayer of p. 4. CONSTRUCTION OF PERMUTATIONS WITH A GIVEN NUMBER OF COPIES OF q = 132 We wi first show that if q = 132 then there are infinitey many integers n such that F n does not have interna zeros. We wi ca such an integer, or its corresponding sequence, no interna zero (NIZ, and otherwise IZ. Our strategy is recursive: We wi show that if k n is NIZ, then so is n. Ask n <n, this wi ead to an infinite sequence of NIZ integers. There is a probem, however. For this strategy to work, we must ensure that given k, there is an n such that k = k n. This is the purpose of the foowing theorem, which is in fact true for the genera pattern q = 1 + 12. Theorem 4.1. For k n = k n 1+12, the sequence k n n 1 diverges to infinity and satisfies k n k n+1 k n + 1 for a n + 1. So, since k +1 = 1, for a positive integers k there is a positive integer n so that k n = k. The next section is devoted to a proof of this theorem. We suggest that the reader assume the resut now and continue with this section to preserve continuity. We now consider the case q = 132, which behaves differenty from q = 1 + 12 for 3. This is essentiay due to the difference between the patterns q = 12 and q = 12 for 3 as seen in Proposition 2.1 and Theorem 2.2. First we note the usefu fact that ( k 1 M k 132 (3 2 which foows by considering the permutation 1kk 1k 2 32. Theorem 4.2. For q = 132 There are infinitey many NIZ integers.

400 bóna, sagan, and vatter Proof. It is easy to verify that n = 4 is NIZ. So, by Theorem 4.1, it suffices to show that if k n 4 is NIZ then so is n. To simpify notation in the two proofs which foow, we wi write k for k n 132, M n for M n 132, and so forth. Now given c with 0 c M n = M k + k ( m 2 we wi construct a permutation p S n having c copies of 132. Because of (3 and k 4 we have M k k 1. So it is possibe to write c (not necessariy uniquey as c = ks + t with 0 s ( m 2 and 0 t Mk. Since k is NIZ, there is a permutation p S k with c 132 p =t. Aso, by Lemma 2.4, there is a permutation in S m with no copies of 132 and s copies of 21. Let p be the resut of adding k to every eement of that permutation. Then, by construction, p = p p S n and c 132 p =ks + t = c as desired. One can modify the proof of the previous theorem to ocate precisey where the interna zeros coud be for an IZ sequence. We wi need the fact (estabished by computer that for n 12 the ony IZ integers are 6, 8, and 9, and that they a satisfied the foowing resut. Theorem 4.3. For any positive integer n, the sequence F n 132 does not have interna zeros, except possiby for c = M n 132 1 or c = M n 132 2, but not both. Proof. We prove this theorem by induction on n. As previousy remarked, it is true if n 12. Now suppose we know the statement for a integers smaer than n, and prove it for n. Ifnis NIZ, then we are done. If n is IZ then, by the proof of Theorem 4.2, k = k n is IZ. So k 6 and we have M k k + 2 by (3. Now take c with 0 c M n 3 so that we can write c = ks + t with 0 s ( m 2 and 0 t Mk 3. Since the portion of F k up to S k M k 3 has no interna zeros by induction, we can use the same technique as in the previous theorem to construct a permutation p with c 132 p =c for c in the given range. Furthermore, this construction shows that if S k M k i 0 for i = 1 or 2 then S n M n i 0. This competes the proof. 5. THE SEQUENCE k n n +1 FOR q = 1 + 12 For the rest of this paper, a invariants wi refer to the pattern q = 1 + 12 2, uness expicity stated otherwise. To prove Theorem 4.1, we first need a emma about the engths of various parts of a ayered 1 + 12-optima permutation p. In a that foows, we use the notation b = the ength of the penutimate ayer of p

pattern frequency sequences 401 a = the ength of the permutation gotten by removing the ast two ayers of p = n m b = k b Aso observe that the sequence M n n +1 is stricty increasing. This is because when n + 1, any ayered 1 + 12-optima permutation p S n contains at east one copy of 1 + 12. So inserting n + 1in front of any ayer contributing to the + 12 portion of some copy resuts in a permutation with more 1 + 12-patterns than p. It foows from (2 that m for n + 1, a fact that wi be usefu in proving the foowing resut. Lemma 5.1. Let q = 1 + 12, k = k n q, and n + 1. Then we have the foowing inequaities (i b m, (ii (iii (iv a m + 1/, k < n/, so in particuar k<m, m n + 1/ + 1. Proof. The basic idea behind a four of the inequaities is as foows. Let p be the permutation obtained from our 1 + 12-optima permutation p by repacing its ast two ayers with a ast ayer of ength m and a next-to-ast ayer of ength b. Then in passing from p to p we ose some 1 + 12-patterns and gain some. Since p was optima, the number ost must be at east as arge as the number gained. And this inequaity can be manipuated to give the one desired. For the detais, the foowing tabe gives the reevant information to describe p for each of the four inequaities. In the second case, the ast two ayers of p are combined into one, so the vaue of b is irreevant. Number of gained 1 + 12-patterns m b number of ost 1 + 12-patterns ( ( b m b m m b (( ( ( ( m + b m b m b + m a b ( ( ( m b 1 m m + 1 b 1 a + b 1 a + 1 1 ( ( ( b m 1 m 1 m 1 b + 1 a + a + b 1 1

402 bóna, sagan, and vatter Now (i foows easiy by canceing bm/! from the inequaity in the first row of the tabe. From the second ine of the tabe, we have ( m 1 ( ( (( ( ( ( b m m + b m b m ab a = a b 1 i i i=1 and canceing b ( m 1, which is not zero because m, gives us (ii. To prove (iii we induct on n. Ifn = + 1, then we must have p = 1 + 12, so k = 1 < + 1/ = n/. Now we assume n>+ 1. If k<+ 1, then the eftmost k eements of p contain no copies of 1 + 12, so we may repace them with any k-permutation and sti have p optima. Therefore we may pick b = 1 and a = k 1, and thus the second row of the tabe shows k 1 m + 1 ( m ( m =k 1 1 (( m + 1 =k 1 ( m ( 1 ( m so k m + 1/ < n/, as desired. If k + 1, reca that from Proposition 3.2, the eftmost k = a + b eements of p form a 1 + 12-optima permutation, so we may, without oss, choose a maxima and thus assume that a = k k. From the third ine of the chart, we have ( ( ( ( k 1 m m b 1 m =a + b 1 a + m + 1 1 1 Using (i we get that ( ( b 1 1 m 1 1 = m m(. Substituting this in the previous equation, canceing ( m, and soving for k gives k m + 1 am + 1 + m Since k + 1, we have by induction that a = k k < k/. Substituting and soving for k again and then canceing m + 1, we get k<m/ 1. A fina substitution of m = n k resuts in (iii. For (iv, notice that the ast row of the tabe gives ( ( ( ( m 1 b m 1 m 1 a + a + b 1 1 ( m 1 =n m (4 1 So canceing ( m 1 1 gives n m m /, which can be converted to the desired inequaity.

pattern frequency sequences 403 We now turn to the proof of Theorem 4.1. First note that, by Lemma 5.1 (iv, we have k = n m n (5 + 1 So k n n 1 ceary diverges to infinity. For our next step, we prove that k n n 1 is monotonicay weaky increasing. The foowing definition and notation wi be usefu in this task. Definition 5.2. Let p n i denote an n-permutation whose ast ayer is of ength n i, and whose eftmost i eements form a 1 + 12-optima i-permutation, and et c n i = c 1+12 p n i. Note that Proposition 5.3. have k n k n+1. ( n i c n i = M i + i For q = 1 + 12 and a integers n + 1, we Proof. Let k = k n. It suffices to show that c n+1k >c n+1i for a i<k. This is equivaent to showing that ( ( n k + 1 n i + 1 M k + k >M i + i (6 However, by definition of k, we know that for a i<k, ( ( n k n i M k + k M i + i (7 Subtracting (7 from (6, we are reduced to proving k ( ( n k 1 >i n i 1.We wi induct on k i. Ifk i = 1, then we woud ike to show that ( ( ( kn k + 2 n k + 1 n k n k + 1 = k > k 1 n k + 1 1 1 1 so it suffices to show that k<n + 1/, which foows from Lemma 5.1(iii. For k i>1 we have, by induction, that k ( ( n k 1 > i + 1 n i 1 1,soit suffices to show that ( ( ( i + 1n i + 1 n i n i 1 n i =i + 1 >i n i 1 1 1 which simpifies to i + 1 < n + 1/, and this is is true because i + 1 k. The proof of the upper bound on k n+1 is a bit more invoved but foows the same genera ines as the previous demonstration. Note that this wi finish the proof of Theorem 4.1.

404 bóna, sagan, and vatter Lemma 5.4. For q = 1 + 12 and a integers n + 1, we have k n k n+1 k n + 1. Proof. Induct on n. The emma is true for n = + 1 since k +1 = k +2 = 1. Suppose the emma is true for integers smaer than or equa to n, and prove it for n + 1. For simpicity, et k = k n, m = n k, and c i = c n+1i. Since we have aready proved the ower bound, it suffices to show that c i >c i+1 for k + 1 i< n + 1 (8 Note that we do not have to consider i n + 1/ because of Lemma 5.1 (iii. We prove (8 by induction on i. For the base case, i = k + 1, we wish to show ( ( m m 1 M k+1 +k + 1 >M k+2 +k + 2 (9 But since p n k is optima by assumption, we have ( ( m m 1 M k + k >M k+1 +k + 1 (10 Subtracting (10 from (9 and rearranging terms, it suffices to prove ( m 1 M 1 k+2 M k+1 M k+1 M k (11 First, if k<+ 1, then (11 is easy to verify using the vaues M +2 = + 1, M +1 = 1, and M k = 0 for k. Therefore we may assume that k + 1. Let p S k, p S k+1, and et p S k+2 be ayered 1 + 12-optima permutations having ast ayer engths m, m, and m, respectivey, as short as possibe. Aso et k = k m, k = k + 1 m, and k = k + 2 m. We woud ike to be abe to assume the emma hods for these permutations, and thus we woud ike to have k + 2 n. But by Lemma 5.1 (iii we have k + 2 <n/2 + 2 n if n 4. The case n = 3 is easy to check directy. Therefore we may assume that p, p, and p a satisfy the emma. If m = m + 1 then et x be the argest eement in the ast ayer of p (namey x = k + 1. Otherwise, m = m and removing the ast ayer of both p and p eaves permutations in S k m and S k m +1, respectivey. So we can iterate this process unti we find the singe ayer where p and p have different engths (those engths must differ by 1 and et x be the argest eement in that ayer of p. Simiary we can find the eement y which is argest in the unique ayer where p and p have different engths.

pattern frequency sequences 405 Now et r =the number of 1+12-patterns in p containing neither x nor y, s =the number of 1+12-patterns in p containing x but not y, t =the number of 1+12-patterns in p containing y but not x, and u=the number of 1+12-patterns in p containing both x and y. Note that there is a bijection between the 1 + 12-patterns of p not containing y and the 1 + 12-patterns of p. A simiar statement hods for p and p.so M k = r M k+1 = r + s M k+2 = r + s + t + u Note aso that s t because increasing the ength of the ayer of x resuts in the most number of 1 + 12-patterns being added to p. It foows that M k+2 M k+1 M k+1 M k =t + u s u. By Lemma 5.1 (iii, k<m, so to obtain (11 it suffices to show that u ( ( k 1. But k 1 is the tota number of subsequences of p having ength + 1 and containing x and y. So the inequaity foows. The proof of the induction step is simiar. Assume that (8 is true for i 1 so that ( ( r + 1 r M i 1 +i 1 M i + i (12 where r = n + 1 i. We wish to prove ( ( r r 1 M i + i M i+1 +i + 1 (13 Subtracting as usua and simpifying, we need to show ( ( r 1 r 1 2 i 1 M 1 2 i+1 M i M i M i 1 Proceeding exacty as in the base case, we wi be done if we can show that ( ( ( ( 2r i + i + 1 r 1 r 1 r 1 i 1 = 2 i 1 r + 1 1 1 2 1 Because i<n + 1/ we have r>i, so it suffices to show that 2r i + i + 1 r + 1 1 This simpifies to showing that i r + i/ =n + 1/, and this is guaranteed by our choice of i.

406 bóna, sagan, and vatter The foowing emma contains two inequaities essentiay shown in the proof of Lemma 5.4, which we wi need to use again. Lemma 5.5. M i ( i 1. If q = 1 + 12 then 0 M i+2 M i+1 M i+1 Proof. For the upper bound, reca that ( i 1 is the tota number of subsequences of p of ength + 1 containing x and y whie the doube difference just counts those subsequences corresponding to the pattern q = 1 + 12. For the ower bound, we showed that M i+2 M i+1 M i+1 M i =t + u s Reca that t + u is the tota contribution of y in p, and s is the tota contribution of x in p. Therefore t + u s 0, as otherwise one coud create a permutation with more 1 + 12-patterns than p by inserting a new eement in the same ayer as x. 6. THE SEQUENCE c n i n 1 i=1 FOR q = 1 + 12 Now that we have competed the proof of Theorem 4.1, we turn our attention to the toos which wi enabe us to show that there are infinitey many IZ integers. As before, a invariants are for q = 1 + 12 uness otherwise stated. For = 2, we wi need the foowing emma. Lemma 6.1. For a n, we have M n+1 132 M n 132 5n 2 /16. Proof. Let k = k n. We induct on n. It is easy to check the base cases n = 1 2. Note that by Theorem 4.1, either k n+1 = k or k n+1 = k + 1. If k n+1 = k, then we have M n+1 M n = nk k 2 and maximizing this as a function of k gives M n+1 M n n2 4 5n2 16 If k n+1 = k + 1, then we have ( n k M n+1 M n = M k+1 M k + 2 By induction, we have M k+1 M k 5k 2 /16, and thus we have that M n+1 M n 13k2 16 + n2 + k n 2kn 2

pattern frequency sequences 407 By Lemma 5.1 (iii and (iv, this function is to be maximized on the interva n 2/3n/2 and for n 3 this maximum occurs at k =n 2/3. So as desired. M n+1 M n 37n2 4n + 4 144 5n2 16 Definition 6.2. For q = 1 + 12 and any positive integer n, et n be the east integer i greater than k n such that c n i c n i+1. If there is no integer with this property, et n = n 1. Do not confuse n, which wi aways be subscripted, with the engthreated parameter, which wi never be. Our next resut shows that the sequence c n i n 1 i=1 is bimoda with a maximum at i = k n and a minimum at i = n. Theorem 6.3. For q = 1 + 12 and a positive integers n, we have the foowing three resuts about the shape of c n i n 1 i=1 (i c n i c n i+1 for a i<k n, (ii c n i >c n i+1 for a k n i< n, (iii c n i c n i+1 for a i n. Proof. For (i we induct on n. The caim is true triviay for n<+ 1 since then c n i = 0 for a i, so we wi assume n + 1. If i = k n 1 then the caim is true by definition. If i<k n 1 then i<k n 1 by Theorem 4.1 and we are abe to appy induction. We woud ike to show that ( ( n i n i 1 M i + i M i+1 +i + 1 and we know by induction that ( ( n i 1 n i 2 M i + i M i+1 +i + 1 Subtracting as is our custom, we are reduced to showing that i ( n i 1 1 i + 1 ( n i 2 1. This further reduces to i n /, which is true by Lemma 5.1 (iii and the fact that i<k n 1. Statement (ii is impied by the definition of n, so we are eft with (iii. By the definition of n we have that c n n c n n +1, so it suffices to show that for a i n,ifc n i c n i+1 then c n i+1 c n i+2. Subtracting in the usua way, we are reduced to showing that ( 2n 2 i + 1 n i 2 M i+2 M i+1 M i+1 M i (14 1 2

408 bóna, sagan, and vatter Since we know that M i+2 M i+1 M i+1 M i 0 by Lemma 5.5, our approach wi be to show that 2n 2 i + 1 0 for i n by showing that n 2n 2/ + 1 (15 Before we prove (15, we wi need the foowing two facts. n n/ and n n 1 The first fact foows from our proof of Lemma 5.4, in which we showed that c n i >c n i+1 for k n i < n/. So to prove the second fact, it suffices to show that c n 1i >c n 1i+1 impies c n i >c n i+1 for i n/. This is proved in exacty the same way as (i with a the inequaities reversed. Now we are ready to prove (15. First we tacke the case where 3 by induction. If n 3 then 2n 2/ + 1 0 and we are done. So suppose n 4. If n 2 > n 1/2, then since n n 2 and 3 we have n > 2n 2/ + 1 as desired. Hence we may assume that n 2/ n 2 n 1/2. In this case we caim that n n 2 + 1, which wi impy (15 by induction. Let i = n 2. We want to show that ( ( n i n i 1 M i + i >M i+1 +i + 1 and we have ( ( n i 1 n i 2 M i 1 +i 1 >M i + i Subtracting, it suffices to show that ( n i 2 M i+1 M i M i M i 1 i 2 By Lemma 5.5, M i+1 M i M i M i 1 ( i 1 1, so it suffices to show that ( i 1 1 i i n i ( n i 2 1 (16 Since i n 2/, we have that i i/n i 1, and since i n 1/2, we have that n i 2 i 1, so (16 is true, and thus (15 hods. For the case where = 2, we examine the quadratics d i n = 1 2 n2 ( 2i + 3 2 n + (M i+1 M i + 32 i2 + 52 i + 1

pattern frequency sequences 409 which agree with c n i+1 c n i, wherever both c n i+1 and c n i are defined. We wi aso need to refer to the roots of d i n, which occur at and r i = 2i + 3 2 i 2 + i + 1 4 2M i+1 M i Lemma 6.1 gives us that s i = 2i + 3 2 + i 2 + i + 1 4 2M i+1 M i r i < 2 3/8i + 3/2 (17 so r i and s i are rea numbers and for i>13, r i < 3i/2. These roots are important in our situation for the foowing reasons: d i n < 0 if and ony if r i <n<s i, (18 for i>13 we have n s i if and ony if i<k n, and (19 for n > 13 we have n r n. (20 Statement (18 is easiy verified. Assume to the contrary that the forward direction of (19 is not true, and thus n s i but i k n.letn be such that k n = i. By Proposition 5.3, we can assume that n >n s i, and thus d i n 0 by (18. However, because i = k n, we have that d i n < 0, a contradiction. To prove the reverse direction of (19, notice that if i<k n then by (i and the definition of k n, we must have that d i n 0. Therefore by (18, either n s i (as we woud ike or n r i, and by (17, it cannot be the case that n r i, as that woud impy that n r i < 3i/2 < 3k n /2if i>13, contradicting Lemma 5.1 (iii. To prove (20, note that by (18 we cannot have r n <n<s n as then we woud have d n n < 0, contradicting the definition of n. Aso, we cannot have n s n as then we woud have n <k n by (19, again contradicting the definition of n. Hence we must have (20. With these toos, (15 is easy to prove; we have n r n < 3 n /2 for n > 13, and thus n > 2n/3, as desired. It is easiy checked that n > 2n/3 for n 13. We wi depend on the foowing emma to find integers n with an interna zero at M n 1. Lemma 6.4. For q = 1 + 12, 2, and a n 2 + 2, ifk n 2 = k 1 and k n 1 = k, then M n c n i > 1 for a i k, so in particuar, k n = k.

410 bóna, sagan, and vatter and Proof. By Theorem 6.3 it suffices to show the foowing inequaities: c n k c n k 1 > 1 (21 c n k c n k+1 > 1 (22 c n k c n n 1 > 1 (23 Statement (23 is cear for n 2 + 2 because c n n 1 = M n 1, M i M i 1 M i 1 M i 2 for a i by Lemma 5.5, and M +2 M +1 =. We prove (22 by induction on n. First, if k<, then M k 1 = M k = M k+1 = 0, so it suffices to show that ( ( n k n k 1 k > k + 1 + 1 and since k n 2 = k 1, we have ( ( n k 1 n k 2 k 1 >k Subtracting that atter from the former, it suffices to show that ( n k 2 1 k 2 So we are done in this case since n k, which foows from n 2 + 2 and k<. Now assume that k, so we may prove (22 by showing the stronger statement that ( k 2 c n k c n k+1 > 2 and thus we woud ike to show that ( ( n k n k 1 M k + k >M k+1 +k + 1 + ( k 2 2 and as k n 2 = k 1, we have ( ( n k 1 n k 2 M k 1 +k 1 >M k + k Subtracting as usua, we are reduced to showing ( n k 2 M k+1 M k M k M k 1 k 2 ( k 2 2

By Lemma 5.1 (iii ( ( n k 2 k 2 k >k 2 2 pattern frequency sequences 411 ( k 2 2 ( k 2 = 1 2 ( k 1 1 The upper bound in Lemma 5.5 now competes the proof of (22. To prove (21, we want to show ( ( n k n k + 1 M k + k >M k 1 +k 1 + 1 and we are given ( ( n k 1 n k M k + k M k 1 +k 1 Subtracting as usua, we are reduced to showing that ( ( n k 1 n k k > k 1 + 1 1 1 Canceing ( n k 1 1 and simpifying, it suffices to show that n>k+ n k + 1 (24 ( n k 1 1 By Lemma 5.1 (iii, n k + 1, so it suffices to show that ( n k 1 n k + 1 < 1 which is true for 3. For = 2, note that proving (24 reduces to showing n>2k + 1. But k n 1 = k, sok<n 1/2 by Lemma 5.1 (iii, which is equivaent to the desired inequaity. 7. THE POSET CONNECTION There is an intimate connection between partiay ordered sets, caed posets for short, and permutations. Using this connection, we wi provide characterizations of a n-permutations p which have c 1+12 p M n 1+12 1 for 2. This wi provide us with the toos we need to show that there are an infinite number of IZ sequences for each of these patterns. Any necessary definitions from the theory of posets that are not given here wi be found in Staney s text [13]. If P is a poset such that any two distinct eements of P are incomparabe we say that P is an antichain. Since there is a unique unabeed antichain on n eements, we denote this poset by n.

412 bóna, sagan, and vatter Given posets P and Q, the ordina sum of P and Q, denoted P Q, is the unique poset on the eements P Q, where x y in P Q, if either (i x y P with x y, (ii x y Q with x y, or (iii x P and y Q. A poset P is ayered if it is an ordina sum of antichains, i.e., if P = p1 p2 pk for some p 1 p k. To introduce a reated notion, et max P denote the set of maxima eements of P and P = P \max P. Then P is ayered on top LOT if P = P max P. Note that if P is ayered then it is LOT, but not conversey. If p = p 1 p 2 p n is a permutation, then the corresponding poset P p has eements p 1 p 2 p n with partia order p i <p j if p i p j is a noninversion in p. So, for exampe, P 12n is a chain, P n21 = n and P 1+12 = 1. Ceary not every poset is of the form P p for some p. In fact, the P p are exacty the posets of dimension at most 2, being the intersection of the tota orders 1 < 2 < <nand p 1 <p 2 < <p n. Given posets P and Q et c Q P =the number of induced subposets of P isomorphic to Q Aso, if S P then et c Q PS=the number of induced Q P with Q =Q and S Q c Q P not S=the number of induced Q P with Q =Q and S Q = We wi freey combine these notations and eiminate the subscript when taking about a fixed poset Q. So, for exampe, c Q P S T = the number of induced Q P with Q = Q and S Q T Q. We wi aso abbreviate c Q Px to c Q P x and c Q P not x to c Q P not x, c Q Px y to c Q P x y, etc. As with permutations, for any non-negative integer n we wi et M n Q = maxc Q P P =n. We wi say a poset P is Q-optima if c Q P =M PQ. Stromquist proved Theorem 3.1 by first demonstrating the foowing stronger resut. Theorem 7.1 [14]. If Q is a LOT pattern, then there is some Q-optima LOT poset P. The same hods with LOT repaced by ayered. To show that the sequences of the patterns 1 + 12, for 2, have infinitey many IZ integers, we wi need to know more about 1 - optima posets. The best possibe case woud be if a (sufficienty arge

pattern frequency sequences 413 1 -optima posets were ayered. This is true for the pattern P 132 = 1 2, but not in genera. For exampe, it can be computed that P 231 8 is 1 3 -optima, but P 231 8 is not ayered. Fortunatey, we are abe to show that a 1 -optima posets are of the foowing sighty more genera form. Definition 7.2. We say P = P 1 P 2 is an -decomposition of P if P 2 is ayered and for a A P with A = 1 we have A P 1 1. The first part of this section concerns the proof of the foowing theorem. Theorem 7.3. If P is an 1 -optima poset then P has an -decomposition. After this proof we wi investigate amost 1 -optima posets, that is, posets P with c 1 P =M P 1 1. If q and p are permutations, it is generay not the case that c Pq P p = c q p. For exampe, P 231 = P312 and thus c P231 P 312 =1, but c 231 312 =0. However, there is an important case in which we do get equaity. Lemma 7.4. If q and p are permutations then c q p c Pq P p. Furthermore, if either q or p is ayered then c q p =c Pq P p. Proof. The inequaity foows from the fact that each copy of q in p gives rise to a copy of P q in P p. For the equaity, if q is ayered then it is the unique permutation giving rise to the poset P q. So every copy of P q in P p corresponds to a copy of q in p and we are done. The ony other case we need to consider is if p is ayered and q is not. But then both sides of the equaity are zero. This emma and the preceding theorems impy severa important features about the connection between pattern matching in posets and permutations. Given any pattern q, the first statement in Lemma 7.4 impies that M n q M n Pq for a n. Ifq is ayered, then by Theorem 7.1 there is a ayered P q -optima poset P = p1 p2 pk for some positive integers p 1 p k. It foows that there is a ayered permutation p such that P p = P, namey p is the permutation whose ayer engths from eft to right are p 1 p k. By the preceding emma, c q p =c Pq P, som Pq = M PPq. Lemma 7.5. For a patterns Q, the sequence M n Q n Q is positive and stricty increasing. Proof. We wi write M n for M n Q and cp for c Q P. Given n Q, it is easy to construct a poset P with cp > 0. So et P be a Q-optima poset. Now there must be some x P with cp x > 0. Now adjoin an eement y to P to form a poset P with a<bin P if either (i a b P with a<b,

414 bóna, sagan, and vatter Then (ii (iii a = y, b P with x<b,or b = y, a P with a<x. cp =cp not y+cp y =cp+cp y cp+cp x >cp so M n+1 cp >cp =M n. We now begin the proof of Theorem 7.3 by making a few definitions. If P is a poset and x P then the open down-set generated by x is P <x =y P y<x If x y max P then et P x y be the unique poset on the same set of eements which satisfies P<z x y = P <z for z x and P<x x y = P <y Note that P x = P x y x. The foowing emma is essentiay in Stromquist [14], but it is not expicity proved there, so we wi provide a demonstration. Lemma 7.6. Let Q be a LOT pattern and P be any poset with x y max P. Then c Q P x y c Q P+c Q P y c Q P x Proof. As before, we write cp for c Q P. Since cp =cp not x+cp x not y+cp x y and cp x y =cp x y not x+cp x y x not y+cp x y x y it is enough to show that cp x y not x =cp not x (25 cp x y x not y cp x not y+cp y cp x (26 cp x y x y cp x y (27 First, (25 is cear since P and P x y agree on a subsets not incuding x. Next, notice that cp x not y+cp y cp x =cp y not x and thus to prove (26, it suffices to show that cp x y x not y cp y, not x, but this is easy. Let A P with y A, x/ A, and A = Q. Then A = A x y is an occurrence of Q in P x y, i.e., A P x y = Q, so (26 is proved. Finay, to prove (27, et A P be an occurrence of Q in P, which contains x and y; i.e., A P = Q. Then we have that A P x y = Q as we. This is because A <x = A <y in P since x y are maxima and Q is LOT. So A forms an occurrence of Q in P x y, and thus (27 is proven.

pattern frequency sequences 415 For the rest of this section, et Q = 1, cp =c Q P, and M n = M n Q. Lemma 7.7. Let P be a poset such that P > 2. If for some a 0 and x max P we have (a (b P x is LOT, c Q P =M PQ a, and (c c Q P x =c Q P y a for a y max P \ x, then P is LOT (and thus a is actuay 0. Proof. Choose y max P with y x, et m =max P and k = P = P m. (If no such y exists, then the resut is trivia. First consider what happens when m<. Then (a impies that cp y =0 for a y max P \ x. This forces cp x = a = 0 by (c. Now (b yieds c P =cp =M P, contradicting Lemma 7.5. So we may assume m. Note that cp =cp x+cp x, and since cp x =cp y a = cp x y+cp not x y a = cp x y+cp x y a we get that cp =cp x+cp x y+cp x y a Furthermore, since P x is LOT we get that ( m 1 cp x =c P+ k and cp x y = Aso, since P <x P = P <y, we have that ( m 2 cpxy= P 2 <x so (( m 1 cp=c P+ k+ ( m 2 k 1 ( m 2 k+ 1 ( m 2 P 2 <x a Furthermore, since P x is LOT, P x y is LOT, so we have ( m cp x y =c P+ k Therefore ((( m cp x y cp=a+ ( m 2 =a+ 2 ( m 1 ( m 2 k 1 (28 ( m 2 P 2 <x k P <x (29

416 bóna, sagan, and vatter Furthermore, by Lemma 7.6 and assumptions (b and (c we have that cp x y M P. So we must have cp x y =M P and, by (b again, cp x y cp =a. It foows that ( m 2 2 k P<x = 0. Therefore since m we have ( m 2 2 > 0 and so k =P<x. Aso, because P <x P, we have P <x = P and thus P is LOT, as desired. Definition 7.8. For any poset P, et µp be defined by µp =maxk there exists S max P with S =k such that if x y S then P <x = P <y Ceary µp max P, with equaity if and ony if P is LOT. It turns out that µp is a usefu statistic for induction. We now have a the necessary toos to prove Theorem 7.3. Proof of Theorem 73 Notice that the caim is trivia for P <+ 1as a posets on ess than + 1 eements cannot have any Q -patterns and thus they have the trivia - decomposition P. Assume to the contrary that the caim is not true and et P be a Q - optima poset of east cardinaity that does not have an -decomposition with µp maxima over a such choices of P and P + 1. Let S be the set from Definition 7.8, m =max P, and k = P =P m. First, we caim that P is LOT. If not, then there is some eement, say x max P\S. Aso et y S. IfcP x cp y, then by Lemma 7.6 either cp x y >M P or cp y x >M P, both contradictions, so cp x = cp y and P x y is Q -optima. Since µp x y >µp, by our choice of P we know that P x y has an -decomposition P 1 P 2. If P 2 =, then cp x y =0, so by Lemma 7.5, P <+ 1 (because M +1 = 1, a contradiction to our choice of P. Hence we may assume that P 2,soP x y is LOT. As the ony eement P and P x y disagree on is x, we have that P x is LOT. Hence by Lemma 7.7, P is aso LOT. Now that we know that P is LOT, we get that cp =c P+ ( m k,so P is Q - optima. By induction, P has an -decomposition P = P 1 P 2 and thus P = P 1 P 2 max P is an - decomposition for P. Note that by using the ideas in the ast paragraph of this proof one may show that if P = P 1 P 2 is an -decomposition for an Q -optima poset P then P 1 <+ 1. Hence because a posets on ess than three eements are ayered, a P 132 -optima posets (and thus 132-optima permutations are ayered. This observation wi be usefu in the foowing proof. Theorem 7.9. If P is such that c Q P =M PQ 1 then there is a poset Q with Q =P and one of the foowing: (i c Q Q =M PQ 1 and Q is LOT, or

(ii (iii pattern frequency sequences 417 Q is Q -optima and max Q =, or = 2 and P =5 Proof. Assume that (i does not hod and choose P with cp =M P 1 and µp maxima over a such choices. Let n =P, m =max P and k = P =n m. We must have cp x cp y 1 for a x y max P as otherwise by Lemma 7.6 we woud have either cp y x >M n or cp x y >M n,a contradiction. Hence we have maxcp x cp y x y max P 0 1 First we tacke the easier case, where maxcp x cp y x y max P =1. Pick two maxima eements of P, say x y max P, so that cp y cp x =1. By Lemma 7.6 we have that cp x y =M n, and thus by Theorem 7.3 we know P x y has an -decomposition P 1 P 2. Since cp =M n 1, we must have M n > 0, so we aso have that n + 1 and P 2. Therefore P x y and consequenty P x are LOT. Hence by Lemma 7.7, P is LOT, a contradiction. Now assume maxcp x cp y x y max P =0. Let S be as in Definition 7.8and pick x max P\S (x must exist as P is not LOT and y S. Now cp x =cp y and thus cp x y M n 1 by Lemma 7.6. However if cp x y =M n 1 then we have contradicted our choice of P as µp x y >µp. Therefore cp x y =M n so by Theorem 7.3, P x y has an -decomposition P 1 P 2. By the same reasoning as in the previous case, P 2, so again P x y and P x are both LOT. Athough we cannot appy Lemma 7.7 in this case, (29 sti hods for P with a = 0, so ( m 2 cp x y cp =1 = k P 2 <x Thus P x y is Q -optima. Furthermore, we must have ( m 2 2 = 1. If >2, this impies that m =, so (ii is true with Q = P x y. If = 2 then we must have k P <x =1, so there is precisey one eement, say z P \ P <x. Since P x is LOT, z must ie in max P. Let b =max P. Then we have cp =c P+cP z max P+cP x z max P+cP x z (30 Because P z is LOT, we have that cp z max P = ( m 2 k 1, and because P x is LOT we have that cp x z max P = ( m 1 2. Notice that because P x y is 1 2 -optima, by the comment after the proof of Theorem 7.3, P x y is ayered, and thus P is ayered. Since the 1 2 patterns in P containing both x and z are formed with exacty one eement

418 bóna, sagan, and vatter which ies in P <z, cp x z =k b. Finay, cp x y =c P+ ( m 2 k. Now combining a these c-vaues with Eq. 30 gives cp x y cp =1 = ( m 2 k ( m 2 k 1 ( m 1 2 k + b (31 so k + 2 = b + m. We have by Lemma 5.1 (iii that m>kand b>k/2 (this foows from the fact that P is ayered and 1 2 -optima, which forces k 3. This in turn impies P =k + m 7. Now it can be checked by direct computation that for P in this range either the theorem is true vacuousy or one of (i to (iii hods. Theorem 7.10. If there is an n-poset P with c Q P =M n Q 1 then there is an n-poset Q with c Q Q =M n Q 1 and (i (ii if >2 then Q is ayered, or if = 2 then Q = Q 1 Q 2, where Q 1 5 and Q 2 is ayered. Furthermore, in either case Q = P r m for some permutation r S n m and integer m, which is positive uness = 2 and n = 5. Proof. Induct on n. Ifn<+ 1, then M n = 0, so the theorem is true vacuousy. If n = + 1, then M n = 1 and c +1 =0 = M n 1. Hence we may assume that n>+ 1. If case (ii of Theorem 7.9 is true, et Q be the poset guaranteed there, k = Q, and m =max Q =. Since Q has an -decomposition, we can repace the P 1 part of the decomposition by P1 to obtain a ayered poset whose upper ayer engths agree with those of P 2. Thus Lemma 5.1 (iii impies, giving k<k + m/ < 2m/m = 2, so n = k + m + 1, a case we have aready deat with. It is routine to check that the poset P 15423 satisfies case (ii of this theorem if case (iii of Theorem 7.9 is true. Therefore we may assume that case (i of Theorem 7.9 is true, and thus there is a LOT n-poset Q so that cq =M n 1. Since Q is LOT, Q = Q max Q = Q m.ascq =c Q+k ( m, we must have c Q M k 1. If c Q =M k, then by Theorem 7.1, there is some ayered k-poset R so that cr =M k, and thus R m is ayered, cr m =M n 1, and R = P r for some r S k.ifc Q =M k 1, then by induction, there is some poset R, R =k, which satisfies this theorem. So R m is the desired poset. Theorem 7.11. many IZ integers. For the pattern q = 1 + 12, there are infinitey Proof. Assume that the theorem is fase. Since S 6 M 6 1 =0 for = 2 and S +2 M +2 1 =0 for 3, there must be some maxima k + 2so that S k M k 1 =0. By Theorem 4.1, there is some n so that k n 2 = k 1

pattern frequency sequences 419 and k n 1 = k. Aso note that since k n k n 1 = k + 2, by Lemma 5.1 (iii we have n>k n + 2 > 2 + 2, so we may appy Lemma 6.4 to see that k n = k. By our choice of k, S n M n 1 0, so there is some p S n so that cp =M n 1. By Lemma 7.4, cp p =M n 1, and thus Theorem 7.10 produces a poset Q = P r m for some r S n m and integer m, which is positive since n>6. Let k = n m. By Theorem 7.1, there is a ayered Q -optima k-poset R, and so we must have cr m cq. Therefore, by Lemma 7.4, we have cr m =c n k cq =M n 1, and thus the inequaity in Lemma 6.4 impies that k = k. However, if k = k then we have cp r =M k 1, contradicting our choice of k. Numerica evidence and the contrast between Proposition 2.1 and Theorem 2.2 makes us suspect that Theorem 4.2 is not true for q = 1 + 12, 3. In fact, we beieve the foowing is true. Conjecture 712 The frequency sequence for q = 1 + 12, 3 has interna zeros for a n + 1. It woud be interesting to find a proof of this conjecture. Perhaps a first step woud be to find a simper proof of Theorem 7.11. ACKNOWLEDGMENTS We thank the referee for a speedy yet carefu reading of the manuscript. Aso this paper was written, in part, when Bruce Sagan was resident at the Isaac Newton Institute for Mathematica Sciences. He expresses his appreciation for the support of the Institute during this period. REFERENCES 1. M. Bóna, The number of permutations with exacty r 132-subsequences is P-recursive in the size!, Adv. App. Math. 18 (1997, 510 522. 2. M. Bóna, Permutations with one of two 132-subsequences, Discrete Math. 181 (1998, 267 274. 3. T. Chow and J. West, Forbidden subsequences and Chebyshev poynomias, Discrete Math. 32 (1980, 125 161. 4. M. Jani and R. G. Rieper, Continued fractions and the Cataan probem, Eectronic J. Combin. 7, No. 1 (2000, R45. 5. C. Krattenthaer, Permutations with restricted patterns and Dyck paths, Adv. App. Math., to appear. 6. T. Mansour, Permutations containing and avoiding certain patterns, in Forma Power Series and Agebraic Combinatorics (Moscow 2000, pp. 704 708, Springer-Verag, Berin, 2000.

420 bóna, sagan, and vatter 7. J. Noonan, The number of permutations containing exacty one increasing subsequence of ength 3, Discrete Math. 152 (1996, 307 313. 8. J. Noonan and D. Zeiberger, The enumeration of permutations with a prescribed number of forbidden subsequences, Adv. App. Math. 17 (1996, 381 407. 9. A. Price, Packing Densities of Layered Patterns, Ph.D. thesis, University of Pennsyvania, Phiadephia, 1997. 10. A. Robertson, H. S. Wif, and D. Zeiberger, Permutation patterns and continued fractions, Eectronic J. Combin. 6 (1999. 11. R. Simion and F. W. Schmidt, Restricted permutations, European J. Combin. 6 (1985, 383 406. 12. R. P. Staney, Log-concave and unimoda sequences in agebra, combinatorics, and geometry, Graph Theory and Its Appications: East and West, Ann. NY Acad. Sci. 576 (1989, 500 535. 13. R. P. Staney, Enumerative Combinatorics, Vo. 1, Cambridge Univ. Press, Cambridge, UK, 1997. 14. W. Stromquist, Packing ayered posets into posets, manuscript.