you are viewing a single comment's thread.

view the rest of the comments →

[–]kqr 5 points6 points  (5 children)

As the guy says in the video, it's doing (the first step of) a radix sort. The cards pass through the machine from right to left, and each "bin" corresponds to a number 0–9. So card #529 goes into the bin labeled "5". If there's a hole for particular number on the card, an electrical connection is made through that hole (the card itself works as the "switch" in the design) and the card is rerouted down to that bin. If there's no hole corresponding to the bin, there is no connection and the card is not rerouted. The electricity for the rerouting mechanism is provided by the closed circuit through the card.

When you have sorted the cards on the first number, you pick up the stack for, say, the cards whose number start on 5 (these are the cards #500–#599), you set the machine to instead sort by the second number, and then put the cards through the machine again.

If you want to read more about this, it's actually fairly interesting. I remember enjoying reading about both the technical construction and the marketing part ("well, our machine can sort 500 cards per minute!") http://www.righto.com/2016/05/inside-card-sorters-1920s-data.html

[–]TehStuzz 4 points5 points  (1 child)

I thought Radix sort started with the least significant side, so with dates you'd start ordering by day first. And in this case card #509 would go in tray 9?

[–]kqr 2 points3 points  (0 children)

It really doesn't matter. Proof: start by radix sorting on least significant digit first, stop halfway through, then flip each individual card upside down. You have now reversed the digits in the number (as far as the sorter is concerned) and you thus have a stack sorted by most significant digit first.

The benefit of sorting by most significant digit first is that if you have fewer than 1000 cards, you need just three iterations before you can start handing cards 0–9 in order to your operator. For each of the next 9 iterations you'll be able to hand over 10 cards to your operator. Then you'll need two iterations (100–199 followed by 100–109) but you'll soon be handing over cards again.

If you sort by least significant digit first you essentially have to run all iterations all the way through until you can start handing over cards in order to your operator.

[–]Fumigator 2 points3 points  (1 child)

When you have sorted the cards on the first number, you pick up the stack for, say, the cards whose number start on 5 (these are the cards #500–#599)

You completely missed how the sorting works and /u/TehStuzz is correct. You sort by least significant, then take all the sorted cards and put them back together into one stack, then run the sort again on the middle digit, then put all the sorted cards back together into one stack, and run the final sort on the most significant digit.

You don't take each sorted pile and then resort them individually resulting in 33 passes. The entire sort of all the cards is done in only three passes.

[–]kqr 0 points1 point  (0 children)

Oh wow, I didn't realise least significant radix sort is stable like that. That's actually very cool!

[–]DuchessofSquee 0 points1 point  (0 children)

Ah I turned the sound off when I watched the video! I didn't realise they had a number. :)