Showing posts with label James Fallows. Show all posts
Showing posts with label James Fallows. Show all posts

Monday

Quick sort algorithm, illustrated




You've done this instinctively: divided something that needed to be sorted - cards, for instance - into smaller groups, like suits, and then sorted so that each suit is in order. That operation is analogous to a computer algorithm, quick sort, which Wikepedia describes as:
Quicksort is a divide and conquer algorithm. Quicksort first divides a large list into two smaller sub-lists: the low elements and the high elements. Quicksort can then recursively sort the sub-lists.
The steps are:
  1. Pick an element, called a pivot, from the list.
  2. Reorder the list so that all elements with values less than the pivot come before the pivot, while all elements with values greater than the pivot come after it (equal values can go either way). After this partitioning, the pivot is in its final position. This is called the partition operation.
  3. Recursively apply the above steps to the sub-list of elements with smaller values and separately the sub-list of elements with greater values.
So what's the video? It's a very good illustration of the process. I found it yesterday via James Fallows' blog. Click the link for his gloss.

The same group also developed an illustration of a bubble sort - perhaps not as good an algorithm, but still a good dance.



Friday

Context: it's how you use the numbers, not what they are

The normally extremely clear writer James Fallows (his terrific blog on politics, technology, and beer, among other things, is here) has posted a letter from one of his readers. The full blog post is here; the excerpt I'm interested in is:
First, our public policy discussion has become too wonkish, by being entirely focused on measurable outcomes at the expense of all others.  (Another example: the health care debate, the vast majority of which was about costs instead of the moral imperative of universal health care)...
It may just be the writing (to repeat, it's not Fallows' but a reader's comment), but this strikes me as an example of someone blaming the numbers, as opposed to the interpretation of the numbers, for the politics. Sometimes a mathematical model is our best chance of understanding what is happening in the world (even if that understanding is weak). But it's our interpretation of the numbers - the context we give it - that guides how we use them. Numbers are never just numbers.

Popular Posts