Sorting a Permutation by Cut-and-Paste Moves Daniel W. Cranston - - PowerPoint PPT Presentation

sorting a permutation by cut and paste moves
SMART_READER_LITE
LIVE PREVIEW

Sorting a Permutation by Cut-and-Paste Moves Daniel W. Cranston - - PowerPoint PPT Presentation

Sorting a Permutation by Cut-and-Paste Moves Daniel W. Cranston Virginia Commonwealth University dcransto@dimacs.rutgers.edu Joint with Hal Sudborough and Doug West. Discrete Math Minisymposium, MathFest 6 August 2009 Definitions and an


slide-1
SLIDE 1

Sorting a Permutation by Cut-and-Paste Moves

Daniel W. Cranston

Virginia Commonwealth University dcransto@dimacs.rutgers.edu Joint with Hal Sudborough and Doug West. Discrete Math Minisymposium, MathFest 6 August 2009

slide-2
SLIDE 2

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere

slide-3
SLIDE 3

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere

A | B | C | D

slide-4
SLIDE 4

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere

A | B | C | D A | C | B | D ր

slide-5
SLIDE 5

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere

A | B | C | D A | C | B | D ր → A | C | BR | D

slide-6
SLIDE 6

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere

A | B | C | D A | C | B | D ր → A | C | BR | D ց A | C R | B | D

slide-7
SLIDE 7

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD

slide-8
SLIDE 8

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11

slide-9
SLIDE 9

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11

slide-10
SLIDE 10

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8

slide-11
SLIDE 11

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8

slide-12
SLIDE 12

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3

slide-13
SLIDE 13

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3

slide-14
SLIDE 14

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3 1 2 8 9 10 11 12 13 7 4 6 5 3

slide-15
SLIDE 15

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3 1 2 8 9 10 11 12 13 7 4 6 5 3

slide-16
SLIDE 16

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3 1 2 8 9 10 11 12 13 7 4 6 5 3 1 2 3 5 6 4 7 8 9 10 11 12 13

slide-17
SLIDE 17

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3 1 2 8 9 10 11 12 13 7 4 6 5 3 1 2 3 5 6 4 7 8 9 10 11 12 13

slide-18
SLIDE 18

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3 1 2 8 9 10 11 12 13 7 4 6 5 3 1 2 3 5 6 4 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13

slide-19
SLIDE 19

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3 1 2 8 9 10 11 12 13 7 4 6 5 3 1 2 3 5 6 4 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13

slide-20
SLIDE 20

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3 1 2 8 9 10 11 12 13 7 4 6 5 3 1 2 3 5 6 4 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13

  • Def. g(n): max # of moves to sort a permuation of {1, 2, . . . , n}
slide-21
SLIDE 21

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3 1 2 8 9 10 11 12 13 7 4 6 5 3 1 2 3 5 6 4 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13

  • Def. g(n): max # of moves to sort a permuation of {1, 2, . . . , n}

Obs. g(n) ≤ n − 1

slide-22
SLIDE 22

Definitions and an Example

  • Def. cut-and-paste move: cut out a substring, reverse it if you

want, paste it into the permutation anywhere ABCD → ACBD or ACBRD or AC RBD Ex.

1 2 13 7 4 10 9 5 3 6 8 12 11 1 2 13 7 4 12 11 10 9 5 3 6 8 1 2 13 7 4 12 11 10 9 8 6 5 3 1 2 8 9 10 11 12 13 7 4 6 5 3 1 2 3 5 6 4 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13

  • Def. g(n): max # of moves to sort a permuation of {1, 2, . . . , n}

Obs. g(n) ≤ n − 1 and g(n) ≥ ⌈n/3⌉

slide-23
SLIDE 23

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

slide-24
SLIDE 24

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

  • Def. parity adjacency: consecutive elements with opposite parities
slide-25
SLIDE 25

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

  • Def. parity adjacency: consecutive elements with opposite parities

Lem. Each move adds at most 2 more parity adjacencies.

slide-26
SLIDE 26

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

  • Def. parity adjacency: consecutive elements with opposite parities

Lem. Each move adds at most 2 more parity adjacencies. Pf.

A 0|0 B 0|1 C 1|? D A 0|1 C 1|1 B 0|? D

slide-27
SLIDE 27

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

  • Def. parity adjacency: consecutive elements with opposite parities

Lem. Each move adds at most 2 more parity adjacencies. Pf.

A 0|0 B 0|1 C 1|? D A 0|1 C 1|0 B 0|? D

slide-28
SLIDE 28

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

  • Def. parity adjacency: consecutive elements with opposite parities

Lem. Each move adds at most 2 more parity adjacencies. Pf.

A 0|0 B 0|1 C 1|? D A 0|1 C 1|0 B 0|? D

slide-29
SLIDE 29

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

  • Def. parity adjacency: consecutive elements with opposite parities

Lem. Each move adds at most 2 more parity adjacencies. Pf.

A 0|0 B 1|1 C 1|? D A 0|1 C 1|0 B 1|? D

slide-30
SLIDE 30

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

  • Def. parity adjacency: consecutive elements with opposite parities

Lem. Each move adds at most 2 more parity adjacencies. Pf.

A 0|0 B 1|1 C 1|? D A 0|1 C 1|0 B 1|? D

slide-31
SLIDE 31

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

  • Def. parity adjacency: consecutive elements with opposite parities

Lem. Each move adds at most 2 more parity adjacencies. Pf.

A 0|0 B 1|1 C 1|? D A 0|1 C 1|0 B 1|? D

Note that (0)12345 . . . n has n parity adjacencies.

slide-32
SLIDE 32

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

  • Def. parity adjacency: consecutive elements with opposite parities

Lem. Each move adds at most 2 more parity adjacencies. Pf.

A 0|0 B 1|1 C 1|? D A 0|1 C 1|0 B 1|? D

Note that (0)12345 . . . n has n parity adjacencies. And (0)24 . . . 531 has only 1 parity adjacency.

slide-33
SLIDE 33

Proving the Lower Bound

Thm. g(n) ≥ ⌊n/2⌋

  • Def. parity adjacency: consecutive elements with opposite parities

Lem. Each move adds at most 2 more parity adjacencies. Pf.

A 0|0 B 1|1 C 1|? D A 0|1 C 1|0 B 1|? D

Note that (0)12345 . . . n has n parity adjacencies. And (0)24 . . . 531 has only 1 parity adjacency. So g(n) ≥ ⌈(n − 1)/2⌉ = ⌊n/2⌋.

slide-34
SLIDE 34

Motivating the Upper Bound

Thm. g(n) ≤ ⌈2n/3⌉ + 1.

slide-35
SLIDE 35

Motivating the Upper Bound

Thm. g(n) ≤ ⌈2n/3⌉ + 1.

1 2 13 7 4 12 11 10 9 5 3 6 8

slide-36
SLIDE 36

Motivating the Upper Bound

Thm. g(n) ≤ ⌈2n/3⌉ + 1.

1 2 13 7 4 12 11 10 9 5 3 6 8

  • Def. block: maximal substring of adjacencies (size at least 2)
slide-37
SLIDE 37

Motivating the Upper Bound

Thm. g(n) ≤ ⌈2n/3⌉ + 1.

1 2 13 7 4 12 11 10 9 5 3 6 8

  • Def. block: maximal substring of adjacencies (size at least 2)
  • Def. single: element not in a block
slide-38
SLIDE 38

Motivating the Upper Bound

Thm. g(n) ≤ ⌈2n/3⌉ + 1.

1 2 13 7 4 12 11 10 9 5 3 6 8

  • Def. block: maximal substring of adjacencies (size at least 2)
  • Def. single: element not in a block

Obs. It’s easier to merge singles than blocks.

slide-39
SLIDE 39

Motivating the Upper Bound

Thm. g(n) ≤ ⌈2n/3⌉ + 1.

1 2 13 7 4 12 11 10 9 5 3 6 8

  • Def. block: maximal substring of adjacencies (size at least 2)
  • Def. single: element not in a block

Obs. It’s easier to merge singles than blocks. Ex. 3 4 or 4 3 vs. 123 456 or 456 123

slide-40
SLIDE 40

Motivating the Upper Bound

Thm. g(n) ≤ ⌈2n/3⌉ + 1.

1 2 13 7 4 12 11 10 9 5 3 6 8

  • Def. block: maximal substring of adjacencies (size at least 2)
  • Def. single: element not in a block

Obs. It’s easier to merge singles than blocks. Ex. 3 4 or 4 3 vs. 123 456 or 456 123

  • Def. weight w(π) = # blocks + 2/3 # singles
slide-41
SLIDE 41

Motivating the Upper Bound

Thm. g(n) ≤ ⌈2n/3⌉ + 1.

1 2 13 7 4 12 11 10 9 5 3 6 8

  • Def. block: maximal substring of adjacencies (size at least 2)
  • Def. single: element not in a block

Obs. It’s easier to merge singles than blocks. Ex. 3 4 or 4 3 vs. 123 456 or 456 123

  • Def. weight w(π) = # blocks + 2/3 # singles

Obs. 1 ≤ w(π) ≤ 2n/3

slide-42
SLIDE 42

Motivating the Upper Bound

Thm. g(n) ≤ ⌈2n/3⌉ + 1.

1 2 13 7 4 12 11 10 9 5 3 6 8

  • Def. block: maximal substring of adjacencies (size at least 2)
  • Def. single: element not in a block

Obs. It’s easier to merge singles than blocks. Ex. 3 4 or 4 3 vs. 123 456 or 456 123

  • Def. weight w(π) = # blocks + 2/3 # singles

Obs. 1 ≤ w(π) ≤ 2n/3

  • Def. gain (of a move): how much the move lowers the weight
slide-43
SLIDE 43

Motivating the Upper Bound

Thm. g(n) ≤ ⌈2n/3⌉ + 1.

1 2 13 7 4 12 11 10 9 5 3 6 8

  • Def. block: maximal substring of adjacencies (size at least 2)
  • Def. single: element not in a block

Obs. It’s easier to merge singles than blocks. Ex. 3 4 or 4 3 vs. 123 456 or 456 123

  • Def. weight w(π) = # blocks + 2/3 # singles

Obs. 1 ≤ w(π) ≤ 2n/3

  • Def. gain (of a move): how much the move lowers the weight

Idea Always makes moves with gain at least 1.

slide-44
SLIDE 44

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.
slide-45
SLIDE 45

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain extrabonus

slide-46
SLIDE 46

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus

slide-47
SLIDE 47

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus

slide-48
SLIDE 48

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus 1 2 13 7 4 12 11 10 9 5 3 6 8

slide-49
SLIDE 49

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus 1 2 13 7 4 12 11 10 9 5 3 6 8 block

slide-50
SLIDE 50

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1

slide-51
SLIDE 51

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1

slide-52
SLIDE 52

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3

slide-53
SLIDE 53

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus

slide-54
SLIDE 54

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1

slide-55
SLIDE 55

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1

slide-56
SLIDE 56

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3

slide-57
SLIDE 57

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing

slide-58
SLIDE 58

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3

slide-59
SLIDE 59

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3

slide-60
SLIDE 60

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3 1 2 3 5 6 4 7 8 9 10 11 12 13

slide-61
SLIDE 61

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3 1 2 3 5 6 4 7 8 9 10 11 12 13 extrabonus

slide-62
SLIDE 62

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3 1 2 3 5 6 4 7 8 9 10 11 12 13 extrabonus 4/3

slide-63
SLIDE 63

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3 1 2 3 5 6 4 7 8 9 10 11 12 13 extrabonus 4/3

Sorting Algorithm

slide-64
SLIDE 64

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3 1 2 3 5 6 4 7 8 9 10 11 12 13 extrabonus 4/3

Sorting Algorithm Put 1 2 at the left end

slide-65
SLIDE 65

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3 1 2 3 5 6 4 7 8 9 10 11 12 13 extrabonus 4/3

Sorting Algorithm Put 1 2 at the left end Repeat the following until sorted

slide-66
SLIDE 66

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3 1 2 3 5 6 4 7 8 9 10 11 12 13 extrabonus 4/3

Sorting Algorithm Put 1 2 at the left end Repeat the following until sorted Case 1: make a block move

slide-67
SLIDE 67

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3 1 2 3 5 6 4 7 8 9 10 11 12 13 extrabonus 4/3

Sorting Algorithm Put 1 2 at the left end Repeat the following until sorted Case 1: make a block move Case 2: make a bonus move

slide-68
SLIDE 68

Proving the Upper Bound

  • Thm. g(n) ≤ ⌈2n/3⌉ + 1.

w(π) = # blocks + 2/3 # singles

gain 1 2 13 7 4 10 9 5 3 6 8 12 11 extrabonus gain 1 2 13 7 4 12 11 10 9 5 3 6 8 block 1 1 2 13 7 4 12 11 10 9 8 6 5 3 bonus 1 1 2 8 9 10 11 12 13 7 4 6 5 3 absorbing 2/3 1 2 3 5 6 4 7 8 9 10 11 12 13 extrabonus 4/3

Sorting Algorithm Put 1 2 at the left end Repeat the following until sorted Case 1: make a block move Case 2: make a bonus move Case 3: make an absorbing move, then an extra bonus move