Hacker News new | comments | ask | show | jobs | submit login
MonkeySort (2012) (leonid-shevtsov.github.io)
51 points by apsec112 5 months ago | hide | past | web | favorite | 19 comments

Interesting read!

I find it funny how we approach this same problem every ~5 years. (https://stackoverflow.com/questions/164831/how-to-rank-a-mil...)

I recently implemented a similar tool to help my team decide which brand and art references to use => http://refsort.com/

One big difference is that I focused on subjective topics, where there is no absolute 'correct' or 'better' option. In that case I think transitivity could actually decrease the quality of the result, so more 'brute force' is required.

I could probably implement this algorithm in a branch and see what happens :)

Was I the only one that clicked on 'better' every time because it was actually the word requested on the statement?

My god! In the end I was the monkey.

It was Earth all along...

With the default list, one is eventually asked "Which one is better?" with the options "best" and "better".

Obviously, I'd choose the exact match.

"Do you want to cancel?" <OK> <Cancel>

I made this[0] a while back as an implementation of merge sort in JavaScript with continuation passing style. His seems very similar but uses quicksort. Surprising since merge sort has fewer comparisons than quicksort's average case[1]. Why exactly does he use a matrix to store the comparisons?

[0]: https://jsfiddle.net/dsamarin/hgdjwtck/ [1]: https://stackoverflow.com/questions/8535540/exactly-how-many...

I've tried it in Chrome, Firefox, and Edge and has script errors in Chrome and Firefox, and just doesn't work in Edge.

In firefox you can click the site security information thing in the address bar and then select "Disable protection for now". My firefox sets the Upgrade-Insecure-Requests header and loads the https site instead, I guess that's what makes the difference between browsers.

Yup, that worked!

Firefox Nightly works just fine

Does this avoid asking questions that would make the relation not a partial ordering? Is it even possible to implement that?

Yes, you can store old answers and report error when one of the axioms of poset is violated.

A Ford–Johnson merge-insertion sort would need 28% fewer comparisons on average than the quick sort used here.


Would love to see the list order visually during the questions phase.

But regardless, this is useful for teaching sorting to help understand the comparison function's role that is passed into a sort routine.

I love this, I've used it for years any time I need to rank things, since having to pick my preference between different options is much more accurate than giving them arbitrary numbers.

I think an Android app called Prioritize Me did something functionally similar. Haven't looked it up again recently.

Here we go again: the latest in a long line of sites that I can't figure out, while lots of others comment "cool".

I click "Sort it". Nothing happens. <sigh>

For all those silent folks who are just like me: know that you are not alone.

Q: How do you tell if someone doesn't use Javascript?

A: They will tell you.

Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact