Presentation is loading. Please wait.

Presentation is loading. Please wait.

Pancake Problem 許凱平 & 張傑生. Resources Google “ Bounds for Sorting by Prefix Reversal ” (63) “ Pancake Problem ” (218) Slides [S1] CMU ’ s “ Great Theoretical.

Similar presentations


Presentation on theme: "Pancake Problem 許凱平 & 張傑生. Resources Google “ Bounds for Sorting by Prefix Reversal ” (63) “ Pancake Problem ” (218) Slides [S1] CMU ’ s “ Great Theoretical."— Presentation transcript:

1 Pancake Problem 許凱平 & 張傑生

2 Resources Google “ Bounds for Sorting by Prefix Reversal ” (63) “ Pancake Problem ” (218) Slides [S1] CMU ’ s “ Great Theoretical Ideas In Computer Science ” course http://www-2.cs.cmu.edu/~15251/Materials/Lectures/Lecture01/lecture01.ppt Steven Rudich

3 Resources Slides [S2] On the Generalization of the Pancake Problem http://hsu14.cis.nctu.edu.tw/upload/on%20the%20generalization%20of%20the%20pancake%20network.ppt Marissa P. Justan, Felix P. Muga II,Ivan Hal Sudborough, [S3] Pancake problems with restricted prefix reversals and some corresponding Cayley networks http://hsu14.cis.nctu.edu.tw/upload/pancake.ppt Douglas W. Bass and I. Hal Sudborough

4 Resources Papers [P1]Gates W.H., and Papadimitriou, C.H. Bounds for sorting by prefix reversal. Discrete Math. 27 (1979), 47--57. 數學系系圖有 [P2] H. Heydari and I. Hal Sudborough. On the Diameter of the Pancake Network. Journal of Algorithms 25, 67-94 (1997). http://www.atcminc.com/mPublications/EP/EPATCM98/ATCMP003/paper.pdf

5 History [P1] n+(1/16)n<= f(n) <=(5n+5)/3 Guess 19n/16 <=f(n) [P2] N+(1/14)n<=f(n) Disprove “ Guess 19n/16 <=f(n) ”

6 Pre-Knowledge Symmetric Group S2#8 S3#5 Dual Linear Program Skip!

7 Terms Adjacency Two neighbor (position) element x,y are said to be adjacent (value) Iff |x-y| = 1 Free, Singleton No neighbor of x is adjacent to x x is a singleton Block Block is a group of adjacent element

8 Terms Positions Values

9

10 P Q P’P’ Q’Q’ Q Q P P Q’Q’ P P’P’ Q PQ

11 Ideas Algebra Use two-sided pancake to simulate block in one-sided pancake problem Capital for block Non-Capital for singleton

12 Notations -- flip one segment operation ---- flip two segment operation P1...k-1 P’P’ k-1...1 Qk...n Q’Q’ n...k d(x)distance, depth: # of flip convert x to PQ

13 Lemma P’-P PQ--Q’P’

14 Operations xflipy d(x) PQ 0 PQ ’ -- QP ’ =d(QP ’ )++ = 3 P’QP’Q - PQ 1 a P’Q’P’Q’ -- QP =d(QP)++ = 4 b QP - Q’PQ’P =d(Q ’ P)++=3 QP ’ - Q’P’Q’P’ =d(Q ’ P ’ )++ = 2 Q’PQ’P -- P’QP’Q =d(P ’ Q)++ =2 Q’P’Q’P’ -- PQ 1

15 State Chart

16 What it means? QP P’Q’P’Q’ Q’PQ’P PQ P’QP’Q

17 What will be PQR? R’Q’P’

18 Conjecture 4 is the magic number

19 Notations adj: # of adjacency blk: # of block Move, flip

20 t is free, t+o is also free t is head of string, t is glue t is free t-1, t+1 is not the second element o =1 or o=-1 adj++; blk++

21 t is free, t+o is 1st of a block adj++;

22

23 t is in block, t+o is free Adj++

24 t is in block, t+o is 1st of blk Move++; Adj++; Blk--;

25

26

27

28

29 tsingleton, first element of sigma, connector ssingleton, (t-1) usingleton, (t+1) S[...s], block,, [...(t-1)] S’S’ [s...] U[u...] U’U’ [...u]

30 T[t...] T’T’ [...t] # don ’ t care charactors xinput pattern youtput pattern Goal ts, tu, stu, tS, StU, tU,U ’ tS ’, T ’ s, T ’ u, #T ’ S, #T ’ U

31 t is free, t+o is also free t#s--#ts, o=-1 t#u--#tu, o=1

32 t is free, t+o is 1st of a block t#S' --#tS, o=-1 t#U --#tU, o=1

33 Case 3: t is free, S, U ’ For o=-1 Steps t#S#U’#--- S’#t#U’ #-- #St#U’ #----- U#tS’##-- #U’tS’## Observation Move+=4 Adj+=2 Blk--;

34 Case3: t is free, S, U ’ For o=-1 Steps t1S2U ’ 3--- S ’ 1 ’ t2U ’ 3-- 1St2U ’ 3----- U2 ’ tS ’ 1 ’ 3-- 2U ’ tS ’ 1 ’ 3

35 New Notation Case1, fig2(a) t#s--#ts t#s-(2)-#ts

36 New Notation Case3, fig2(c) t#S#U’#-(3)- S’#t#U’ #-(2)- #St#U’ #-(5)- U#tS’##-(2)- #U’tS’## Briefly t#S#U’#-(3,2,5,2)-#U’tS’##

37 1 ’ 3 Chances :無心插柳柳成蔭 case Description 1’1’ 3adjblk 31 non-adjacent2 32 form a new blockaa+12+1-1+1 33 merge a block with a singleton (...a)a+12+1 34 merge two block(...a)(a+1...)2+1-1-1

38 Case 6, fig2(f) or 2(g) 2(f) T#u#S#-(3,2,5,2)-#STu## 2(g) T#U ’ #s#-(3,2,5,2)-#sTU## Move+=4;Adj+=2;Blk--; Case 6 share the same operation property of Case 3, ground…

39 Table2 Action1231323334457 flip114444121 adj112333111 blk100 -20

40 Bill ’ s Typos or I ’ m wrong Case 5 rename to Case7, and Case7 rename to Case5 Case 7, 2(e) Case 5, 2(h) or 2(k)

41 3 basic equation When string is sorted move = Sum( move(i) * #case(i) ) Let x(i) = case(i) Adj = n-1 Blk =1

42 Total move: Use Table2 Action123457 flip114121 z=X(1)+X(2)+4X(3)+X(4)+2X(5)+X(7)

43 adj: Use Table2 a: initial adjacency a+X(1)+X(2)+2X(31)+3X(32)+3X(33)+3X(34)+X(4)+X(5)+X(7) Eq(1) n-1=a+X(1)+X(2)+2X(31)+3X(32)+3X(33)+3X(34)+X(4)+X(5)+X(7) Action1231323334457 adj112333111

44 blk : Use Table2 Action1231323334457 blk100 -20 b: initial blk B+x(1)-x(31)-x(33)-2x(34)-x(5)-x(7) Eq(2) 1=B+x(1)-x(31)-x(33)-2x(34)-x(5)-x(7)

45 (1)  (3), b<=a Eq(1)  Eq(3) n-1=a+X(1)+X(2)+2X(31)+3X(32)+3X(33)+3X(34)+X(4)+X(5)+X(7) b<=a N-1>=b+X(1)+X(2)+2X(31)+3X(32)+3X(33)+3X(34)+X(4)+X(5)+X(7) Eq(3)

46 Upper bound 1=B+x(1)-x(31)-x(33)-2x(34)-x(5)-x(7) N-1>= b+X(1)+X(2)+2X(31)+3X(32)+3X(33)+3X(34)+X(4) +X(5)+X(7) z=X(1)+X(2)+4X(3)+X(4)+2X(5)+X(7) Goal: Max(z) X1=(n+1)/3, x2=x4=x5=x7=b=0 X3=x31=(n-2)/3 Z = (5n-7)/3 Upper bound = z+4=(5n+5)/3

47 Dual Linear Program Duality Theorem of Von Neumna, Kuhn and Tucker, Gale, and Dantzig I did not study this…

48 Amazing Network


Download ppt "Pancake Problem 許凱平 & 張傑生. Resources Google “ Bounds for Sorting by Prefix Reversal ” (63) “ Pancake Problem ” (218) Slides [S1] CMU ’ s “ Great Theoretical."

Similar presentations


Ads by Google