• Member Since 28th Oct, 2012
  • offline last seen 7 hours ago

Pineta


Particle Physics and Pony Fiction Experimentalist

More Blog Posts441

  • 8 weeks
    Eclipse 2024

    Best of luck to everyone chasing the solar eclipse tomorrow. I hope the weather behaves. If you are close to the line of totality, it is definitely worth making the effort to get there. I blogged about how awesome it was back in 2017 (see: Pre-Eclipse Post, Post-Eclipse

    Read More

    10 comments · 192 views
  • 16 weeks
    End of the Universe

    I am working to finish Infinite Imponability Drive as soon as I can. Unfortunately the last two weeks have been so crazy that it’s been hard to set aside more than a few hours to do any writing…

    Read More

    6 comments · 191 views
  • 19 weeks
    Imponable Update

    Work on Infinite Imponability Drive continues. I aim to get another chapter up by next weekend. Thank you to everyone who left comments. Sorry I have not been very responsive. I got sidetracked for the last two weeks preparing a talk for the ATOM society on Particle Detectors for the LHC and Beyond, which took rather more of my time than I

    Read More

    1 comments · 176 views
  • 20 weeks
    Imponable Interlude

    Everything is beautiful now that we have our first rainbow of the season.

    What is life? Is it nothing more than the endless search for a cutie mark? And what is a cutie mark but a constant reminder that we're all only one bugbear attack away from oblivion?

    Read More

    3 comments · 242 views
  • 22 weeks
    Quantum Decoherence

    Happy end-of-2023 everyone.

    I just posted a new story.

    EInfinite Imponability Drive
    In an infinitely improbable set of events, Twilight Sparkle, Sunny Starscout, and other ponies of all generations meet at the Restaurant at the end of the Universe.
    Pineta · 12k words  ·  51  0 · 910 views

    This is one of the craziest things that I have ever tried to write and is a consequence of me having rather more unstructured free time than usual for the last week.

    Read More

    2 comments · 174 views
Feb
9th
2016

I'm Pancake! · 6:12pm Feb 9th, 2016

Math problem of the day: The Pancake Problem - What is the maximum number of flips required to reorder a stack of n pancakes so they are all ordered by size - biggest at the bottom, smallest on top.

Nicely explained in this little gem of a popular math article by Simon Singh: Flipping pancakes with mathematics.

Pinkie Pie enjoys a challenging math problem.

Twilight decides to sleep on the problem.

Report Pineta · 536 views · #pancakes #math
Comments ( 12 )
Georg #1 · Feb 9th, 2016 · · ·

With Pinkie, the answer is 'One.' She just flips the whole stack up in the air, and they come down sorted :pinkiehappy:

The answer is 1234567891011121314151617181920

Wouldnt it be the Minimum number, as teh maximum number is infinite, you just keep reversing the order each end before completion?

I would also hope its more to do with the classic Quicksort, a binary tree division method, as even bubblesort is faster than Tower Of Pancakes?

Or you can use Pidgeon sort, in which case its 0.

Eat the biggest pancake first and select your way through the pile. Therefore, since you have integrated the sorting and eating, the sort takes zero time? :pinkiehappy:

I'm pretty sure my answer to this problem would be zero, since the pancakes would be gone by the time someone finished positing it. :twilightsheepish:

Clearly Twilight is working on an even harder variant, the Pancake Problem With Chocolate Chips. Namely, if you have a chip-applying machine which can be arbitrarily triggered to embed chips into your pancake stack, and a stacked pancake p receives chips if and only if there are no pancakes larger than p on the stack above p, how many flips are necessary to add chips to every pancake?

3743375

Wouldnt it be the Minimum number, as teh maximum number is infinite, you just keep reversing the order each end before completion?

To clarify, it is the maximum value of the minimum number of flips required for all possible orderings (if that makes sense).
If the stack is already ordered then it requires 0 flips, but we are interested in the number of flips required in worse case scenario when the pancakes are as disordered as possible.
i.guim.co.uk/img/static/sys-images/Guardian/Pix/pictures/2013/11/8/1383936625188/pancake-flipping-001.jpg?w=620&q=85&auto=format&sharp=10&s=8d29aadbdb4de9ad2de2c264fc3ad684

I'm surprised you didn't mention the coolest part of that Wikipedia article:

In a more difficult variation called the burnt pancake problem, the bottom of each pancake in the pile is burnt, and the sort must be completed with the burnt side of every pancake down. In 2008, a group of undergraduates built a bacterial computer that can solve a simple example of the burnt pancake problem by programming E. coli to flip segments of DNA which are analogous to burnt pancakes. DNA has an orientation (5' and 3') and an order (promoter before coding). Even though the processing power expressed by DNA flips is low, the high number of bacteria in a culture provides a large parallel computing platform. The bacteria report when they have solved the problem by becoming antibiotic resistant.[6]

Then again, that'd be hard to represent with ponies.

Next time, Pinkie tackles P(ancake) vs. NP(ancake).

3743364
And land in her mouth, of course :pinkiecrazy:

3743574 Surely that wouldn't alter the problem at all? The trivial solution appears to be to treat the problem as unmodified, then (once the pancakes are all stacked in size order) apply chocolate chips. Since all pancakes p are above all pancakes larger than p, all pancakes would receive chips.

An alteration that would make the exercise much more fun would be "Only the pancake on the top of the stack receives chocolate chips." For extra credit, apply chips only to the unburnt side!

3744872
Eenope! :eeyup: Different problem!

Consider the stack of pancakes: {2 4 3 1}. (I'm using this notation: 1 is the smallest pancake and 4 is the largest. Read left-to-right order as going from the top down; so that's a pancake stack with 2 on top and 1 on the bottom. A vertical bar | is where the spatula is inserted to progress your stack to the next state.)

With the traditional pancake problem, the most efficient sequence takes three flips: {2 4 3 | 1} -> {3 4 | 2 1} -> {4 3 2 1 | } -> {1 2 3 4}.

With the PPWCC variant, all you need to do is chip every pancake. Begin by chipping: {c2 c4 3 1}. Then simply flip the stack {c2 c4 3 1 |} -> {1 3 4c 2c} and chip again. Voila, finished in one flip.

More formally: the maximum necessary flips for a PPWCC stack of size n has a trivial upper bound of (n-1), because that's all it takes to bring a different pancake to the top of the stack with each flip. [1] (I'm sure the real maximum value is lower, possibly significantly lower.) But if you look up the original Pancake Problem, its maximum necessary flips has a lower bound of (15/14 * n). (n-1) < (15/14*n) so the solution for both problems cannot be the same.

... now I kind of wish I was still a mathematician, because I'm actually curious how much basis my joke actually has (of PPWCC being harder), but I can't afford the leisure time of researching it in hopes of a publishable paper in a field I formally dropped out of decades ago. I can't imagine it's literally harder than PP, but it's also a new variant that hasn't been researched yet, and (assuming that the solution isn't trivial), it might be equally complex. My gut tells me that the actual value is closer to n/2, but in mathematics gut feelings have a way of being interestingly wrong.

--
[1] By the way, that's the solution to the problem you propose: if only the top pancake is chipped, the solution is always exactly (n-1), because you simply follow this pseudocode: {chip top pancake j; for k = 1..n (next if k=j; flip from underneath pancake k; chip) }. This is trivially the most efficient algorithm because it's impossible to chip more than one pancake at a time and it's impossible to put more than one new pancake on top with each flip.

3744906 Oh, I see. I misinterpreted the pancake-with-chips problem as requiring ordering (as in the original problem) as well as adding chocolate chips.

Login or register to comment