You are on page 1of 37

Chapter 6

Special Number
Stirling Number
Comes from mathematician James Stirling

(i) Stirling number of first kind

[ 𝑛
𝑘 ]
(ii) Stirling number of second kind

{ 𝑛
𝑘 }
Second Kind
-> Number of ways to partition n objects into k non-empty subset

-> n subset k

{1, 2, 3, 4} =?

1. {1, 2, 3} {4} 5. {1, 2} {3, 4}


2. {1, 2, 4} {3} 6. {1, 3} {2, 4}
3. {1, 3, 4} {2} 7. {1, 4} {2, 3}
4. {2, 3, 4} {1}

So, = 7
for small k:

k=1, i.e, 1 non-empty subset


= 1 ; n>0

k=0, i.e, 0 non-empty subset Since {} is an empty


= 0 ; n>0 set and we want
non-empty set
k=2, i.e, 2 non-empty subsets
=0; n=0

=0; n>0 =7 = 23-1

= 1 = 2-1
So, = 2n-1-1
=3 = 22-1
Last object itself
{ }
𝑛
𝑘
Last + (n-1) subset

=k+
=?

=?
First Kind
-> Count number of ways to arrange n objects into k cycles

-> n cycle k

[1, 2, 3, 4] =?

1. [1, 2, 3] [4] 7. [2, 3, 4] [1]


2. [1, 3, 2] [4] 8. [2, 3, 4] [1]
3. [1, 2, 4] [3] 9. [1, 2] [3, 4]
4. [1, 4, 2] [3] 10 [1, 3] [2, 4]
5. [1, 3, 4] [2] .
11 [1, 4] [2, 3]
6. [1, 4, 3] [2] .
So, = 11
1-cycle is equivalent to 1-set
2-cycle is equivalent to 2-set
But 3-cycle is not equivalent to 3-set
= = (n-1)!

=n

=1

= =
Put the object into the cycle itself ->

[ ]
𝑛
𝑘
Insert that object into one of the cycle
arrangement of the first (n-1) objects.

And there are (n-1) different ways of insertion

= (n-1) +
Eulerian Number
-> Represented by

-> n ascent k
-> all numbers should be unique

1 < 3 > 2 < 4


Count = 0

Yes
-> Represented by

-> n ascent k
-> all numbers should be unique

1 < 3 > 2 < 4


Count = 1

Yes No
-> Represented by

-> n ascent k
-> all numbers should be unique

1 < 3 > 2 < 4


Count = 1

Yes
-> Represented by

-> n ascent k
-> all numbers should be unique

1 < 3 > 2 < 4


Count = 2

Yes

So, total ascent = 2


=?
Find and of {1, 2, 3}

π1 π2 π3
1 2 3
1 3 2
2 1 3
2 3 1
3 1 2
3 2 1
Find and of {1, 2, 3}

π1 π2 π3
1 < 2 < 3
1 < 3 > 2
2 > 1 < 3
2 < 3 > 1
3 > 1 < 2
3 > 2 > 1
Find and of {1, 2, 3}

π1 π2 π3 #Ascent
1 < 2 < 3 2
1 < 3 > 2
2 > 1 < 3
2 < 3 > 1
3 > 1 < 2
3 > 2 > 1
Find and of {1, 2, 3}

π1 π2 π3 #Ascent
1 < 2 < 3 2
1 < 3 > 2 1
2 > 1 < 3
2 < 3 > 1
3 > 1 < 2
3 > 2 > 1
Find and of {1, 2, 3}

π1 π2 π3 #Ascent
1 < 2 < 3 2
1 < 3 > 2 1
2 > 1 < 3 1
2 < 3 > 1
3 > 1 < 2
3 > 2 > 1
Find and of {1, 2, 3}

π1 π2 π3 #Ascent
1 < 2 < 3 2
1 < 3 > 2 1
2 > 1 < 3 1
2 < 3 > 1 1
3 > 1 < 2
3 > 2 > 1
Find and of {1, 2, 3}

π1 π2 π3 #Ascent
1 < 2 < 3 2
1 < 3 > 2 1
2 > 1 < 3 1
2 < 3 > 1 1
3 > 1 < 2 1
3 > 2 > 1
Find and of {1, 2, 3}

π1 π2 π3 #Ascent
1 < 2 < 3 2
1 < 3 > 2 1
2 > 1 < 3 1
2 < 3 > 1 1
3 > 1 < 2 1
3 > 2 > 1 0

∴= 4& =1
n Sum
0 1
1 1 0
2 1 1 0
3 1 4 1 0
4 1 11 11 1 0
5 1 26 26 26 11 0
n Sum
0 1 1=0!
1 1 0
2 1 1 0
3 1 4 1 0
4 1 11 11 1 0
5 1 26 26 26 11 0
n Sum
0 1 1=0!
1 1 0 1=1!
2 1 1 0
3 1 4 1 0
4 1 11 11 1 0
5 1 26 26 26 11 0
n Sum
0 1 1=0!
1 1 0 1=1!
2 1 1 0 2=2!
3 1 4 1 0
4 1 11 11 1 0
5 1 26 26 26 11 0
n Sum
0 1 1=0!
1 1 0 1=1!
2 1 1 0 2=2!
3 1 4 1 0 6=3!
4 1 11 11 1 0
5 1 26 26 26 11 0
n Sum
0 1 1=0!
1 1 0 1=1!
2 1 1 0 2=2!
3 1 4 1 0 6=3!
4 1 11 11 1 0 24=4!
5 1 26 26 26 11 0
n Sum
0 1 1=0!
1 1 0 1=1!
2 1 1 0 2=2!
3 1 4 1 0 6=3!
4 1 11 11 1 0 24=4!
5 1 26 66 26 1 0 120=5!
=
1 < 4 > 2 < 3
Ascent = 2

Ascent Not Ascent Ascent


Position Position Position
Insert 5 at last: Insert 5 at first:
1 < 4 > 2 < 3 < 5 5 > 1 < 4 > 2 < 3
Ascent = 3 Ascent = 2
Insert 5 at Ascent Position:
1 < 5 > 4 > 2 < 3 1 < 4 > 2 < 5 > 3
Ascent = 2 Ascent = 2
Insert 5 at Not Ascent Position:
1 < 4 < 5 > 2 < 3
Ascent = 3
To increase k, we need to insert at Not-Ascent Position or at last.

If k-1 ascents are present in the array, then we try to increase k-1 to k to calculate

To keep the value of k same, we need to insert at Ascent Position or at first

The permutation has k ascents. Place n in first or ascent position

⟨ ⟩
𝑛
𝑘
+k

The permutation has k-1 ascents. Place n in last or not-ascent position


+ (n-1-k)

So, = + k + + (n-1-k)
= (k+1) + (n-k)

You might also like