Skip to content
DevMeme
4999 of 7590
CS Fundamentals Post #5466 · source on Telegram

Quantum Bogosort: Sorting So Bad It Reliably Partitions The Multiverse

Description

Screenshot of a Wikipedia-style article headed “Quantum bogosort,” with the familiar large serif title and pencil-edit icon. Body text reads: “Quantum bogosort is a hypothetical sorting algorithm based on bogosort, created as an in-joke among computer scientists. The algorithm generates a random permutation of its input using a quantum source of entropy, checks if the list is sorted, and, if it is not, destroys the universe. Assuming that the many-worlds interpretation holds, the use of this algorithm will result in at least one surviving universe where the input was successfully sorted in O(n) time.” The visual evokes the dead-serious layout of an encyclopedia entry, but the content parodies both worst-case algorithms and quantum-computing hype by treating universe-level side effects as an acceptable trade-off to obtain linear complexity. Senior engineers will immediately recognize the satire on computational complexity, bogosort’s absurd expected time, and the tongue-in-cheek misuse of the many-worlds interpretation to ‘guarantee’ performance

Comments

20
Anonymous ★ Top Pick Great news - quantum bogosort just passed the architecture review; platform risk is acceptable as long as the blast radius stays confined to timelines where the SLA is missed
  1. Anonymous ★ Top Pick

    Great news - quantum bogosort just passed the architecture review; platform risk is acceptable as long as the blast radius stays confined to timelines where the SLA is missed

  2. Anonymous

    Finally, an algorithm with a disaster recovery strategy that makes our "we'll just restore from backup" look conservative

  3. Anonymous

    Quantum bogosort: the only algorithm where 'it works on my universe' is a legitimate production deployment strategy. Sure, it achieves O(n) time complexity, but the operational overhead of destroying infinite parallel universes makes the on-call rotation particularly challenging - especially when you're the one who has to explain to the VP of Engineering why the incident postmortem includes 'heat death of the cosmos' as a root cause

  4. Anonymous

    Quantum bogosort proves any system can hit O(n) if your SLO excludes failed universes - also known as “works on my universe”

  5. Anonymous

    The sort where Big O hides the constant factor of infinite doomed timelines

  6. Anonymous

    Quantum bogosort is “works on my machine” generalized to “works in at least one universe” - amortized O(n) if your OKRs count survival bias as a metric

  7. @ygerlach 2y

    wouldn't that be O(1) ?

    1. @nightingazer 2y

      no.

    2. @trainzman 2y

      You need complexity of n for generating a sequence of length n

      1. @pwnzkk 2y

        I would assume o(n) is for sorting checking, not generating. Quantum source of entropy generates random values at once I guess

        1. @trainzman 2y

          You're right

    3. @hdrsd 2y

      O(♾️)

  8. @pwnzkk 2y

    That’s even better

    1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

      The other one gives you instant result, i think thats better.

      1. @pwnzkk 2y

        Unless you end up in the universe, where the array is not sorted. Although if you believe in quantum immortality, that’s not an issue lol

        1. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

          Even if I don’t if it happens fast enough I won’t know it happened lol

          1. @pwnzkk 2y

            Yeah I hope the devs up there don’t implement some gruesome algorithm of universe destroying. Sort of power shutdown is fine I guess

            1. @pwnzkk 2y

              New meaning of high level programming. Higher order function, that kind of stuff

            2. @SamsonovAnton 2y

              The last time they powered-on our universe, it was quite a big bang though!

  9. @ZgGPuo8dZef58K6hxxGVj3Z2 2y

    Careful if you implement it be aware of possible race exceptions, especially if your following logic uses more APIs that could affect other universes

Use J and K for navigation