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

Slides:



Advertisements
Similar presentations
Great Theoretical Ideas in Computer Science.
Advertisements

Sequences and Mathematical Induction
Great Theoretical Ideas in Computer Science
Divide-and-Conquer Recursive in structure –Divide the problem into several smaller sub-problems that are similar to the original but smaller in size –Conquer.
Cooking for Computer Scientists. I understand that making pancakes can be a dangerous activity and that, by doing so, I am taking a risk that I.
A GROUP has the following properties: Closure Associativity Identity every element has an Inverse.
Chapter 7 Relations : the second time around
1 Computing Nash Equilibrium Presenter: Yishay Mansour.
FSM Decomposition using Partitions on States 290N: The Unknown Component Problem Lecture 24.
Discrete Structures & Algorithms EECE 320 : UBC : Spring 2009 Matei Ripeanu 1.
Sequences & Summations Section 2.4 of Rosen Fall 2008 CSCE 235 Introduction to Discrete Structures Course web-page: cse.unl.edu/~cse235 Questions:
EE 685 presentation Optimization Flow Control, I: Basic Algorithm and Convergence By Steven Low and David Lapsley Asynchronous Distributed Algorithm Proof.
Adaptiveness vs. obliviousness and randomization vs. determinism Dariusz Kowalski University of Connecticut & Warsaw University Andrzej Pelc University.
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Steven Rudich CS Spring 2004 Lecture 1 Jan 13, 2004 Carnegie Mellon University.
Pancakes With A Problem Steven Rudich The chef at our place is sloppy, and when he prepares a stack of pancakes they come out all different sizes.
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Vince Conitzer COMPSCI 102 Fall 2007 Lecture 1 August 27, 2007 Duke University.
Cooking for Computer Scientists. I understand that making pancakes can be a dangerous activity and that, by doing so, I am taking a risk that I.
CompSci 102 Spring 2012 Prof. Rodger January 11, 2012.
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Anupam Gupta CS Fall 2O05 Lecture 1 Aug 29 th, 2OO5 Aug 29 th, 2OO5 Carnegie.
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Anupam Gupta CS Fall 2006 Lecture 1 Aug 29 th, 2OO6 Aug 29 th, 2OO6 Carnegie.
Great Theoretical Ideas in Computer Science.
6.5 Factoring Cubic Polynomials 1/31/2014. Cube: a geometric figure where all sides are equal. 10 in Volume of a cube: side sideside V= V = 1000.
6.5 Factoring Cubic Polynomials
CSCI 115 Chapter 7 Trees. CSCI 115 §7.1 Trees §7.1 – Trees TREE –Let T be a relation on a set A. T is a tree if there exists a vertex v 0 in A s.t. there.
Sigma Notation. SUMMATION NOTATION Lower limit of summation (Starting point) Upper limit of summation (Ending point) SIGMA  equation.
Great Theoretical Ideas in Computer Science.
Andrew’s Leap 2011 Pancakes With A Problem Steven Rudich.
Letter of the Day Created by D. Mock 2012 Routine based on Davis District’s work with Dr. Parker Fawson, Dr. Cindy Jones, Dr. Ray Reutzel
11/6/20151 ENM 503Linear Algebra Review 1. u = (2, -4, 3) and v = (-5, 1, 2). u + v = (2-5, -4+1, 3 +2) = (-3, -3, 5). 2u = (4, -8, 6); -v = (5, -1, -2);
3.3 SPECIAL Factoring 12/5/2012. Perfect Squares
Inductive Reasoning 1-2A What do you think are basic geometry figures?
EE 685 presentation Optimization Flow Control, I: Basic Algorithm and Convergence By Steven Low and David Lapsley.
Classifying Triangles Measuring Angles in Triangles.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
Chapter 2 … part1 Matrices Linear Algebra S 1. Ch2_2 2.1 Addition, Scalar Multiplication, and Multiplication of Matrices Definition A matrix is a rectangular.
Pancakes With A Problem! Great Theoretical Ideas In Computer Science Steven Rudich CS Spring 2005 Lecture 3 Jan 18, 2005 Carnegie Mellon University.
R. Johnsonbaugh Discrete Mathematics 5 th edition, 2001 Chapter 9 Boolean Algebras and Combinatorial Circuits.
MAT 2401 Linear Algebra 2.5 Applications of Matrix Operations
Lecture aid 1 Devon M. Simmonds University of North Carolina, Wilmington CSC231 Data Structures.
On the Complexity of Affine Image Matching STACS 2007, Aachen University of Lübeck Institute for Theoretical Computer Science Lübeck, Germany Thursday,
1 Review for Quiz 1. 2 Summations 3 Binomial expansion.
Great Theoretical Ideas in Computer Science for Some.
CMPS 3130/6130 Computational Geometry Spring 2017
Image Sampling and Quantization
Sequences & Summations
Pancakes With A Problem!
… and now for the Final Topic:
Chapter 6 Section 4.
(2,4) Trees 11/15/2018 9:25 AM Sorting Lower Bound Sorting Lower Bound.
CMSC Discrete Structures
Pancakes With A Problem!
Bitonic Sorting and Its Circuit Design
String-Matching Algorithms (UNIT-5)
(2,4) Trees 12/4/2018 1:20 PM Sorting Lower Bound Sorting Lower Bound.
GROUP Closure Associativity Identity
Chapter 10.1 and 10.2: Boolean Algebra
Relations and Digraphs
Chapter 10.1 and 10.2: Boolean Algebra
The Lower Bounds of Problems
Cooking for Computer Scientists.
Enumerating All Nash Equilibria for Two-person Extensive Games
Sequences & Summations
Are DFAs and NFAs Equivalent
Adding subtracting polynomials using multiplication
Bounds for Sorting by Prefix Reversal -- Pancake Problem
Sequences & Summations
CS623: Introduction to Computing with Neural Nets (lecture-11)
CMSC Discrete Structures
Presentation transcript:

Pancake Problem 許凱平 & 張傑生

Resources Google “ Bounds for Sorting by Prefix Reversal ” (63) “ Pancake Problem ” (218) Slides [S1] CMU ’ s “ Great Theoretical Ideas In Computer Science ” course Steven Rudich

Resources Slides [S2] On the Generalization of the Pancake Problem Marissa P. Justan, Felix P. Muga II,Ivan Hal Sudborough, [S3] Pancake problems with restricted prefix reversals and some corresponding Cayley networks Douglas W. Bass and I. Hal Sudborough

Resources Papers [P1]Gates W.H., and Papadimitriou, C.H. Bounds for sorting by prefix reversal. Discrete Math. 27 (1979), 數學系系圖有 [P2] H. Heydari and I. Hal Sudborough. On the Diameter of the Pancake Network. Journal of Algorithms 25, (1997).

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) ”

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

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

Terms Positions Values

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

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

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

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

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

State Chart

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

What will be PQR? R’Q’P’

Conjecture 4 is the magic number

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

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++

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

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

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

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]

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

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

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

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--;

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

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

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’##

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

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…

Table2 Action flip adj blk

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)

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

Total move: Use Table2 Action flip z=X(1)+X(2)+4X(3)+X(4)+2X(5)+X(7)

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) Action adj

blk : Use Table2 Action blk 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)

(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)

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

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

Amazing Network