Saturday, February 5, 2011

The nature of human sorting

Been revising/learning from the text Introduction to Algorithms lately.

As many books seem to do it explains insertion sort by the example of a hand of cards, where as you get each card, you place it into the appropriate place. This is a good use of insertion sort because there is little overhead as any hand is bound to be rather small, finding the correct location will be fast.

This brought me to thinking how I have in the past sorted other things. Such as my music collection or magazines.

Looking back, it certainly hasn't been anything like insertion sort. I would generally pull a load of cds out of my rack, then separate them into piles by either name or genre, then sort out each pile. If it was larger I may have split it again, and after that point, sorted them by insertion sort. Sounds a lot like an optimised quicksort with an insertion sort for n<x. Of course instead of splitting at each stage into 2 piles I would split into a number of piles that I intuitively felt would make sense(eg piles of a-f, g-k, l-r, s-z).

Reexamining this has been quite interesting and I guess I should be happy with myself for using an efficient sorting algorithm for my cds. It should be interesting to examine in what other ways these algorithms are reflected in things people naturally do. When we solve mazes do we mentally solve them as a computer would(e.g as a graphing problem)? A lot of these algorithms have some pretty strong parallels in normal intelligent behavior yet it can be quite hard to pick up on initially in a book.

No comments: