Table Of ContentGENERATING AND ENUMERATING 321-AVOIDING AND
SKEW-MERGED SIMPLE PERMUTATIONS
3
1
0 Michael H. Albert
∗
2
DepartmentofComputerScience
n
UniversityofOtago
a
Dunedin,NewZealand
J
4 VincentVatter †
∗
1
DepartmentofMathematics
] UniversityofFlorida
O Gainesville,FloridaUSA
C
.
h
t Thesimplepermutationsintwopermutationclasses—the321-avoiding
a
m permutationsandtheskew-mergedpermutations—areenumeratedus-
ing a uniform method. In both cases, these enumerations were known
[
implicitly,byworkingbackwardsfromtheenumerationoftheclass,but
1 the simplepermutations had notbeenenumerated explicitly. Inpartic-
v
ular,theenumerationofthesimpleskew-mergedpermutationsleadsto
2
thefirsttrulystructuralenumerationofthisclassasawhole. Theexten-
2
1 sionofthismethodtoawidercollectionofclassesnamelygridclassesof
3 infinitepathsisdiscussed.
.
1
0
3
1 1. INTRODUCTION
:
v
i Givenpermutations π and σ,thought ofassequencesof positive integers, we saythat π contains
X
σ, andwrite σ π, if π hasasubsequence π(i ) π(i ) of the same length asσ which isorder
1 k
ar isomorphic to σ≤(i.e. π(is) < π(it) if and only if σ·(·s·) < σ(t)); otherwise, we say that π avoids σ.
Containmentisapartialorderonpermutations,andistheonlysuchorderconsideredinthispaper.
For example, π = 391867452contains σ = 51342,ascanbe seenbyconsidering the subsequence
π(2)π(3)π(5)π(6)π(9)=91672.
Given a collection X of permutations, we denote by X the set of permutations in X of length n.
n
ThegeneratingfunctionofXisthen
∑ x|π| =∑ Xn xn,
| |
π X n
∈
∗ThisprojectistheresultofaresearchvisitoftheauthorstotheUniversityofStAndrews,whichwassupportedby
EPSRCviathegrantEP/J006440/1.
†VatterwasalsopartiallysupportedbytheNSAYoungInvestigatorGrantH98230-12-1-0207.
AMS1991subjectclassifications.05A05,05A15
1
GENERATINGANDENUMERATING321-AVOIDINGANDSKEW-MERGEDSIMPLEPERMUTATIONS 2
where π denotes the length of π. As a matter of convention, except when explicitly stated oth-
| |
erwise,wedonotincludetheemptypermutationinourgeneratingfunctions. Weareparticularly
interestedincollectionsofpermutations whicharedownwardsclosedinthecontainmentorder,
C
i.e.π andσ π,thenσ ;wecallsuchcollectionspermutationclasses.
∈ C ≤ ∈ C
The two permutation classes we consider in this paper are the 321-avoiding permutations and
theskew-mergedpermutations. Thislatterclassisdefinedasthe setofpermutationswhich canbe
writtenastheunionofanincreasingandadecreasingsubsequence. Stankova[5]provedthatthe
skew-mergedpermutationscanalsobecharacterizedasthepermutationsthatavoidboth2143and
3412.ThisclasswasenumeratedbyAtkinson[4]viaaratherintricateargument.
Our interestiswith the simple permutations inthese classes, and todiscuss these we need afew
preliminarydefinitions. Anintervalinthepermutationπ isasetofcontiguousindices I = a,a+
{
1,...,b suchthattheset π(i) : i I isalsocontiguous. Everypermutationπ oflength nhas
} { ∈ }
trivialintervalsoflengths0,1,andn,andotherintervalsarecalledproper. Apermutationiscalled
simpleifitdoesnothaveanyproperintervals.
Simplepermutationsarepreciselythosethatdonotarisefromanon-trivialinflation,inthefollow-
ingsense. Givenapermutationσoflengthmandnonemptypermutationsα ,...,α ,theinflation
1 m
of σ by α ,...,α , denoted σ[α ,...,α ], is the permutation of length α + + α obtained
1 m 1 m 1 m
| | ··· | |
by replacing each entry σ(i) by an interval that is order isomorphic to α in such a way that the
i
intervalsareorderisomorphictoσ. Forexample,
2413[1,132,321,12]=479832156.
Itcanbeestablishedthateverypermutationistheinflationofauniquesimplepermutation,called
itssimplequotientand,moreover,thattheintervalsinsuchaninflationareuniqueunlessthesimple
quotientis12or21.Permutationswhosesimplequotientis12arecalledsumdecomposableandthose
whose simple quotient is 21arecalledskew decomposable. For enumerativepurposeswe specifya
unique representation of sum decomposable permutations, expressing the sum decomposable π
asπ = 12[α,β] where α issum indecomposable. We representskewdecomposable permutations
uniquelyinananalogouswayas21[α,β]whereαisskewindecomposable. Inflationsofthesetwo
permutationsoccurfrequentlyenoughthatwegivethemspecialnotation,writingα βfor12[α,β]
⊕
andα βfor21[α,β].
⊖
2. IMPLICIT DERIVATION
Before introducing our method of counting simple 321-avoidingpermutations directly, we show
howthisenumerationcanbeobtainedthroughanimplicitrelationbetweenitandtheenumeration
ofthefullclass. Thenonempty321-avoidingpermutationshavethegeneratingfunction
1 2x √1 4x
c(x)= − − − = x+2x2+5x3+14x4+42x5+132x6+429x7+1430x8+ .
2x ···
Weaimtorelatethegeneratingfunctionforsimple321-avoidingpermutationsoflengthatleast4,
whichwelabels(x),toc(x)andthensolvefors(x).
The321-avoidingpermutationscanbedividedintofourcategories:
thepermutation1,
•
GENERATINGANDENUMERATING321-AVOIDINGANDSKEW-MERGEDSIMPLEPERMUTATIONS 3
theskewdecomposablepermutations,
•
thesumdecomposablepermutations,and
•
theinflationsofsimplepermutationsoflengthatleast4.
•
Obviously the first category of permutations is counted by the generating function x. The skew
decomposable321-avoidingpermutationsareallskewsumsoftwo nonemptyincreasingpermu-
tations, and thus are counted by x2/(1 x)2. Let f denote the generating function for the sum
− ⊕
decomposable 321-avoiding permutations. Because the 321-avoiding permutations form a sum
closedclass(π σavoids321wheneverπ andσbothdo),wecandecomposeeverysumdecom-
⊕
posable321-avoidingpermutationasthesumofasumindecomposablepermutationandanother
321-avoidingpermutation,obtaining
f =(c f )c,
⊕ − ⊕
whichshowsthat
c2
f = .
⊕ 1+c
Finally,everyentryofasimplepermutationoflengthatleast4mustbeinvolvedinaninversion(as
otherwise thepermutationwould besumdecomposable), sotoforma321-avoidingpermutation
byinflating such a simple permutationwe canonly inflate byincreasingsubsequences. Thuswe
seethatthecontributionoftheseinflationsiss(x/(1 x)). Puttingthistogethershowsthat
−
x2 c2 x
c(x)= x+ + +s ,
(1 x)2 1+c (cid:18)1 x(cid:19)
− −
sowegetthat
x (1 3x+2x2 x3)c x+x2 x3
s = − − − − ,
(cid:18)1 x(cid:19) (1 x)2(1+c)
− −
fromwhichitfollowsthat
1 x 2x2 2x3 √1 2x 3x2
s(x)= − − − − − − .
2+2x
Thepowerseriesexpansionofs(x)begins
2x4+2x5+7x6+14x7+37x8+ ,
···
sequenceA187306intheOEIS[1].
3. AN ITERATED SYSTEM FOR 321-AVOIDING SIMPLES
Every 321-avoiding permutation π has a staircase decomposition, as illustrated in the final pane of
Figure 1. The square regions of this drawing are called its cells. For definiteness we take the ele-
mentsinthefirstcelltobethemaximumincreasingprefixτofπ,thoseinthesecondcelltobethe
maximum increasing sequence of values in π τ, and thereafter continue according to the same
\
rules.
GENERATINGANDENUMERATING321-AVOIDINGANDSKEW-MERGEDSIMPLEPERMUTATIONS 4
−→ −→ −→
Figure1: The developmentofthe simplepermutation2471 83596. In this development,
hollowdotsmightsplitintogroupsofentries.Inthefirststepthisoccurs,astheoriginalsingle
dotsplitsinthree.Thatimposestwomandatoryinterpositions(thesecondandthirddotsinthe
secondcell).Thereisoneoptionaladditionbelowit(thisadditionis,infact,compulsoryinthe
firststep,butoptionalthereafter). Inthenextstageofthedevelopmentonlythelastdotsplits
intotwo,resultinginasinglemandatoryinterposition.Oneoptionaladditionisalsochosen.
We view simple 321-avoidingpermutations as developing one cell ata time, from an initial seed
whichisasinglepoint. Atanintermediatestepofthisdevelopment,theelementsinthefinalcell
will represent either single elements of the final permutation, or groups of such elements which
areonlyseparatedfromoneanotherbyelementsofthenextcell. Thedevelopmentofaparticular
simplepermutationisillustratedinFigure1.
Thediscussionabovesuggestsaniteratedsystemwhichdescribesthedevelopmentof321-avoiding
simplepermutations. Specifically,supposethatwehaveageneratingfunctions (x,y)whichenu-
n
merates all possible developments through n cells, where the elements of the first n 1 cells are
−
weighted by x and those of the last cell by y. In the next step of the development, each “hollow
dot”(i.e.eachy)canbereplacedbyasequenceofoneormore“filleddots”(elements). Inthenext
cell, we may put a hollow dot beneath the first of these, and must put one between every pair of
them. Thatis,yisreplacedby
x(y+1)
x+xy+x2y+x2y2+ = .
··· 1 xy
−
Thisgivesusthesystem
s (x,y) = y,
1
x(y+1)
s (x,y) = s x, , forn 1.
n+1 n
(cid:18) 1 xy (cid:19) ≥
−
Weareinterestedinthelimitasn ∞ofthissystem. Ifweset
→
x(y+1)
y= (†)
1 xy
−
and apply the iteration then we are at a fixed point, and so have produced the desired solution.
Thisyields
1 x √1 2x 3x2
s(x) = − − − − ,
2x
thepowerseriesfortheMotzkinnumbers,
x+x2+2x3+4x4+9x5+21x6+51x7+127x8+ .
···
GENERATINGANDENUMERATING321-AVOIDINGANDSKEW-MERGEDSIMPLEPERMUTATIONS 5
However, the 321-avoiding simple permutations are not enumerated by the Motzkin numbers.
Whathasgonewrong?
4. RESTRICTING TO SIMPLES
The development procedure described above fails to generate the simple 321-avoiding permuta-
tionscorrectlyfortworeasons.
The addition of an element below the first dot is optional in this system, but a simple per-
•
mutationcannotbeginwithitsminimumelement,sointhefirststepthisadditionshouldbe
compulsory.
Theadditionofanelementinthethirdcelltotheleftoftheabsoluteminimumelement(which
•
isinthesecondcell)isallowedbythissystem, butthiselement(ifadded)precedesthefirst
descentandthusshouldbeinthefirstcell.
Itmight seemthattheseproblemswould recurinlatercellsbuttheydonot. Inalaterhorizontal
step there is no need to add an element below the smallest element of the preceding cell, since
suchelementsalreadyexistinearliercells. Similarly,inaverticalstepthereisnoneedtoforbidthe
additionofanelementtotheleftoftheminimumelement,sinceitisalreadyseparatedhorizontally
fromthe previoustop step byatleastone elementofthe previousbottom step. For example, the
leastelementofthefifthcellisseparatedfromthegreatestelementinthethirdcellbyatleastone
elementofthesecondcell.
We can correct both these problems by adjusting the initial conditions. One way to do this is to
startwithatwocellsystem,anduseanewvariableztocodetheleastelement. Thisgives
xz
s (x,y,z)= .
2
1 xy
−
Wethenobtains bythesubstitutions
3
x x(y+1)
z and y .
→ 1 xy → 1 xy
− −
Thiseliminateszandthereafterweusetheoriginaliteration. Itfollowsthatweshouldobtainthe
generating function for simple 321-avoiding permutations by substituting (†) into s . Doing so
3
yields
1 x √1 2x 3x2
s(x)= − − − −
2+2x
whosepowerseriesexpansionbegins
x2+2x4+2x5+7x6+14x7+37x8+ ,
···
which(once thetermcorrespondingtothe permutation21isremoved)agreeswiththeresultob-
tainedinSection2.
GENERATINGANDENUMERATING321-AVOIDINGANDSKEW-MERGEDSIMPLEPERMUTATIONS 6
IV III
I II
Figure2: Thebasicstructureofaskew-mergedpermutationasdescribedin[4]. AreaIconsists
ofalltheelementsthatplaytheroleof1insome132,areaIIthosethatplaytheroleof1insome
231, areaIIIthosethatplaytheroleof3insome213andareaIVthosethatplaytheroleof3
insome312. Ingeneral,anyoralloftheseareasmightbeempty,andeachismonotoneofthe
typeindicatedbythelinesegments. Thecentralregionconsistsofalltheremainingelements
andcouldbeeitherincreasingordecreasing.
5. SKEW-MERGED PERMUTATIONS
Recallthataskew-mergedpermutationisonethatcanbewrittenastheunionofanincreasingand
adecreasingsequence. ThebasicstructureofsuchapermutationisshowninFigure2. Weintend
to apply an analogous technique to that of the previous sections to enumerate the simple skew-
merged permutations. Inorder to doso, we must refinethat basic structure somewhat. The first
thingtonoteisthatthecentralareaisaninterval,andhenceinasimplepermutationcancontainat
mostonepoint. Everysimplepermutationoflengthatleastfourcontainseither2413or3142asa
subpermutation,soifπ isasimpleskew-mergedpermutation,thenallfourareasareoccupiedby
atleastonepoint. Further,itiseasytocheckthatifπ hasacentralelement,c,andissimple,then
π c(thepermutationobtainedbyπ byremoving c andrelabelingthe remainingentries)isalso
−
simple. Wecallthefourelements(onefromeacharea)closesttothecentreofπitsinnerelements.
To continue we assume that π has no central element and further divide into two (symmetric)
cases depending on the pattern of the four inner elements. There are only two possible patterns
ofthistype,andthefollowingdiscussionassumesthatweareconsideringasimpleskew-merged
permutation π whose inner elements have the pattern 3142 (the other possibility is its inverse,
2413).Denotetheinnerelementsspecificallyascadbfromlefttoright.
Nowwe describeapartitionof π intoasequence ofmonotone cells(akintothestaircasedecom-
positionof321-avoidingpermutations)whereeachcellinthesequenceinteractsonlywithitsim-
mediatepredecessorand itsimmediate successor. These cellsarearrangedina counterclockwise
spiralpattern,movingoutwards.TheirdescriptionismosteasilyunderstoodbyreferringtoFigure
3. Thefirstfourofthesecellsaredefinedspecificallyasfollows.
C consistsofalltheelementsinareaIlyingtotherightofc. Inparticulara C .
1 1
• ∈
C consists of all the elements in area II which lie above some element of C . In particular,
2 1
•
b C .
2
∈
C consists of all the elements in area III which lie to the left of some element of C . In
3 2
•
particular,d C .
3
∈
GENERATINGANDENUMERATING321-AVOIDINGANDSKEW-MERGEDSIMPLEPERMUTATIONS 7
C C
8 7
C C
4 3
c d
IV III
I C a b C II
1 2
C C
5 6
C
9
Figure3: The decompositionof a simple skew-mergedpermutation whose inner non-central
elementscadbhavepattern3142intomonotonecells,eachinteractingwithonlyitsimmediate
predecessorandsuccessor.
C consists of allthe elementsin areaIV which liebelow some elementof C . Inparticular,
4 3
•
c C . NotealsothatC liesentirelytotheleftofC bytheinitialchoiceofC .
4 4 1 1
∈
Nowfork 1thecellsaredefinedinductivelyasfollows.
≥
C consistsofalltheelementsinareaIwhichlietotherightofsomeelementofC butdo
• 4k+1 4k
notbelongtosomepreviouscell.
C consists of all the elements in areaII which lie above some element C but do not
• 4k+2 4k+1
belongtosomepreviouscell.
C consistsofalltheelementsinareaIIIwhichlielietotheleftofsomeelementofC
• 4k+3 4k+2
butdonotbelongtosomepreviouscell.
C consistsofalltheelementsinareaIVwhichliebelowsomeelementofC butdonot
• 4k+4 4k+3
belongtosomepreviouscell.
IfC isemptyforsomenthentheelementsofπ thatbelongtotheunionoftheC fork < nform
n k
aninterval. Sinceπisassumedtobesimple,thismustbetheentirepermutation.
Nowwereversetheperspectiveabove,whichdeconstructsasimpleskew-mergedpermutationπ
into a sequence of cells and view it as a constructive recipe for building these permutations. As
before we think of the cells C through C as having been constructed for some k, along with
1 k 1
someelementsofC representedbyhollow−dots. Inextendingtheconstruction,thesehollowdots
k
cansplitintosequenceswhichthenimposemandatoryinsertionsinthenextcell,whilethespaces
betweenhollow dots(or beforethe firstone inacell) representoptionalinsertions. Note thatthe
precise meaning of “before” depends on the area in which we are constructing the next cell, for
example,inareaIIsuchanelementwouldbetheleftmostandgreatestelementof C . Wecode
k+1
the generatingfunctionfortheresultofapplyingthisiterationthroughcelln byu (x,y)wherey
n
GENERATINGANDENUMERATING321-AVOIDINGANDSKEW-MERGEDSIMPLEPERMUTATIONS 8
labels the hollow dots. Because of the necessity of including the four extreme points in the first
four cells, the firstthree optional insertions atthe beginning of a cellarein factcompulsory. The
fourthoneisactuallyforbidden(itwouldviolatethe“inner”propertyofc). Weaccountforthese
variationstothegeneralrulebyadjustingthesubstitutionscorrespondingtothesesteps:
u (x,y) = y,
1
x(1+y) y
u (x,y) = u x, ,
2 1(cid:18) 1 xy (cid:19)· y+1
−
x(1+y) y
u (x,y) = u x, ,
3 2(cid:18) 1 xy (cid:19)· y+1
−
x(1+y) y
u (x,y) = u x, ,
4 3(cid:18) 1 xy (cid:19)· y+1
−
x(1+y) 1
u (x,y) = u x, ,
5 4(cid:18) 1 xy (cid:19)· y+1
−
x(1+y)
u (x,y) = u x, , forn 5.
n+1 n
(cid:18) 1 xy (cid:19) ≥
−
By computing u and then substituting from (†) as before, we obtain the generating function for
5
thesimpleskew-mergedpermutationsofthistype:
1 2x x2+(x 1)√1 2x 3x2
u= − − − − − .
2(x+1)2
The generating function for all simple permutations of length at least 4 in this class is then s =
2(x+1)u. Here the 2 accounts for the two types of inner pattern and the x+1 for the possible
additionofacentralelement. Thepowerseriesexpansionofs(x)begins
2x4+2x5+8x6+16x7+44x8+ ,
···
sequenceA220589intheOEIS[1].
Finally,wecanrecoverthegeneratingfunction, f,fortheclassofskew-mergedpermutationsfrom
its simple elements by the usual techniques. Skew-mergedpermutations are either sum or skew
decomposableorhaveasimplequotientoflengthatleast4.Everysumdecomposablepermutation
inthisclassisoftheform1 π orπ 1foraskew-mergedpermutationπ,andtheskewdecom-
⊕ ⊕
posable permutation can be analogously described. Allowing for the over-counting of elements
of the form 1 π 1 or 1 π 1 we see thatthe sum or skew decomposable elements of are
⊕ ⊕ ⊖ ⊖ S
enumeratedby
4xf 2x2(f +1).
−
Inanelementwithasimplequotientoflengthatleast4,ifthereisnocentralelementinthequotient
thenthequotientcanonlybeinflatedbymonotonesequencesateachpoint. Ifacentralelementis
presentthenitcanbeinflatedbyanarbitraryskew-mergedpermutation. Combiningthiswithour
previousobservationsgives:
x
f = x+4xf 2x2(f +1)+2u (f +1).
− (cid:18)1 x(cid:19)
−
GENERATINGANDENUMERATING321-AVOIDINGANDSKEW-MERGEDSIMPLEPERMUTATIONS 9
And,althoughitishardlyevidentataglance,thisgivestheknownresult
1 3x
f = − =1+x+2x2+6x3+22x4+86x5+340x6+1340x7+5254x8+ .
(1 2x)√1 4x ···
− −
(SequenceA029759intheOEIS[1].) Toconfirmthis,wesuggestthatthereaderdoaswedidand
leavethe detailstoacomputeralgebrasystem, butthe mainreasonthatthingssimplifysonicely
isthatthesubstitutionofx/(1 x)forxin√1 2x 3x2yields√1 4x/(1 x).
− − − − −
6. EXTENSIONS
Ithasnotescapedournoticethatthespecifictechniqueswehavedetailedsuggestpossibleexten-
sions. Inthelanguageof“geometricgridclasses”studiedin[2,3],the321-avoidingpermutations
canbedescribedas
... ...
1 1
Geom 1 1 ,
1 1
1 1
1 1
andwehaveshownthattheskew-mergedpermutationscanbeexpressedas
... ... ... ...
1 1
1 1 −
− 1 1 −1 1
Geom − Geom 1 .
1 1
1 − −1 [ 1 1 −1 1
... ... ... − ...
It should be possible to use our techniques to enumerate the simple permutations for all infinite
geometricgridclasseswhichconsistofasingle“path”,solongasthispathsatisfiessomesuitable
regularity condition. Of course, the analysis of which hollow dots are mandatory and which are
optionalwilldependonthespecificgridclassstudied.
REFERENCES
[1] TheOn-lineEncyclopediaofIntegerSequences. publishedelectronicallyathttp://oeis.org/.
[2] ALBERT, M. H., ATKINSON, M. D., BOUVEL, M., RUSˇKUC, N., AND VATTER, V. Geometric
gridclassesofpermutations. Trans.Amer.Math.Soc.,toappear.
[3] ALBERT,M.H., RUSˇKUC,N., ANDVATTER,V. Inflationsofgeometricgridclassesofpermuta-
tions. arXiv:1202.1833v1[math.CO].
[4] ATKINSON, M. D. Permutationswhicharetheunionofanincreasingandadecreasingsubse-
quence. Electron.J.Combin.5(1998),Researchpaper6,13pp.
[5] STANKOVA, Z. E. Forbiddensubsequences. DiscreteMath.132,1-3(1994),291–316.