Comment count is 6GravidWithHate As far as I can tell this is what he's doing.
Assign each card a number in base 4:
2 02, 3 03, 4 10, 5 11, 6 12, 7 13, 8 20, 9 21, 10 22, J 23, Q 30, K 31, A 32
The initial ordering is, 4 10, J 23, 2 02, 10 22, A 32, 6 12, 9 21, 3 03, 7 13, K 31, Q 30, 8 20, 5 11
Divide the cards into 4 piles based on their least significant digit of the number you've assigned them:
0 4 10, Q 30, 8 20
1 9 21, K 31, 5 11
2 2 01, 10 12, A 32, 6 12
3 J 23, 3 03, 7 13
Now take the piles in order, this gives you the following list:
4 10, Q 30 , 8 20, 9 21, K 31, 5 11, 2 02, 10 12, A 32, 6 12, J 23, 3 03, 7 13
The thing about this list is that it's in order with respect to the least significant digit. So it's impossible to have the 9 come before the 8 or the 10 before the 5 etc...
So what if you divide these cards into buckets with respect to the next most significant digit?
0 2 02, 3 03
1 4 10, 5 11, 6 12, 7 13
2 8 20, 9 21, 10 22, J 23
3 Q 30, K 31, A 32
The cards are now ordered on both digits which means, in this case, that they're sorted.
Using cards obfuscates the process because it's not immediately clear how the cards are being grouped.
 Bort The guy has arbitrarily chosen to do this with by groups of 4 (it's a very good choice for a 13card set, but it's still arbitrary), but this would probably be easier to see with a stack of file cards numbered from 01 to 99.
Step 1: break the cards up into ten piles, based on the last digit.
Step 2: stack those piles back together, 0's first, then 1's, then 2's, etc.
Step 3: now break the cards up into ten piles, based on the first digit.
Step 4: stack those piles back together, 0's first, then 1's, then 2's, etc.
Your cards are now sorted. First thing you did was sort your cards by the lowest digit, and then on a second pass you refined your sort on the next digit (in this case the highest digit). In theory you could do this for as many digits as are required.
 fedex and so computers do all this sort of throatsinging bit with it, do they?

 MrBuddy Sounded to me like he was having a gastrointestinal tract problem.
 memedumpster This is really basic stuff. Now all the schizophrenics are cured and we can stop stalking them for Jesus.
 Register or login To Post a Comment 
 