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.
146 0 ReplyGuaranteed to sort the list in nearly instantaneous time and with absolutely no downsides that are capable of objecting.
96 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.
48 0 ReplyIn the universe where the list is sorted, it doesn't actually matter how long the destruction takes!
43 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.
13 0 ReplyEh, trillion is a constant
8 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!
9 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.
16 0 ReplyThere's a bug in it now, that's why we're still here.
7 0 Reply
The creation and destruction of universes is left as an exercise to the reader
22 0 ReplyCreation is easy, assuming the many-worlds interpretation of quantum mechanics!
5 1 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.
17 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?
12 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
26 0 Replythat explains why it took god 7 days to make the universe
7 0 ReplyWe still suffer from the runtime errors that could've been caught at compilation time.
1 1 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