Cycle of Permutation
Cycle of Permutation
Cycle of Permutation
Cycles in Permutations
Prof. Tesler
Math 184A
Winter 2019
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 1 / 31
Notations for permutations
f = 6 5 2 7 1 3 4 8
f (1) = 6 f (5) = 1
f (2) = 5 f (6) = 3
f (3) = 2 f (7) = 4
f (4) = 7 f (8) = 8
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 2 / 31
Cycles in permutations
f = 65271348
Draw a picture with points numbered 1, . . . , n and arrows i → f (i).
1 6 4 7
5 3 8
2
Each number has one arrow in and one out: f −1 (i) → i → f (i)
Each chain closes upon itself, splitting the permutation into cycles.
The cycle decomposition is f = (1,6,3,2,5)(4,7)(8)
If all numbers are 1 digit, we may abbreviate: f = (16325)(47)(8)
The cycles can be written in any order.
Within each cycle, we can start at any number.
f = (1, 6, 3, 2, 5)(4, 7)(8) = (8)(7, 4)(3, 2, 5, 1, 6) = · · ·
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 3 / 31
Multiplying permutations
f = (1, 2, 4)(3, 6)(5) = 246153
g = (1, 3)(2, 5)(4, 6) = 351624
There are two conventions for multiplying permutations,
corresponding to two conventions for composing functions.
Left-to-right composition (our book and often in Abstract Algebra)
( f g)(i) = g( f (i)) ( f g)(1) = g( f (1)) = g(2) = 5
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 7 / 31
Type of a permutation
The type of a permutation is the integer partition formed from
putting the cycle lengths into decreasing order:
f = 6 5 2 7 1 3 4 8 = (1, 6, 3, 2, 5)(4, 7)(8) type( f ) = (5, 2, 1)
The order of the whole cycles can be changed while keeping the
pattern, e.g., (1, 2, 3)(4, 5, 6) = (4, 5, 6)(1, 2, 3).
Divide by 5! ways to reorder the cycles.
Total:
15!
5
= 44844800
3 · 5!
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 9 / 31
General formula for the number of permutations of each type
Case: Insert (6) as a new cycle; there is only one way to do this:
(1, 4, 2)(3, 5)(6)
To obtain k cycles, insert 6 into a permutation of [5] with k cycles (if
added to an existing cycle) or k − 1 cycles (if added as a new cycle).
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 12 / 31
Recursive formula for c(n, k)
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 13 / 31
Initial conditions for c(n, k)
When n = 0 or k = 0
n = 0: Permutations of ∅
There is only one “empty function” f : ∅ → ∅.
It is vacuously one-to-one, onto, and a bijection.
As a permutation, it has no cycles.
c(0, 0) = 1 and c(0, k) = 0 for k > 0.
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 14 / 31
Table of values of c(n, k)
Compute c(n, k) from the recursion and initial conditions:
c(0, 0) = 1 c(n, k) = (n − 1) · c(n − 1, k)
c(n, 0) = 0 if n > 0 + c(n − 1, k − 1)
c(0, k) = 0 if k > 0 if n > 1 and k > 1
n=1 0
n=2 0
n=3 0
n=4 0
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 15 / 31
Table of values of c(n, k)
Compute c(n, k) from the recursion and initial conditions:
c(0, 0) = 1 c(n, k) = (n − 1) · c(n − 1, k)
c(n, 0) = 0 if n > 0 + c(n − 1, k − 1)
c(0, k) = 0 if k > 0 if n > 1 and k > 1
n=1 0
n=3 0 c(n, k)
n=4 0
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 16 / 31
Table of values of c(n, k)
Compute c(n, k) from the recursion and initial conditions:
c(0, 0) = 1 c(n, k) = (n − 1) · c(n − 1, k)
c(n, 0) = 0 if n > 0 + c(n − 1, k − 1)
c(0, k) = 0 if k > 0 if n > 1 and k > 1
n=1 0 1 0 0 0 1
·1 ·1 ·1 ·1
n=2 0 1 1 0 0 2
·2 ·2 ·2 ·2
n=3 0 2 3 1 0 6
·3 ·3 ·3 ·3
n=4 0 6 11 6 1 24
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 17 / 31
Generating function for c(n, k)
Theorem
Let n be a positive integer. Then
Xn
c(n, k)x k = x(x + 1) · · · (x + n − 1)
k=0
Example
For n = 3: x(x + 1)(x + 2) = 2x + 3x2 + x3
= 0x0 + 2x1 + 3x2 + 1x3
Compare with row n = 3 of the c(n, k) table: 0 2 3 1
Proof:
Base case n = 1: c(1, 0) + c(1, 1)x = 0 + 1x = x
X
n−1
!
x(x + 1) · · · (x + n − 1) = c(n − 1, k)x k (x + n − 1)
k=0
Substitute x → −x :
Xn
c(n, k)(−1)k x k = (−x)(−x + 1) · · · (−x + n − 1)
k=0 = (−1)n x(x − 1) · · · (x − n + 1) = (−1)n (x)n
X
n
Multiply by (−1)n : (−1)n−k c(n, k)x k = (x)n
k=0
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 22 / 31
Signs in the Stirling Number of the First Kind
X
n
s(n, k)x k = (x)n = x(x − 1)(x − 2) · · · (x − n + 1)
k=0
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 23 / 31
Duality between Stirling numbers of the first and
second kind
X
n X
n
xn = S(n, k) · (x)k (x)n = s(n, k)x k
k=0 k=0
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 24 / 31
Linear algebra interpretation
A basis of the space of polynomials is x0 , x1 , x2 , . . . Any polynomial
can be expressed as a unique linear combination of these.
(x)0 , (x)1 , (x)2 , . . . is also a basis!
(x)n has leading term 1x n . E.g., (x)3 = x(x−1)(x−2) = x3 −3x2 +2x.
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 26 / 31
n
Pn Pn k
Lin. alg. interp. of x = k=0 S(n, k) (x)k and (x)n = k=0 s(n, k)x
X
n
c(n, k)x k = x(x + 1) · · · (x + n − 1)
k=0
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 28 / 31
Proof using weights
Optional material to read after we cover Chapter 8
In elements of A:
1st number is 1
2nd number is 1 or 2
3rd number is 1, 2, or 3
Etc.
So |A| = n!.
Example: [1, 2, 1, 3, 3, 6] ∈ A, but [1, 3, 1, 2, 3, 6] < A.
We’ll give a bijection between A and permutations of [n]. It works
similarly to the recursion for c(n, k) from earlier in these slides, so
review that if you need to.
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 29 / 31
Proof using weights
Optional material to read after we cover Chapter 8
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 30 / 31
Proof using weights
Optional material to read after we cover Chapter 8
At step j,
1 choice adds weight 1;
j − 1 choices add weight 0,
so step j contributes a factor 1x1 + ( j − 1)x0 = x + j − 1.
Qn
The total weight over j = 1, . . . , n is j=1 (x + j − 1).
Prof. Tesler Ch. 6.1. Cycles in Permutations Math 184A / Winter 2019 31 / 31