Professional Documents
Culture Documents
Chapter 1
Fundamental Principles of Counting
Textbook: Discrete and Combinatorial Mathematics:
An Applied Introduction 5rd edition,
by Ralph P. Grimaldi
Course Outlines:
1. Fundamental Principles of Counting
2. Fundamentals of Logic
3. Set Theory
4. Mathematical Induction
5. Relations and Functions
6. Languages: Finite State Machines
7. The principle of Inclusion and Exclusion
8. Generating Functions
9. Recurrence Relations
10. Graph Theory
11. Number Theory
2
Chapter 1: Fundamental Principles of Counting
3
Chapter 1: Fundamental Principles of Counting
4
Chapter 1: Fundamental Principles of Counting
ways m1 m2 m3 mk
5
Chapter 1: Fundamental Principles of Counting
6
Chapter 1: Fundamental Principles of Counting
26+26x10=286
8
Chapter 1: Fundamental Principles of Counting
1.2 Permutations
9
Chapter 1: Fundamental Principles of Counting
1.2 Permutations
n個選r個的排列方法
n!
n ( n 1) ( n 2 ) . . . ( n r 1) P( n , r )
(n r ) !
if repetitions are allowed: nr
10
Chapter 1: Fundamental Principles of Counting
1.2 Permutations
11
Chapter 1: Fundamental Principles of Counting
1.2 Permutations
8!/(5!3!)=56
12
Chapter 1: Fundamental Principles of Counting
Combinatorial Proof
E.g. 1.15 Prove that if n and k are positive integers with n=2k,
then n!/2k is an integer.
Their permutation is n! n!
k
2
! 2
!. .
.
2! 2
k
must be an integer
13
Chapter 1: Fundamental Principles of Counting
circular permutation
E.g. 1.16 6 people are seated about a round table, how many
different circular arrangements are possible, if
arrangements are considered the same when one can
be obtained from the other by rotations?
ABCDEF,BCDEFA,CDEFAB,DEFABC,EFABCD,FABCDE
are the same arrangements circularly.
6!/6=5! (in general, n!/n)
14
Chapter 1: Fundamental Principles of Counting
circular permutation
15
Chapter 1: Fundamental Principles of Counting
16
Chapter 1: Fundamental Principles of Counting
17
Chapter 1: Fundamental Principles of Counting
18
Chapter 1: Fundamental Principles of Counting
19
Chapter 1: Fundamental Principles of Counting
20
Chapter 1: Fundamental Principles of Counting
without adjacent A: 8! 9
2 !2 !2 ! 3
disregard A first 9 positions for 3 A
to be inserted
Challenge: Mississippi相同字母不相鄰的排列?
(Write a program to verify your answer.)
21
Chapter 1: Fundamental Principles of Counting
For example, n n n ( n 1)
1 n , i 1 2 n
i 1 i1 2
n n ( n 1)( 2 n 1) n 3
i ,i ?
2
i 1 6 i 1
22
Chapter 1: Fundamental Principles of Counting
23
Chapter 1: Fundamental Principles of Counting
24
Chapter 1: Fundamental Principles of Counting
n j n
a i b j b j ( a1 a 2 a j )
j 1i 1 j 1
n
a1b1 ( a1 a 2 ) b2 bn a i
i 1
25
Chapter 1: Fundamental Principles of Counting
The Pi notation
n
a i a1 a 2 a n
i 1
n n
ca i c a i
n
i 1 i 1
n n n
( a i bi ) a i bi
i 1 i 1 i 1
26
Chapter 1: Fundamental Principles of Counting
27
Chapter 1: Fundamental Principles of Counting
if x x1x2 xn ,
n
define wt ( x) xi
i 1
28
Chapter 1: Fundamental Principles of Counting
30
Chapter 1: Fundamental Principles of Counting
31
Chapter 1: Fundamental Principles of Counting
5 13 39
2,023,203
i 1 i 5 i
32
Chapter 1: Fundamental Principles of Counting
33
Chapter 1: Fundamental Principles of Counting
34
Chapter 1: Fundamental Principles of Counting
35
Chapter 1: Fundamental Principles of Counting
where n1 n 2 n t n .
n!
,
n1!n 2 ! nt !
36
Chapter 1: Fundamental Principles of Counting
16!
(1) 2 ( 2) 3 ( 3) 2 ( 2) 5 ( 5) 4
2 !3!2 !5!4 !
37
Chapter 1: Fundamental Principles of Counting
( n r 1)! n r 1
r !( n 1)! r
39
Chapter 1: Fundamental Principles of Counting
40
Chapter 1: Fundamental Principles of Counting
42
Chapter 1: Fundamental Principles of Counting
43
Chapter 1: Fundamental Principles of Counting
It is equivalent to
x1 x2 x6 x7 10, 0 xi , 1 i 6, 0 x7
which can be transformed to y1 y 2 y 6 y 7 9,
where y i x i fo 1 i 6
an y 7 x 7 1r C(7+9-
d 1,9)=5005
44
Chapter 1: Fundamental Principles of Counting
Therefore, C(4+10-1,10)=286
45
Chapter 1: Fundamental Principles of Counting
4=3+1=1+3=2+2=2+1+1=1+2+1=1+1+2=1+1+1+1
4 has 8 compositions.
If order is irrelevant, 4 has 5 partitions.
46
Chapter 1: Fundamental Principles of Counting
x1 x 2 x 3 x 4 3 4 3 1
four summands
3
6 6
Ans.: 2 6
k 0 k
47
Chapter 1: Fundamental Principles of Counting
48
Chapter 1: Fundamental Principles of Counting
Exercise 1.4
11,12,19,20,22,25,28
Supplementary Exercises
21,24,29
49
Chapter 1: Fundamental Principles of Counting