Presentation is loading. Please wait.

Presentation is loading. Please wait.

Internet Engineering Czesław Smutnicki Discrete Mathematics – Combinatorics.

Similar presentations


Presentation on theme: "Internet Engineering Czesław Smutnicki Discrete Mathematics – Combinatorics."— Presentation transcript:

1 Internet Engineering Czesław Smutnicki Discrete Mathematics – Combinatorics

2 CONTENT S Functions and distributions Combinatorial objects K-subsets Subsets Sequences Set partitions Number partitions Stirling numbers Bell numbers Permutations Set on/off rule

3 FUNCTIONS AND DISTRIBUTIONS XY X elements, Y boxes Element can be packed to any box: n-length sequence Each box contains at most one element: set partition Box contains exactly one element: permutation

4 K-SUBSETS Generate all subsets with k-elements from the set of n elements

5 SUBSETS

6 SET PARTITION (1) (1,2) (1)(2) (1,2,3) (1,2)(3) (1,3)(2)(1)(2,3) (1)(2)(3)

7 NUMBER PARTITION

8 SECOND TYPE STIRLING NUMBERS

9 BELL NUMBERS nBnBn

10 PERMUTATIONS. INTRODUCTION Permutation Inverse permutation Id permutation Composition Inversions Cycles Sign

11 complexity variance mean receipt number of inversion in  -1 o  n minus the number of cycles in  -1 o  n minus the lenght of the maximal increasing subsequence in  -1 o  measure D A ( ,  ) D S ( ,  ) D I ( ,  ) Move type API NPI INS PERMUTATIONS. DISTANCE MEASURES

12 GENERATING PERMUTATIONS. IN ANTYLEX ICOGRAPHICAL ORDER void swap(int& a, int& b) { int c=a; a=b; b=c; } void reverse(int m) { int i=1,j=m; while (i

13 GENERATING PERMUTATIONS. MINIMAL NUMBER OF TRANSPOSITIONS void swap(int& a, int& b) { int c=a; a=b; b=c; } int B(int m, int i) { return (!(m%2)&&(m>2))?(i<(m-1)?i:m-2):m-1; } void perm(int m) { int i; if (m==1) { for (i=1;i<=n;i++) cout << pi[i] << ' '; cout << endl; } else for (i=1;i<=m;i++) { perm(m-1); if (i

14 GENERATING PERMUTATIONS. MINIMAL NUMBER OF ADJACENT SWAPS void swap(int& a, int& b) { int c=a; a=b; b=c; } void permtp(int m) { int i,j,x,k; int *c=new int[m+1],*pr=new int[m+1]; for (i=1;i

15 Thank you for your attention DISCRETE MATHEMATICS Czesław Smutnicki


Download ppt "Internet Engineering Czesław Smutnicki Discrete Mathematics – Combinatorics."

Similar presentations


Ads by Google