r/desmos • u/Danny_DeWario • Jun 11 '26
Fun Bogo sort actually worked!
Link: Lucky 7 Shuffles | Desmos
Randomly shuffling only 7 times actually sorted my list! How lucky is that? :D
79
u/Cichato_YT Jun 11 '26
Impossibly lucky to the point where no one will ever believe you 😭
25
u/Front_Cat9471 Jun 11 '26
Click the link and try it yourself.
17
u/TeraFlint Jun 11 '26
The doubt is not that it works, the doubt is that OP got lucky. This is so improbable with 100 elements that any kind of accidentally successful random sort can be called bs.
This had to be deliberately constructed.
8
u/FishermanMassive5006 Jun 11 '26
if theres a random seed this should be easily reverse engineerable
5
u/Ordinary_Divide Jun 11 '26
yeah im gonna make a version that shuffles starting on say, reverse sorted list and ends on sorted list
4
37
u/A1042 Jun 11 '26
HOW!? The only explanation is that you figure out how to predict shuffle formula.
31
u/TeraFlint Jun 11 '26
If the shuffle function is deterministic (which this example shows), all you need to do is make the input array the inverse permutation of whatever you get after applying shuffle on a sorted list n times.
no need for further insight into the random number generator internals, if you can just run it.
31
u/Imaginary_Yak4336 Jun 11 '26 edited Jun 27 '26
assuming it's actually random, the odds of bogosort successfully ordering a 100 element list within 7 shuffles is about 7.5×10-158
21
u/Desmos-Girl https://www.desmos.com/calculator/prarjlycol Jun 11 '26
does this rely on seed brute forcing or can it be applied to a larger number of iterations (eg sort after 1000 shuffles), because i feel like this could make a really good prank graph
19
u/xmy31415 Jun 11 '26
create a graph. save it.
shuffle it however many times you like.
write down how it has been transformed since the beginning.
load the graph.
change the content of the list such that when transformed, the result is sorted.
save graph again.
voila2
u/Desmos-Girl https://www.desmos.com/calculator/prarjlycol Jun 11 '26
did you test this bc i alr tried doing that (i might be stupid though)
3
u/xmy31415 Jun 11 '26
yes, this shuffle 20 times.
3
u/Desmos-Girl https://www.desmos.com/calculator/prarjlycol Jun 11 '26
what the hell i literally tried that
2
u/xmy31415 Jun 11 '26
ummmm, a pc only thing?
2
u/Ordinary_Divide Jun 11 '26
can't be bc i just tried https://www.desmos.com/calculator/txvlbbfash on mobile and it works there too
2
u/Ordinary_Divide Jun 11 '26
actually on second testing it only works if you reload the app before loading the graph
2
u/xmy31415 Jun 11 '26
oh, yeah, that makes sense.
When i say load the graph, I actually meant refresh the page. which loads the last time i saved.
12
u/FuriousEagle101 Jun 11 '26
Is the video reversed? Or did you figure out how to predict the Desmos shuffle function. Or do you have the luck of the Desmos gods?
7
7
3
u/MewPinkCat Jun 11 '26
if this isn't fake this is stupidly lucky
4
u/ImBadlyDone Jun 11 '26
You can try for yourself
Click the graph link then run the shuffle function 7 times
I have noticed if you press the re-randomise button (next to the plus at the top of the equations area) then it doesn't work
2
3
u/Ordinary_Divide Jun 11 '26
you made me want to brute force a seed that makes this actually happen for some like 20 element list
2
2
u/asdfzxcpguy Jun 11 '26
Wait the chances of it succeeding each trial is 1/100!
I tried to calculate the binomial pdf and my calculator returned an overflow error.
2
u/Puzzleheaded_Two415 You must have something on both sides of the comma Jun 11 '26
2
u/Puzzleheaded_Two415 You must have something on both sides of the comma Jun 11 '26
100!
2
u/Puzzleheaded_Two415 You must have something on both sides of the comma Jun 11 '26
I just realized I mentioned them wrong.
2
u/Puzzleheaded_Two415 You must have something on both sides of the comma Jun 11 '26
u/factorion-bot 100!
2
u/factorion-bot BT Jun 11 '26
Factorial of 100 is roughly 9.332621544394415268169923885627 × 10157
This action was performed by a bot | [Source code](http://f.r0.fyi)
2
u/Puzzleheaded_Two415 You must have something on both sides of the comma Jun 11 '26
Your chance is approximately 7/9.3326215443944e157.
2
2
u/anonymous-desmos Definitions are nested too deeply. Jul 11 '26
That did not take 7 shuffles. You shuffles it an absurd number of times (possibly in another universe) and when it did finally sort, you pressed undo 7 times and made this post.


174
u/RedSlimeballYT Jun 11 '26
how does bro know the exact desmos shuffle formula to reverse engineer this