<s>
In	O
combinatorial	O
mathematics	O
and	O
theoretical	O
computer	O
science	O
,	O
a	O
permutation	B-Algorithm
pattern	I-Algorithm
is	O
a	O
sub-permutation	O
of	O
a	O
longer	O
permutation	B-Algorithm
.	O
</s>
<s>
Any	O
permutation	B-Algorithm
may	O
be	O
written	O
in	O
one-line	O
notation	O
as	O
a	O
sequence	O
of	O
digits	O
representing	O
the	O
result	O
of	O
applying	O
the	O
permutation	B-Algorithm
to	O
the	O
digit	O
sequence	O
123	O
...	O
;	O
for	O
instance	O
the	O
digit	O
sequence	O
213	O
represents	O
the	O
permutation	B-Algorithm
on	O
three	O
elements	O
that	O
swaps	O
elements	O
1	O
and	O
2	O
.	O
</s>
<s>
If	O
π	O
and	O
σ	O
are	O
two	O
permutations	B-Algorithm
represented	O
in	O
this	O
way	O
(	O
these	O
variable	O
names	O
are	O
standard	O
for	O
permutations	B-Algorithm
and	O
are	O
unrelated	O
to	O
the	O
number	O
pi	O
)	O
,	O
then	O
π	O
is	O
said	O
to	O
contain	O
σ	O
as	O
a	O
pattern	O
if	O
some	O
subsequence	O
of	O
the	O
digits	O
of	O
π	O
has	O
the	O
same	O
relative	O
order	O
as	O
all	O
of	O
the	O
digits	O
of	O
σ	O
.	O
</s>
<s>
For	O
instance	O
,	O
permutation	B-Algorithm
π	O
contains	O
the	O
pattern	O
213	O
whenever	O
π	O
has	O
three	O
digits	O
x	O
,	O
y	O
,	O
and	O
z	O
that	O
appear	O
within	O
π	O
in	O
the	O
order	O
x	O
...	O
y	O
z	O
...	O
but	O
whose	O
values	O
are	O
ordered	O
as	O
y	O
<	O
x	O
<	O
z	O
,	O
the	O
same	O
as	O
the	O
ordering	O
of	O
the	O
values	O
in	O
the	O
permutation	B-Algorithm
213	O
.	O
</s>
<s>
The	O
permutation	B-Algorithm
32415	O
on	O
five	O
elements	O
contains	O
213	O
as	O
a	O
pattern	O
in	O
several	O
different	O
ways	O
:	O
3··15	O
,	O
··415	O
,	O
32··5	O
,	O
324··	O
,	O
and	O
·2·15	O
all	O
form	O
triples	O
of	O
digits	O
with	O
the	O
same	O
ordering	O
as	O
213	O
.	O
</s>
<s>
If	O
a	O
permutation	B-Algorithm
π	O
does	O
not	O
contain	O
a	O
pattern	O
σ	O
,	O
then	O
π	O
is	O
said	O
to	O
avoid	O
σ	O
.	O
</s>
<s>
The	O
permutation	B-Algorithm
51342	O
avoids	O
213	O
;	O
it	O
has	O
10	O
subsequences	O
of	O
three	O
digits	O
,	O
but	O
none	O
of	O
these	O
10	O
subsequences	O
has	O
the	O
same	O
ordering	O
as	O
213	O
.	O
</s>
<s>
A	O
case	O
can	O
be	O
made	O
that	O
was	O
the	O
first	O
to	O
prove	O
a	O
result	O
in	O
the	O
field	O
with	O
his	O
study	O
of	O
"	O
lattice	O
permutations	B-Algorithm
"	O
.	O
</s>
<s>
In	O
particular	O
MacMahon	O
shows	O
that	O
the	O
permutations	B-Algorithm
which	O
can	O
be	O
divided	O
into	O
two	O
decreasing	O
subsequences	O
(	O
i.e.	O
,	O
the	O
123-avoiding	O
permutations	B-Algorithm
)	O
are	O
counted	O
by	O
the	O
Catalan	O
numbers	O
.	O
</s>
<s>
Another	O
early	O
landmark	O
result	O
in	O
the	O
field	O
is	O
the	O
Erdős	O
–	O
Szekeres	O
theorem	O
;	O
in	O
permutation	B-Algorithm
pattern	I-Algorithm
language	O
,	O
the	O
theorem	O
states	O
that	O
for	O
any	O
positive	O
integers	O
a	O
and	O
b	O
every	O
permutation	B-Algorithm
of	O
length	O
at	O
least	O
must	O
contain	O
either	O
the	O
pattern	O
or	O
the	O
pattern	O
.	O
</s>
<s>
The	O
study	O
of	O
permutation	B-Algorithm
patterns	I-Algorithm
began	O
in	O
earnest	O
with	O
Donald	O
Knuth	O
's	O
consideration	O
of	O
stack-sorting	B-Algorithm
in	O
1968	O
.	O
</s>
<s>
Knuth	O
showed	O
that	O
the	O
permutation	B-Algorithm
π	O
can	O
be	O
sorted	O
by	O
a	O
stack	B-Application
if	O
and	O
only	O
if	O
π	O
avoids	O
231	O
,	O
and	O
that	O
the	O
stack-sortable	B-Algorithm
permutations	I-Algorithm
are	O
enumerated	O
by	O
the	O
Catalan	O
numbers	O
.	O
</s>
<s>
Knuth	O
also	O
raised	O
questions	O
about	O
sorting	O
with	O
deques	B-Application
.	O
</s>
<s>
In	O
particular	O
,	O
Knuth	O
's	O
question	O
asking	O
how	O
many	O
permutation	B-Algorithm
of	O
n	O
elements	O
are	O
obtainable	O
with	O
the	O
use	O
of	O
a	O
deque	B-Application
remains	O
open	O
.	O
</s>
<s>
Shortly	O
thereafter	O
,	O
investigated	O
sorting	O
by	O
networks	O
of	O
stacks	B-Application
,	O
while	O
showed	O
that	O
the	O
permutation	B-Algorithm
π	O
can	O
be	O
sorted	O
by	O
a	O
deque	B-Application
if	O
and	O
only	O
if	O
for	O
all	O
k	O
,	O
π	O
avoids	O
5	O
,	O
2	O
,	O
7	O
,	O
4	O
,...,	O
4k+1	O
,	O
4k2	O
,	O
3	O
,	O
4k	O
,	O
1	O
,	O
and	O
5	O
,	O
2	O
,	O
7	O
,	O
4	O
,...,	O
4k+3	O
,	O
4k	O
,	O
1	O
,	O
4k+2	O
,	O
3	O
,	O
and	O
every	O
permutation	B-Algorithm
that	O
can	O
be	O
obtained	O
from	O
either	O
of	O
these	O
by	O
interchanging	O
the	O
last	O
two	O
elements	O
or	O
the	O
1	O
and	O
the	O
2	O
.	O
</s>
<s>
Because	O
this	O
collection	O
of	O
permutations	B-Algorithm
is	O
infinite	O
(	O
in	O
fact	O
,	O
it	O
is	O
the	O
first	O
published	O
example	O
of	O
an	O
infinite	O
antichain	O
of	O
permutations	B-Algorithm
)	O
,	O
it	O
is	O
not	O
immediately	O
clear	O
how	O
long	O
it	O
takes	O
to	O
decide	O
if	O
a	O
permutation	B-Algorithm
can	O
be	O
sorted	O
by	O
a	O
deque	B-Application
.	O
</s>
<s>
later	O
presented	O
a	O
linear	O
(	O
in	O
the	O
length	O
of	O
π	O
)	O
time	O
algorithm	O
which	O
determines	O
if	O
π	O
can	O
be	O
sorted	O
by	O
a	O
deque	B-Application
.	O
</s>
<s>
In	O
his	O
paper	O
,	O
Pratt	O
remarked	O
that	O
this	O
permutation	B-Algorithm
pattern	I-Algorithm
order	O
“	O
seems	O
to	O
be	O
the	O
only	O
partial	O
order	O
on	O
permutation	B-Algorithm
that	O
arises	O
in	O
a	O
simple	O
and	O
natural	O
way	O
”	O
and	O
concludes	O
by	O
noting	O
that	O
“	O
from	O
an	O
abstract	O
point	O
of	O
view	O
”	O
,	O
the	O
permutation	B-Algorithm
pattern	I-Algorithm
order	O
“	O
is	O
even	O
more	O
interesting	O
than	O
the	O
networks	O
we	O
were	O
characterizing	O
”	O
.	O
</s>
<s>
A	O
prominent	O
goal	O
in	O
the	O
study	O
of	O
permutation	B-Algorithm
patterns	I-Algorithm
is	O
in	O
the	O
enumeration	O
of	O
permutations	B-Algorithm
avoiding	O
a	O
fixed	O
(	O
and	O
typically	O
short	O
)	O
permutation	B-Algorithm
or	O
set	O
of	O
permutations	B-Algorithm
.	O
</s>
<s>
Let	O
Avn(B )	O
denote	O
the	O
set	O
of	O
permutations	B-Algorithm
of	O
length	O
n	O
which	O
avoid	O
all	O
of	O
the	O
permutations	B-Algorithm
in	O
the	O
set	O
B	O
(	O
in	O
the	O
case	O
B	O
is	O
a	O
singleton	O
,	O
say	O
β	O
,	O
the	O
abbreviation	O
Avn(β )	O
is	O
used	O
instead	O
)	O
.	O
</s>
<s>
Among	O
other	O
results	O
,	O
Simion	O
and	O
Schmidt	O
counted	O
even	O
and	O
odd	O
permutations	B-Algorithm
avoiding	O
a	O
pattern	O
of	O
length	O
three	O
,	O
counted	O
permutations	B-Algorithm
avoiding	O
two	O
patterns	O
of	O
length	O
three	O
,	O
and	O
gave	O
the	O
first	O
bijective	O
proof	O
that	O
123	O
-	O
and	O
231-avoiding	O
permutations	B-Algorithm
are	O
equinumerous	O
.	O
</s>
<s>
(	O
These	O
two	O
operations	O
generate	O
the	O
Dihedral	O
group	O
D8	O
with	O
a	O
natural	O
action	O
on	O
permutation	B-Algorithm
matrices	I-Algorithm
.	O
)	O
</s>
<s>
proved	O
that	O
the	O
permutations	B-Algorithm
1342	O
and	O
2413	O
are	O
Wilf-equivalent	O
.	O
</s>
<s>
proved	O
that	O
for	O
any	O
permutation	B-Algorithm
β	O
,	O
the	O
permutations	B-Algorithm
231	O
β	O
and	O
312	O
β	O
are	O
Wilf-equivalent	O
,	O
where	O
denotes	O
the	O
direct	B-Algorithm
sum	I-Algorithm
operation	O
.	O
</s>
<s>
proved	O
that	O
for	O
any	O
permutation	B-Algorithm
β	O
and	O
any	O
positive	O
integer	O
m	O
,	O
the	O
permutations	B-Algorithm
12	O
..	O
m	O
β	O
and	O
m	O
...	O
21β	O
are	O
Wilf-equivalent	O
.	O
</s>
<s>
In	O
the	O
late	O
1980s	O
,	O
Richard	O
Stanley	O
and	O
Herbert	O
Wilf	O
conjectured	O
that	O
for	O
every	O
permutation	B-Algorithm
β	O
,	O
there	O
is	O
some	O
constant	O
K	O
such	O
that	O
|	O
Avn(β )	O
|	O
<	O
Kn	O
.	O
</s>
<s>
A	O
closed	O
class	O
,	O
also	O
known	O
as	O
a	O
pattern	O
class	O
,	O
permutation	B-Algorithm
class	O
,	O
or	O
simply	O
class	O
of	O
permutations	B-Algorithm
is	O
a	O
downset	O
in	O
the	O
permutation	B-Algorithm
pattern	I-Algorithm
order	O
.	O
</s>
<s>
Every	O
class	O
can	O
be	O
defined	O
by	O
the	O
minimal	O
permutations	B-Algorithm
which	O
do	O
not	O
lie	O
inside	O
it	O
,	O
its	O
basis	O
.	O
</s>
<s>
Thus	O
the	O
basis	O
for	O
the	O
stack-sortable	B-Algorithm
permutations	I-Algorithm
is	O
{231},	O
while	O
the	O
basis	O
for	O
the	O
deque-sortable	O
permutations	B-Algorithm
is	O
infinite	O
.	O
</s>
<s>
The	O
generating	O
function	O
for	O
a	O
class	O
is	O
Σ	O
x|π|	O
where	O
the	O
sum	O
is	O
taken	O
over	O
all	O
permutations	B-Algorithm
π	O
in	O
the	O
class	O
.	O
</s>
<s>
As	O
the	O
set	O
of	O
permutations	B-Algorithm
under	O
the	O
containment	O
order	O
forms	O
a	O
poset	O
it	O
is	O
natural	O
to	O
ask	O
about	O
its	O
Möbius	O
function	O
,	O
a	O
goal	O
first	O
explicitly	O
presented	O
by	O
.	O
</s>
<s>
The	O
goal	O
in	O
such	O
investigations	O
is	O
to	O
find	O
a	O
formula	O
for	O
the	O
Möbius	O
function	O
of	O
an	O
interval	O
[ σ	O
,	O
π ]	O
in	O
the	O
permutation	B-Algorithm
pattern	I-Algorithm
poset	O
which	O
is	O
more	O
efficient	O
than	O
the	O
naïve	O
recursive	O
definition	O
.	O
</s>
<s>
The	O
first	O
such	O
result	O
was	O
established	O
by	O
,	O
who	O
gave	O
a	O
formula	O
for	O
the	O
Möbius	O
function	O
of	O
an	O
interval	O
of	O
layered	B-Algorithm
permutations	I-Algorithm
.	O
</s>
<s>
Later	O
,	O
generalized	O
this	O
result	O
to	O
intervals	O
of	O
separable	B-Algorithm
permutations	I-Algorithm
.	O
</s>
<s>
It	O
is	O
known	O
that	O
,	O
asymptotically	O
,	O
at	O
least	O
39.95	O
%	O
of	O
all	O
permutations	B-Algorithm
π	O
of	O
length	O
n	O
satisfy	O
μ(1, π )	O
=	O
0	O
(	O
that	O
is	O
,	O
the	O
principal	O
Möbius	O
function	O
is	O
equal	O
to	O
zero	O
)	O
,	O
but	O
for	O
each	O
n	O
there	O
exist	O
permutations	B-Algorithm
π	O
such	O
that	O
μ(1, π )	O
is	O
an	O
exponential	O
function	O
of	O
n	O
.	O
</s>
<s>
Given	O
a	O
permutation	B-Algorithm
(	O
called	O
the	O
text	O
)	O
of	O
length	O
and	O
another	O
permutation	B-Algorithm
of	O
length	O
(	O
called	O
the	O
pattern	O
)	O
,	O
the	O
permutation	B-Algorithm
pattern	I-Algorithm
matching	O
(	O
PPM	O
)	O
problem	O
asks	O
whether	O
is	O
contained	O
in	O
.	O
</s>
<s>
A	O
different	O
natural	O
variant	O
is	O
obtained	O
when	O
the	O
pattern	O
is	O
restricted	O
to	O
a	O
proper	O
permutation	B-Algorithm
class	O
.	O
</s>
<s>
This	O
problem	O
is	O
known	O
as	O
-Pattern	O
PPM	O
and	O
it	O
was	O
shown	O
to	O
be	O
polynomial-time	O
solvable	O
for	O
separable	B-Algorithm
permutations	I-Algorithm
.	O
</s>
<s>
Another	O
variant	O
is	O
when	O
both	O
the	O
pattern	O
and	O
text	O
are	O
restricted	O
to	O
a	O
proper	O
permutation	B-Algorithm
class	O
,	O
in	O
which	O
case	O
the	O
problem	O
is	O
called	O
-PPM	O
.	O
</s>
<s>
Albert	O
,	O
Lackner	O
,	O
Lackner	O
,	O
and	O
Vatter	O
later	O
lowered	O
this	O
to	O
and	O
showed	O
that	O
the	O
same	O
bound	O
holds	O
for	O
the	O
class	O
of	O
skew-merged	B-Algorithm
permutations	I-Algorithm
.	O
</s>
<s>
They	O
further	O
asked	O
if	O
the	O
-PPM	O
problem	O
can	O
be	O
solved	O
in	O
polynomial	O
time	O
for	O
every	O
fixed	O
proper	O
permutation	B-Algorithm
class	O
.	O
</s>
<s>
The	O
permutation	B-Algorithm
π	O
is	O
said	O
to	O
be	O
β-optimal	O
if	O
no	O
permutation	B-Algorithm
of	O
the	O
same	O
length	O
as	O
π	O
has	O
more	O
copies	O
of	O
β	O
.	O
</s>
<s>
An	O
unpublished	O
argument	O
of	O
Fred	O
Galvin	O
shows	O
that	O
the	O
quantity	O
inside	O
this	O
limit	B-Algorithm
is	O
nonincreasing	O
for	O
n	O
k	O
,	O
and	O
so	O
the	O
limit	B-Algorithm
exists	O
.	O
</s>
<s>
When	O
is	O
monotone	O
,	O
its	O
packing	O
density	O
is	O
clearly	O
1	O
,	O
and	O
packing	O
densities	O
are	O
invariant	O
under	O
the	O
group	O
of	O
symmetries	O
generated	O
by	O
inverse	O
and	O
reverse	O
,	O
so	O
for	O
permutations	B-Algorithm
of	O
length	O
three	O
,	O
there	O
is	O
only	O
one	O
nontrivial	O
packing	O
density	O
.	O
</s>
<s>
For	O
permutations	B-Algorithm
β	O
of	O
length	O
four	O
,	O
there	O
are	O
(	O
due	O
to	O
symmetries	O
)	O
seven	O
cases	O
to	O
consider	O
:	O
</s>
<s>
For	O
the	O
three	O
unknown	O
permutations	B-Algorithm
,	O
there	O
are	O
bounds	O
and	O
conjectures	O
.	O
</s>
<s>
Birzhan	O
Batkeyev	O
(	O
unpublished	O
)	O
constructed	O
a	O
family	O
of	O
permutations	B-Algorithm
showing	O
that	O
the	O
packing	O
density	O
of	O
1342	O
is	O
at	O
least	O
the	O
product	O
of	O
the	O
packing	O
densities	O
of	O
132	O
and	O
1432	O
,	O
approximately	O
0.19658	O
.	O
</s>
<s>
A	O
k-superpattern	O
is	O
a	O
permutation	B-Algorithm
that	O
contains	O
all	O
permutations	B-Algorithm
of	O
length	O
k	O
.	O
For	O
example	O
,	O
25314	O
is	O
a	O
3-superpattern	O
because	O
it	O
contains	O
all	O
6	O
permutations	B-Algorithm
of	O
length	O
3	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
vincular	O
pattern	O
is	O
a	O
permutation	B-Algorithm
containing	O
dashes	O
indicating	O
the	O
entries	O
that	O
need	O
not	O
occur	O
consecutively	O
(	O
in	O
the	O
normal	O
pattern	O
definition	O
,	O
no	O
entries	O
need	O
to	O
occur	O
consecutively	O
)	O
.	O
</s>
<s>
For	O
example	O
,	O
the	O
permutation	B-Algorithm
314265	O
has	O
two	O
copies	O
of	O
the	O
dashed	O
pattern	O
2-31-4	O
,	O
given	O
by	O
the	O
entries	O
3426	O
and	O
3425	O
.	O
</s>
<s>
For	O
a	O
dashed	O
pattern	O
β	O
and	O
any	O
permutation	B-Algorithm
π	O
,	O
we	O
write	O
β(π )	O
for	O
the	O
number	O
of	O
copies	O
of	O
β	O
in	O
π	O
.	O
</s>
<s>
These	O
patterns	O
were	O
introduced	O
by	O
,	O
who	O
showed	O
that	O
almost	O
all	O
known	O
Mahonian	O
statistics	O
could	O
be	O
expressed	O
in	O
terms	O
of	O
vincular	O
permutations	B-Algorithm
.	O
</s>
<s>
For	O
example	O
,	O
the	O
Major	B-Algorithm
index	I-Algorithm
of	O
π	O
is	O
equal	O
to	O
1-32(π )	O
+	O
2-31(π )	O
+	O
3-21(π )	O
+	O
21(π )	O
.	O
</s>
<s>
For	O
π	O
to	O
avoid	O
the	O
barred	O
pattern	O
β	O
means	O
that	O
every	O
set	O
of	O
entries	O
of	O
π	O
which	O
form	O
a	O
copy	O
of	O
the	O
nonbarred	O
entries	O
of	O
β	O
can	O
be	O
extended	O
to	O
form	O
a	O
copy	O
of	O
all	O
entries	O
of	O
β	O
.	O
introduced	O
these	O
types	O
of	O
patterns	O
in	O
his	O
study	O
of	O
permutations	B-Algorithm
which	O
could	O
be	O
sorted	O
by	O
passing	O
them	O
twice	O
through	O
a	O
stack	B-Application
.	O
</s>
<s>
(	O
Note	O
that	O
West	O
's	O
definition	O
of	O
sorting	O
twice	O
through	O
a	O
stack	B-Application
is	O
not	O
the	O
same	O
as	O
sorting	O
with	O
two	O
stacks	B-Application
in	O
series	O
.	O
)	O
</s>
