60 points · by belter · 4y ago · 33 comments
And now we succeeded using AI and manual intervention for yet another problem that could be implemented with a simple classical algorithm.
The C++ implementation is very elegant:
while(!std::next_permutation(v.begin(),v.end()));
The complexity is O(N!)Aren't these the same steps for any given input?
1) Roll dice to get random number N
2) Get the Nth permutation of the input sequence (for some ordering of permutations)
3) Permute input sequence
4) If sorted: done, else goto step 1Think of it as “can I run this algorithm on a Turing machine”
I think a correct implementation would be sleep(x * k) where k is a constant factor determined by the platform
Want to pass an exam tomorrow? Set the machine to destroy the universe two days from now if you haven't passed the exam.
Create a poll asking to vote for the largest number, wait for results and put it at last. Repeat for remaining numbers. Oh wait that's selection sort. Nevermind.
>8 Intelligent Design Sort
These don't sort the list.
In this cases it is the list which sorts you. The end result is the same - the final observer perceives the list as sorted.
I hope I don't need to report you, comrade, for saying what is obviously a capitalist lie.