Science Fair Projects Ideas - Pancake sorting

All Science Fair Projects

      

Science Fair Project Encyclopedia for Schools!

  Search    Browse    Forum  Coach    Links    Editor    Help    Tell-a-Friend    Encyclopedia    Dictionary     

Science Fair Project Encyclopedia

For information on any area of science that interests you,
enter a keyword (eg. scientific method, molecule, cloud, carbohydrate etc.).
Or else, you can start by choosing any of the categories below.

Pancake sorting

Pancake sorting is a variation of the sorting problem in which the only allowed operation is to reverse the elements of some prefix of the sequence. The goal is to sort the sequence in as few reversals as possible. This operation can be visualized by thinking of a stack of pancakes in which one is allowed to take the top k pancakes and flip them.

Whereas in the regular sorting problem one usually seeks to minimize the number of comparisons, in pancake sorting the operation is different. Furthermore, this operation cannot be performed in constant time on a Von Neumann machine. Because of this, pancake sorting can be accomplished in a linear number of operations, which is not possible for comparison sorting. The optimal constant is known to lie between 1 and 5/3, but the exact value is not known.

The simplest pancake sorting algorithm requires at most 2n-3 flips. In this algorithm, a variation of selection sort, we bring the largest pancake not yet sorted to the top with one flip, and then take it down to its final position with one more, then repeat this for the remaining pancakes.

In a more difficult variation called the Burnt Pancake Problem, the bottom of each pancake in the pile is burnt, and we must complete the sort with the burnt side of every pancake down.

Although seen more often as an educational device, pancake sorting also appears in applications in parallel processor networks, in which it can provide an effective routing algorithm between processors.

As an interesting piece of trivia, the only well-known paper ever published by Microsoft Chairman and billionaire Bill Gates, entitled "Bounds for Sorting by Prefix Reversal," describes an efficient algorithm for pancake sorting.

Related Integer Sequences

The following describes the number of flips per specified stack height. the first number is the height of the pancake stack. The following numbers are the number of stacks of that height that require 0, 1, 2, . . . flips to get back to the starting stack.

  • 1 - 1
  • 2 - 1 1
  • 3 - 1 2 2 1
  • 4 - 1 3 6 11 3
  • 5 - 1 4 12 35 48 20
  • 6 - 1 5 20 79 199 281 133 2
  • 7 - 1 6 30 149 543 1357 1903 1016 35
  • 8 - 1 7 42 251 1191 4281 10561 15011 8520 455
  • 9 - 1 8 56 391 2278 10666 38015 93585 132697 79379 5804
  • 10 - 1 9 72 575 3963 22825 106461 377863 919365 1309756 814678 73232
  • 11 - 1 10 90 809 6429 43891 252737 1174766 4126515 9981073 14250471 9123648 956354 6
  • 12 - 1 11 110 1099 9883 77937 533397 3064788 14141929 49337252 118420043 169332213 111050066 13032704 167

Sequences from The Online Encyclopedia of Integer Sequences:

External link

References

  • Gates, W. and Papadimitriou, C. "Bounds for Sorting by Prefix Reversal." Discrete Mathematics. 27, 47-57, 1979.
09-23-2007 01:00:40
The contents of this article is licensed from www.wikipedia.org under the GNU Free Documentation License. Click here to see the transparent copy and copyright details
Science kits, science lessons, science toys, maths toys, hobby kits, science games and books - these are some of many products that can help give your kid an edge in their science fair projects, and develop a tremendous interest in the study of science. When shopping for a science kit or other supplies, make sure that you carefully review the features and quality of the products. Compare prices by going to several online stores. Read product reviews online or refer to magazines.

Start by looking for your science kit review or science toy review. Compare prices but remember, Price $ is not everything. Quality does matter.
Science Fair Coach
What do science fair judges look out for?
ScienceHound
Science Fair Projects for students of all ages
All Science Fair Projects.com Site
All Science Fair Projects Homepage
Search | Browse | Links | From-our-Editor | Books | Help | Contact | Privacy | Disclaimer | Copyright Notice