IBM Research

PUZZLE   IBM-006

Sorting pancakes

IBM Research · Ponder This · October 1998

IBM Ponder This #006 · October 1998

There are N pancakes of distinct sizes. The aim is to put them in the order

1,2,,N,

with the smallest pancake on top. The only permitted operation is to choose 1kN and reverse the top k pancakes:

(a1,a2,,ak,)(ak,ak1,,a1,).

For a permutation p, let f(N,p) be the fewest flips needed to sort it, and define

g(N)=maxpSNf(N,p).

How does g(N) grow? IBM gives g(5)=5 as a starting point.

Solution

Best opened after a real attempt

Solution

To be added.