P
P
A
A
T
T
T
T
E
E
R
R
N
N
P
P
O
O
P
P
U
U
L
L
A
A
R
R
I
I
T
T
Y
Y
I
I
N
N
Γ
Γ
11−
−
N
N
O
O
N
N
D
D
E
E
R
R
A
A
N
N
G
G
E
E
D
D
P
P
E
E
R
R
M
M
U
U
T
T
A
A
T
T
I
I
O
O
N
N
S
S
:
:
A
A
N
N
A
A
L
L
G
G
E
E
B
B
R
R
A
A
I
I
C
C
A
A
N
N
D
D
A
A
L
L
G
G
O
O
R
R
I
I
T
T
H
H
M
M
I
I
C
C
A
A
P
P
P
P
R
R
O
O
A
A
C
C
H
H
K
K
.
.
O
O
.
.
A
A
r
r
e
e
m
m
u
u
,
,
A
A
.
.
H
H
.
.
I
I
b
b
r
r
a
a
h
h
i
i
m
m
,
,
S
S
.
.
B
B
u
u
o
o
r
r
o
o
,
,
F
F
.
.
A
A
.
.
A
A
k
k
i
i
n
n
o
o
l
l
a
a
Department of Mathematics, Usmanu Danfodiyo University Sokoto, P.M.B. 2346, Sokoto, Nigeria
Corresponding author: K. O. Aremu, [email protected]
ABSTRACT: Given a permutation pattern say
1... k Sk
and permutation
1... nSn, we say that
contains the pattern
if there exist1
1 i ... ik n such thatred( i1... ik) . Each subsequence in
is known as an occurrence of the pattern
. Conversely, if there exist no occurrence of
in
, then we say that the permutation
avoids the pattern
. The popularity of a pattern
is the total number of copies of
within all permutations of a set. In this work, we address popularity of length-3 patterns in1
non deranged permutations in two approaches; algebraically and algorithmically. We first establish algebraically that pattern
1 is the most popular andpattern
3,
4 and
5 are equipopular in 1p
G . We further
provide efficient algorithms that also report same results on popularity and equipopularity of patterns of length-3 in
1
p
G as obtained by the algebraic approach.
KEYWORDS: Permutation, Pattern, Popularity, Equipopularity, Sorting.
1. INTRODUCTION
Permutation is a mathematical concept, which appears in various mathematical and practical problems. For example, sorting, ordering, matching and so on can be described as permutation problem. Permutation did not simply spring into existence, but rather, it is the culmination of a long period of mathematical investigation. Patterns in permutations have been studied over a long period of time; it has been an active field of research with over hundreds of articles published in the past few decades. There are several notable survey papers on this subject, a few includes ([Zha14, Rud13, Ste10]).
There are several notions of patterns in different combinatorial objects, e.g. permutations, graphs, matrices, words, compositions, etc. Permutation patterns include; classical patterns, barred patterns, vincular patterns, bivincular patterns and partial ordered patterns. The classical patterns was introduced by Knuth in 1968 but was much studied by Simon and Schmist in 1985. The notion was
further extended to word by Burstein in 1998 and later generalised for word by Burstein & Mansour in 2002. The Barred pattern was introduced for permutation by West in 1990. In 2002, the Vincular pattern (Generalized patterns) was introduced for permutation by Babson and Steingrimsson. This pattern (Vincular) was extended to word by Bustein & Mansour in 2003. The Bivincular pattern was introduced for permutations by Bousquet-Melou, Claesson, Dukes, and Kitaev in 2010. Kitaev introduced partially ordered patterns for permutations in 2003. The pattern (bivincular) was later extended to word by Kitaev & Mansour. [Kit11]
With no doubt, patterns in permutations have been well studied for over a century. As seems to be the case, these patterns were studied on permutations arbitrarily. The Symmetric group Sn is the set of all permutations of a set of cardinality n. There are several types of other smaller permutation groups (Subgroup ofSn) of set, a notable one among them is the alternating groupAn. Recently, [Are16] proposed a permutation group called the 1- non deranged permutation group denoted as 1
p
G . A permutation in this group is expressed as a sequence of 1 and numbers of integer modulo p where p is a prime and greater than or equal to 5. More precisely, this work will be centred on the 1- non deranged permutations as the notion of pattern popularity has never been studied on this set of permutations. In this present work, a review of length-3 classical patterns in 1
p
G is presented. 1
p
G is examined for certain properties (namely, containment and avoidance). In truth, it would be more correct to say that the approach of this research is both algebraic and algorithmic techniques, which accidentally obtain interesting results.
A permutation
on the set { ,
1 ,
n} is a sequence of distinct letters
(1),
( )n such that1
( ) { ,i , n}
1, 2, n
a a a
is of the form(1 ) (1 2 ) (1 ( 1) )
i i mp i mp p i mp
where n
= p and p is a prime greater than or equal to 5. [Are17]. An occurrence of a pattern
in a permutation
is a subsequence in
whose letters are in the same relative order as those in
. So, a
- avoiding permutation is a permutation that does not contain the pattern
. The popularity PS( )
of a pattern
in a set Sof permutations [Rud13]( ) ( , )
S
S
P f
2. EQUIPOPULARITY OF PATTERNS IN 1-
NON DERANGED PERMUTATIONS
When two patterns occur equally in a set of permutation, we say that these patterns are equipopular. In particular, this subsection addresses length-3 patterns that are equally popular in 1
p
G . To prove some of the results in this section, we introduce some new notions on permutations. Definition 2.1
A permutation
(1) (2)... ( )
n is increasing if ( )i and
(i1)are two successive element such that
( )i
(i1) and decreasing if( )i (i 1)
. Let
and be two non-negative integers such that
is the number of times of all increment and number of times of decrement in
, we then define
as a
sequence: i. completely increasing if = 0 ii. completely decreasing if
= 0iii. equally increasing and decreasing if iv. almost increasing if
v. almost decreasing if
Example 2.1 Consider the permutations
1 = 1234567,
2= 1357246 and
4 = 1526374. Then,1
is a completely increasing sequence,
2 is an almost increasing sequence and
4 is an equally increasing and decreasing sequence.Definition 2.2. A permutation
is said to contain a break in sequence if there exists any two successive elements of
such that|
( )i
(i 1) | 1Remark 2.2. For simplicity, we let
1= 123,
2= 132,3
= 213,
4= 231,
5= 312,
6= 321 be all length-3patterns. By the above definition, we see that
3,
4,
5, have breaks while
1,
2,
6 have no break.Lemma 2.3. Let 1
i p
G . Then every
i eand1
i p
has a break between
i( )j and
i(j1).Proof. Since every 1
i p
G is an arithmetic progression of modulo p,
i( )j and
i(j1) will not be in the equivalence classes [j] and [j + 1] modulo p respectively, and hence,|
i( )j
i(j 1) | 1
Definition 2.3. A pair in a permutation
is a subsequence ( ( ) ( ))
i j of
, such that i < j. Lemma 2.4. Let
i, j 1p
G and P[
i]denote the set of pairs of
i. Then the following hold after deleting 1, the fix point of any
i:i. 1
[ i] [ i ]
P P
ii. ( [P
i]P[
i1])( [P
j]P[
j1]) iii. | [P
i]P[
i1] | | [ P
j]P[
j1] | Example 2.5. Let P[ ] { :
P ii } be the set of pairs of
. The length-3 containments of
are given as { (1)Pi Pj:Pi(1)Pj(1),i j}Remark 2.6. Every containment of a pattern in a permutation can be expressed as subsequences of increasing and/or decreasing pairs. Equivalently, pairs of a permutation can be concatenated to form any length k containment.
The next result shows the length-3 patterns that are equipopular in 1
p
G which is also validated by an algorithm.
Theorem 2.7. Let
i be a permutation in 1p
G and and 1 i 6) be a pattern of length-3. If
1 ( )i
P
G is the popularity of a pattern
iin1
p
G , then
1( 3) 1( 4) 1( 5).
p p p
PG PG PG
Proof. We want to show that
1( 3) 1( 4) 1( 5)
p p p
PG PG PG m such that
. The pattern
1and
6 have no breaks and thus their pairs are completely increasing and completely decreasing subsequences respectively. Therefore, by Lemma 2.3, 1( 6) .p
PG m Also by Lemma 2.3 and
Remark 2.6, 1( )1 ,
p
1,
3,
4 and
5 avoidp1. Hence, since each of3,
4 and
5 has a break,1( 3) 1( 4) 1( 5)
p p p
P P P m
G G G holds by
definition 2.3 and remark 2.6.
Remark 2.8. Suppose
A { ,
1 2, 3, 4, 5, 6}is the set of all length-3 patterns, the pattern
3,
4 and5
are equipopular in 1p
G . We write
3 4 5
{ , , }
E
to be set of equipopular patterns which is subset of
A. For convenience, we represent the equipopular patterns with
E throughout the rest of this work.Definition 2.4. A permutation
contains another permutation
as a pattern (denoted
) if the plot of
contains a subset which is equivalent to the plot of
. The number of occurrences of
in
(denotedV( )
) is the number of such subsets.Algorithm 1: Algorithm to show that the pattern
3,
4and
5 are equally popular in 1p
G
Input: Input any
1p
G i nt o an array
Output: Number of occurrence of the pattern
3,
4 and
51: Begin
2: Set integer c = 0 3: for i = 1 to n − 1
4: for j = i + 1 to n − 2
5: for k = j + 1 to n
6: Case I: τ3
7: if a[k] > a[i]
8: if a[i] > a[j]
9: Case II: τ4
10: if a[i] > a[k]
11: if a[j] > a[i]
12: Case III: τ5
13: ifa[i] > a[k]
14: if a[k] > a[j]
15: Increment c by 1 16: end if
17: end if 18: end for 19: end for 20: end for 21: End
The algorithm above helps to show that for every 1,
i p
G
3( i) 4( i) 5( i)
V V V
Implementing the algorithm validates Theorem 2.7
Table 1: Popularity of
3,
4and
5 in 1p
G
1
p
G
3
4
55 2 2 2
7 16 16 16
11 168 168 168
13 382 382 382
17 1320 1320 1320
19 2184 2184 2184
23 5096 5096 5096
3. POPULARITY OF PATTERNS IN 1- NON DERANGED PERMUTATION
The popularity of a pattern
is the total number of copies of \tau within all permutation of a set. [Rud13]. We begin this section, with some basic results on which the main result of this section is built.Lemma 3.1. Every
1 and 1 1p p
G , are completely increasing and almost decreasing sequences.
Proposition 3.2. Suppose 1
i p
G such that i = 1, p - 1 and if
E represents the equipopular patternsthen ( ) 0
E i
V
Proof. Since every 1
i p
G such that i = 1, p - 1 are completely increasing and almost decreasing sequences respectively, therefore, a subsequence that is an almost decreasing sequence does not exist in a completely increasing and almost decreasing sequence respectively. Thus, ( ) 0
E i
V
1, 1
i p
. Hence the result.
Lemma 3.3. Let j and
kbe two patterns such thatj
has fixed at the first element,
khas no fixed and both do not avoid 1i p
G . Then ( ) ( )
j i k i
V
V
Theorem 3.4. Let 1p
G be a set 1- non deranged permutations, then the pattern
1 is the most popular pattern in 1p
G .
Proof. To prove that the pattern
1 is the mostpopular pattern of
Ain 1p
G , we only need to show that 1( )1
p
PG is greater than any other 1( )
p i
PG . First,
we show that 1( )1 1( )
p p E
PG PG and
1( 2) 1( )
p p E
PG PG . Since the first entry of every
1
i p
occurrences of the equipopular patterns in 1
p
G
compared to
1 and
2 by Lemma 3.3. Thus,1( )1
p
PG and 1( 2)
p
PG strictly greater than 1( )
p E
PG .
Since
1 and p1 avoid pattern
E by proposition 3.2, therefore, 1( 6) 1( )p p E
PG PG . Next we show
that 1( 2) 1( 6)
p p
PG PG . Since pattern
2 fixes 1then this holds by Lemma 3.3. Note again that 1( )1 1( 2)
p p
PG PG because the pattern
1 andevery
1are completely increasing sequences and have no break. Therefore, pattern
1 is the most popular pattern in 1p
G . Hence the result.
Theorem 3.5. Let 1
p
G be a set of 1- non deranged permutations, and
E is the equipopular pattern. Then
Eis the least popular pattern in 1.p
G
Proof. It is immediate from the proof of theorem 3.4
and lemma 3.3.
Lemma 3.6. Suppose 1
i p
G then the popularity of the patterns forms a chain
1( ) 1( 6) 1( 2) 1( )1
p E p p p
PG PG PG PG
Proof. Since the first entry of the pattern
2 fixes 1,then by Lemma 3.3 1( 2) 1( 6)
p p
PG PG . Also since
1
is the most popular by theorem 3.4 and
Eis the least popular by theorem 3.5 in 1p
G , hence the result. In what follows, we provide an algorithm that analyses all length-3 patterns in 1
p
G where
5 p 23.
Algorithm 2: Algorithm to show that the number of
occurrence of
A in 1p
G
Input: Input any 1
i p
G into an array Output: Number of occurrence of
A in
i 1: Begin2: Set integer c = 0 3: for i = 1 to n − 1
4: for j = i + 1 to n − 2
5: for k = j + 1 to n
6: Case I: τ3
7: if a[k] > a[i]
8: if a[i] > a[j]
9: Case II: τ4
10: ifa[i] > a[k]
11: if a[j] > a[i]
12: Case III: τ5
13: ifa[i] > a[k]
14: if a[k] > a[j]
15: Case IV: τ1
16: if a[j] < a[k]
17: if a[i] < a[j]
18: Case V: τ2
19: if a[j] > a[k]
20: if a[k] > a[i]
21: Case VI: τ6
22: ifa[i] > a[j]
23: if a[j] > a[k]
24: Increment c by 1
25: end if
26: end if 27: end for 28: end for 29: end for 30: End
Hereafter, we implemented the above algorithm and observed that the pattern
1 is the most popular pattern and
Eis the least popular patterns in 1p
G .
The algorithm validates theorem 3.4, theorem 3.5 and lemma 3.6.
Table 2: Pattern popularity in 1
p
G for prim size 5 to 23
1
p
G
1
2
6
4
5
35 16 14 4 2 2 2
7 73 61 28 16 16 16 11 489 393 264 168 168 168 13 952 778 556 382 382 382 17 2800 2280 1840 1320 1320 1320 19 4353 3561 2976 2184 2184 2184 23 9289 7637 6748 5096 5096 5096
Lemma 3.7. Let 1
i Gp
. Then
i and 1i
have equal number of increasing pairs and equivalently, equal number of decreasing pairs.
Proof . Let
1
1 2 ...
.
(1) (2) ... ( ) p
p
p
G
The inverse of
is given as1
(1) (2) ... ( )
,
1 2 ... p
p
p
whenever
(1)
(2) ...
( )p . From above we have that
( )j comes after ( ) i as an image in the inverse permutation whenever( ( ))j ( ( ))i
Since 1
[ i] [ i ]
P P by lemma 2.4(i),
1 1
( [P
i]P[
i ])( [P
j]P[
j ]) by lemma 2.4(ii) and by( ( ))j ( ))i
the result follows.
Proposition 3.8. Suppose 1
i p
G then,
1 ( i) ( i )
V V
Proof. Since every containment of any pattern is a
concatenation of increasing and/or decreasing pairs by remark 2.6, and also
i and i1 have equal number of increasing pairs and equivalently, equal number of decreasing pairs by lemma 2.4, then the proposition follows. Proposition 3.9. Suppose 1
i p
G ,
1( p 1) 0
V
Proof. Every 1
1
p p
G is an almost decreasing sequence and the pattern
1 is a completely increasing sequence. Thus, there does not exist a subsequence that is almost increasing in an almost decreasing sequence. Therefore,1( p 1) 0.
V
Hence the result.
Below is an algorithm that validates proposition 3.9.
Algorithm 3: Algorithm to show that the involution of
any Γ1 non-deranged permutation avoids
1Input: Input a n y 1 1
p p
G i n t o a n a r ra y.
Output: Zero 1: Begin
2: Set integer c = 0 3: for i = 1 to n − 1
4: for j = i + 1 to n − 2
5: for k = j + 1 to n
6: if a[j] < a[k]
7: if a[i] < a[j]
8: Increment c by 1 9: end if
10: end if 11: end for 12: end for 13: end for 14: End
Proposition 3.10. Suppose 1
i p
G then,
2( 1) 0
V
Proof. Given that every 1
1 p
G is a completely increasing sequence and the pattern
2is an almost increasing sequence. Then, there does not exist an almost increasing subsequence in a completely increasing sequence. Thus,2( 1) 0
V . Hence the
result.
Below is an algorithm that validates proposition 3.10.
Algorithm 4: Algorithm to show every 1
1 p
G
avoids
2Input: Input any 1
1 p
G into an array a Output: Zero
1: Begin
2: Set integer c = 0 3: for i = 1 to n − 1
4: for j = i + 1 to n − 2
5: for k = j + 1 to n
6: if a[j] > a[k]
7: if a[k] > a[i]
8: Increment c by 1
9: end for 10: end for
11: end for 12: end if 13: end if 14:End
A permutation ω is sortable through a system of stacks and queues if an identity permutation, 12...n could be obtained by passing ω through the system of stacks and queues exactly once, making very careful decisions in such away the order of the permutation is not made to be more disorderly. Theorem 3.11. [Knu73] A permutation is sortable through a single stack if and only if it avoids the pattern 231.
Lemma 3.12. Suppose 1
i p
G such that i = 1, p - 1. Then
1and p1are stack sortable.Proof. To show that every
1and p1 in 1p
G are
pattern
4. Since every
1 and 1 1p p
G are completely increasing and almost decreasing sequences. Then there cannot exist a subsequence that is an almost increasing sequence in a completely increasing and almost decreasing sequence respectively. Thus,
4( i)
V will always be zero for i = 1 and p - 1. Hence, by Theorem 3.11, every
1 and p1 in 1p
G are stack sortable. Hence the result. We end this section by explicitly providing a summary of tables of the number of occurrence
E for 5 p 23 in 1p
G (Tables 3 to 6).
Table 3: Number of occurrence of pattern
1 in 1-non deranged permutations for prime size 5 to 23
1
5
G G7 G11 G13 G17 G19 G23
1
10 35 165 286 680 969 17712
3 13 70 125 308 444 8253
3 6 55 76 235 290 6234
0 13 55 50 140 309 5615
6 15 61 155 309 4266
0 70 21 235 119 5617
22 125 155 221 3308
22 61 36 164 6239
15 76 308 45 26510
0 50 121 444 33011
21 65 221 6612
0 121 164 82513
140 290 35314
65 100 42615
36 100 14016
0 119 35317
45 17018
0 26519
17020
14021
6622
0TOTAL 16 73 489 952 2800 4353 9289
Table 4: Number of occurrence of
2 in 1 - nonderanged permutation of prime size 5 to 23
2
5
G G7 G11 G13 G17 G19 G23
1
0 0 0 0 0 0 02
4 10 35 56 120 165 2863
4 13 40 70 140 203 3364
6 10 40 76 160 200 3505
13 50 74 158 200 3756
15 35 80 140 230 3507
49 56 158 218 3898
49 74 168 227 3369
50 70 120 228 39610
45 76 164 165 38911
80 170 218 38512
66 164 227 28613
160 203 38614
170 233 37515
168 233 39916
120 230 38617
228 40118
153 39619
40120
39921
38522
231Table 5: Number of occurrence of
E in 1 - nonderanged permutation of prime size 5 to 23
E
5
G G7 G11 G13 G17 G19 G23
1
0 0 0 0 0 0 02
1 4 20 35 84 120 2203
1 4 22 40 95 140 2524
0 4 22 40 100 140 2605
4 20 41 101 140 2706
0 20 35 95 140 2607
22 35 101 146 2728
22 41 84 146 2529
20 40 84 120 27010
0 40 101 120 27211
35 95 146 22012
0 101 146 22013
100 140 27214
95 140 27015
84 140 25216
0 140 27217
120 26018
0 27019
26020
25221
22022
0TOTAL 2 0 2 382 1320 1702 5096
Table 6: Number of occurrence of
6 in 1 - nonderanged permutation of prime size 5 to 23
6
G5 G7 G11 G13 G17 G19 G23
1
0 0 0 0 0 0 02
0 0 0 0 0 0 03
0 4 4 20 20 56 564
4 0 4 40 80 40 805
4 40 28 64 40 1606
20 0 80 20 200 807
28 0 64 92 2368
28 28 224 140 569
40 20 0 336 30010
120 40 92 0 23611
80 160 92 66012
220 92 140 013
80 56 21614
160 216 16015
224 216 47616
560 200 21617
336 42018
816 30019
42020
47621
66022
15404. CONCLUSION
In this research, we introduced algorithms to examine all length-3 classical patterns in 1
p
G .
Implementing the algorithms, we have shown that pattern
3,
4 and
5 are equipopular. We have experimentally determined the popularity of all patterns of length-3 in 1p
G by computing the occurrence of all patterns of length-3 in 1- non deranged permutation. We computed for prime size 5 to 23 and observed that pattern
1is the most popular while the least popular are the equipopular patterns in 1p
G . The algorithm further shows that for
any 1
i p
G , the number of occurrence of a pattern in
i will be equal to the number of occurrence of the same pattern in its inverse. Based on the facts obtained after implementing the algorithm, it is sufficient to conclude that the entire results coincide algebraically.REFRENCES
[AEA17] Aremu K. O., Ejima O., Abdullahi M. S. - On the fuzzy 1-non deranged
permutation group 1
p
G , Asian Journal of Mathematics and Computer Research, 18(4) 2017, pp. 152-157.
[AOA16] Aminu I. A., Ojonugwa E., Aremu K. O. - On the Representations of 1- Non
deranged Permutation Group Gp ,
Advances in Pure Mathematics, 2016, 6, (09), pp. 608-614.
[Kit11] Kitaev S. - Patterns in permutations
and words. Springer Science &
Business Media, 2011.
[Knu73] Knuth D. E. - Fundamental algorithms: the art of computer
programming. 1973.
[Rud13] Rudolph K. - Pattern popularity in
132-avoiding permutations, The
Electronic Journal of Combinatorics 20(1). 2013.
[Ste10] Steingrımsson E. - Generalized
permutation patterns-a short survey,
Permutation patterns Steve Linton, Nik Ruškuc and Vincent Vatter, Ed. Cambridge University Press 2010, 376, pp. 137-152.
[Zha14] Zhao A. F. - Pattern Popularity in
Multiply Restricted Permutations,