You're viewing a single thread.
Reminds me of quantum-bogosort: randomize the list; check if it is sorted. If it is, you're done; otherwise, destroy this universe.
144 0 ReplyGuaranteed to sort the list in nearly instantaneous time and with absolutely no downsides that are capable of objecting.
92 0 ReplyYou still have to check that it's sorted, which is O(n).
We'll also assume that destroying the universe takes constant time.
43 0 ReplyIn the universe where the list is sorted, it doesn't actually matter how long the destruction takes!
41 0 ReplyIt actually takes a few trillion years but its fine because we just stop considering the "failed" universes because they will be gone soon™ anyway.
12 0 ReplyEh, trillion is a constant
9 0 Reply
amortized O(0)
8 0 Reply
We'll also assume that destroying the universe takes constant time.
Well yeah just delete the pointer to it!
8 0 Replyuniverse.take()
2 0 Reply
Except you missed a bug in the "check if it's sorted" code and it ends up destroying every universe.
14 0 ReplyThere's a bug in it now, that's why we're still here.
6 0 Reply
The creation and destruction of universes is left as an exercise to the reader
24 0 ReplyCreation is easy, assuming the many-worlds interpretation of quantum mechanics!
5 0 Reply
Instead of destroying the universe, can we destroy prior, failed shuffle/check iterations to retain o(1)? Then we wouldn't have to reload all of creation into RAM.
16 0 ReplyDelete prior iterations of the loop in the same timeline? I'm not sure there's anything in quantum mechanics to permit that...
6 0 Reply
What library are you using for that?
13 0 Replyis-sorted and a handful of about 300 other npm packages. Cloning the repo and installing takes about 16 hours but after that you're pretty much good for the rest of eternity
28 0 Replythat explains why it took god 7 days to make the universe
8 0 ReplyWe still suffer from the runtime errors that could've been caught at compilation time.
2 0 Reply
In Python you just use
import destroy_universe
11 0 Reply
Since randomizing the list increases entropy, it could theoretically make your cpu cooler just before it destroys the universe.
2 0 Reply