December 23, 2005

The Card-Shuffle Sequence

Warning: math geek content coming up.

Imagine you were a card-shuffling master and you could consistently do "perfect" shuffles, that is, you can split a deck right down the middle and merge them back together such that each subsequent card is taken from alternating halves. For example, if you were shuffling a small deck of ten cards:

1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Then after one shuffle, they would be in this order:

6, 1, 7, 2, 8, 3, 9, 4, 10, 5

Now, what would happen if you shuffled again?

3, 6, 9, 1, 4, 7, 10, 2, 5, 8

And if you kept on going? Well, after three more shuffles you would have:

10, 9, 8, 7, 6, 5, 4, 3, 2, 1

Surprised? Maybe, maybe not. Well, it shouldn't be surprising that after five more shuffles, you would be back to your original order:

1, 2, 3, 4, 5, 6, 7, 8, 9, 10

Cool, eh? If you're a perfect shuffler, a ten-card deck will return to its original order after ten shuffles.

Other examples? Two cards (obviously) get restored after two shuffles; four cards, four shuffles. If you think you're seeing a simple pattern, though, think again. Six cards requires three shuffles. Eight cards requires six shuffles.

If we line up the number of shuffles required to return a deck to its original order for increasing even deck sizes, it forms a strange sequence of numbers. We'll just ignore decks with an odd number of cards. Here are the first 26 (for decks of sizes 2 through 52):

2, 4, 3, 6, 10, 12, 4, 8, 18, 6, 11, 20, 18, 28, 5, 10, 12, 36, 12, 20, 14, 12, 23, 21, 8, 52, ...

I'm quite fascinated by this sequence. As you can see, it's not monotonically increasing: sometimes, a larger number of cards will require fewer shuffles to return it to its original order. Sometimes, the deck will be in reverse order at the half way point, sometimes not. Sometimes, it's an odd number of shuffles so there is no half way point. I think it must have something to do with prime factorizations, but I don't get it. It's deliciously mysterious.

By the way, 126 cards requires only 7 shuffles. Cool!

December 10, 2005

It's Not a Sony

My Sony boycott continues. I have a set of Sony earphones that started cutting out on the right side. So, I decided to replace them. Normally, I would have replaced them with another set of Sony earphones. But not now, of course.

It's a Sony It's Not a Sony

So, whereas before, Sony lost some business because of my decision not to buy an MP3 player, this time, Sony has lost business to its competition. I know, a set of earphones is a piddling small amount of money that Sony, as a whole, really doesn't care about, and for that matter, neither do I. But it's a little something.

This BBC article, which I found via this slashdot story, had me thinking I might have reason to end my boycott, but there was no action, just a few words of apology, and not much of an apology at that. Sigh.

I should note that I've signed the Boycott Sony Petition, and the Sony Boycott Movement has a blog (not that it's an organized entity or anything) here: The Sony Boycott Blog. A friend encouraged me to write to Sony directly, which I may yet do.

Powered by Blogger