Re:What different sorting algorithms sound like
by transmit101 on Thursday August 19, 2010 @03:36AM
(#1616762)
Disclaimer: sorting algorithms can sound like just about anything, depending which parameters you map to which sounds.
This is just a simple example of data sonification, albeit with some nice visualisation too, and a subject matter which appeals to the computer scientists in the room.
Re:What different sorting algorithms sound like
by noncee22343 on Thursday August 19, 2010 @09:11AM
(#1617231)
No. Under some simple guidelines, which the model follows, the sorting algorithms won't sound like just about anything.
If you sort random permutations of the values [1, n], and map some monotonic property to the values, then not only are there provably some sounds which certain algorithms make that others don't, but more generally there are 'average case' signatures for each algorithm that give them their own recognizable cadences, and that is exactly what this video is demonstrating.
That you can use a 'boop' or a 'beep' or 'buzz' or invert the monotonicity is obvious and irrelevant.
Re:What different sorting algorithms sound like
by Tichy on Thursday August 19, 2010 @05:24AM
(#1616887)
I thought the values to be sorted would be the amplitude of the sound wave, and the value currently touched by the algorithm would be played in each step.
Of course you could still pick arbitrary values and arbitrary start orderings.
Re:What different sorting algorithms sound like
by hyyypr on Thursday August 19, 2010 @08:36AM
(#1617161)
Awesome link.
It reminds me of a website showing a matrix with visualizations of several sorting algorithms: http://www.sorting-algorithms.com/ (which was posted somewhere here iirc).
Re:What different sorting algorithms sound like
by sesqu on Thursday August 19, 2010 @07:36PM
(#1619035)
I've noticed that we don't share the same sense of humour.
Generally speaking, I've seen too many people assert that quicksort is blazingly fast to believe all of them were joking. It doesn't particularly help that the major sorting algorithms are severely fragmented, because people optimize variously for stability, time, space, comparisons, swaps, cache locality, parallelizability, best case, worst case, average case, amortized average case, arrays, lists, integers, objects...
Re:What different sorting algorithms sound like
by jacquesm on Thursday August 19, 2010 @08:10PM
(#1619087)
quicksort has very bad performance on the wrong data.
But on the kind of data that the test showed it would perform more or less on par with merge sort. To suggest that quick sort would be that much faster than merge sort that you couldn't hear it when there are obviously quite a few steps is to me more than enough reason to assume a joke rather than a serious answer.
Anyway, humour is a hard thing to get across online, I should have added a ;) at a minimum apologies for that, also HN seems to frown on humor (even though every now and then there are some really good jokes here http://news.ycombinator.com/item?id=1597571 ) this one was reasonably lame but the subject wasn't all that serious to begin with.
Sorting is enough of an issue that Knuth devoted the better part of a very thick book to it and to this day there are plenty of people that think that 'one size fits all'.
The more you know about your data the faster you can sort it.
Re:What different sorting algorithms sound like
by hubb on Thursday August 19, 2010 @08:57AM
(#1617197)
i know the choice of sounds was arbitrary, but it nonetheless reminded me of the seal calls of 'encounters at the end of the world': http://www.youtube.com/watch?v=SORza1fqQGk
Re:What different sorting algorithms sound like
by snprbob86 on Thursday August 19, 2010 @02:58AM
(#1616724)
That was super cool! I really enjoyed how my brain started matching the sound and the bar heights in such a way that by the end I said "of course that one sounds like that".
Re:What different sorting algorithms sound like
by Synaesthesia on Thursday August 19, 2010 @04:46AM
(#1616842)
I think Mathematica can be used to make "audiolizations" really easily. They include one of the Riemman Zeta function as a demo. It sounds really cool (sorry I can't find a link, I'll try upload it)
Re:What different sorting algorithms sound like
by mr_twj on Thursday August 19, 2010 @04:34AM
(#1616828)
I would say it's likely. There are all sorts (pun intended) of optimizations you can do for each algorithm, but at the textbook level, I could say they seemed typical as far as speed expectancy goes. My rough estimates for the times were (in seconds): insert: ~10, bubble: ~27, selection: ~18, merge: ~17, and gnome: ~19. I have only written inserts, bubbles, and selections; with bubble being slowest and insert being the fastest, my limited experience agrees with the video. Note: the merge algorithm appeared to have sorted a different data set.
Re:What different sorting algorithms sound like
by simonista on Thursday August 19, 2010 @02:21AM
(#1616668)
I'm not sure, but the visual part of the videos looks a lot like visualizations I've seen in algorithms classes where the speed does represent the speed of the sort. So I'd guess that it does here as well.
These are really great. As a musical person it engrained these concepts that much deeper for me. My wife, who is not much of a computer science person like the merge sort the best.
Re:What different sorting algorithms sound like
by dhs on Thursday August 19, 2010 @07:04AM
(#1617003)
I like that. And in breadth first search, one could use a filter on a saw wave to have the breadth of the frequency spectrum manipulated by the search.
This is just a simple example of data sonification, albeit with some nice visualisation too, and a subject matter which appeals to the computer scientists in the room.
If you sort random permutations of the values [1, n], and map some monotonic property to the values, then not only are there provably some sounds which certain algorithms make that others don't, but more generally there are 'average case' signatures for each algorithm that give them their own recognizable cadences, and that is exactly what this video is demonstrating.
That you can use a 'boop' or a 'beep' or 'buzz' or invert the monotonicity is obvious and irrelevant.
Of course you could still pick arbitrary values and arbitrary start orderings.
But nice to look at:
http://www.youtube.com/watch?v=vxENKlcs2Tw&feature=relat...
Generally speaking, I've seen too many people assert that quicksort is blazingly fast to believe all of them were joking. It doesn't particularly help that the major sorting algorithms are severely fragmented, because people optimize variously for stability, time, space, comparisons, swaps, cache locality, parallelizability, best case, worst case, average case, amortized average case, arrays, lists, integers, objects...
But on the kind of data that the test showed it would perform more or less on par with merge sort. To suggest that quick sort would be that much faster than merge sort that you couldn't hear it when there are obviously quite a few steps is to me more than enough reason to assume a joke rather than a serious answer.
Anyway, humour is a hard thing to get across online, I should have added a ;) at a minimum apologies for that, also HN seems to frown on humor (even though every now and then there are some really good jokes here http://news.ycombinator.com/item?id=1597571 ) this one was reasonably lame but the subject wasn't all that serious to begin with.
Sorting is enough of an issue that Knuth devoted the better part of a very thick book to it and to this day there are plenty of people that think that 'one size fits all'.
The more you know about your data the faster you can sort it.
It sonifies the following algorithms (from http://www.algolist.net/Algorithms/ ) - Bubble sort - Selection sort - Insertion sort - Quicksort
You can also see their sonograms.
These are really great. As a musical person it engrained these concepts that much deeper for me. My wife, who is not much of a computer science person like the merge sort the best.
I love that you can hear the bubbling in bubble sort :D