Friday, September 4, 2009

Have it Your Way?

Sheesh, I take the summer off and the Inbox is full. Time to get a bit caught up. Here's a good one:

Dear Mathman,

I have an iPod shuffle. I really like the thing as it allows me to ignore everyone around me and get exactly what I want when I want it- except for when I use the shuffle mode. Half the time I do it just ruins my day as I get stuck listening to a mix that just Dysons. Seriously, why doesn't this thing just give me what I want?

Sincerely,
Cody H.


Dear Cody,

Bigger isn't necessarily better. Especially when it comes down to doing the iPod shuffle. The more songs you have on that iPod, the greater the chances that the song you want to hear won't be coming up next. It makes sense if you think about it, but did you ever stop to think what the chances are you'll get a mix you want?

Let's think back to a time before the mp3 format. Let's go back to when "Don't Stop Believin'" first came out on 8 track, cassette, or LP. At that time you would have to buy the entire album of 10 or so songs in the order that the band intended it to be. You couldn't change the order that the songs were in unless you did some type of physical work. The "shuffle" option (or "random" in the CD world) didn't exist. You were forced to listen to the album or you had to physically change the media- you couldn't just push a button to access another band's work (unless you bought the K-Tel compilations).

The point of this? There was only one easy choice to hear the album (2 if you count side A and side B).

When CDs popped into the mix, things began to change. Now you could hit the "random" function and you could hear the songs in a bunch of different orders. This was good and bad since it's like reading a book by skipping around from chapter to chapter not necessarily staying in order.

How many orders could you hear all of the songs? Get in the math zone.

If you had a single, it would typically have 3 or 4 songs on it. (So how's that a single?) Let's figure out how many orders you could listen to the songs in with various numbers of songs: (Let's just say the first song starts with "A", the second with "B", the third with "C", ...)

One song : One way
Two songs : Two ways (A then B or B then A)
Three songs : Six ways-
ABC
ACB
BAC
BCA
CAB
CBA
Four songs : 24 ways. Think of it as three songs with a different starting song each time. Ex: DABC DACB DBAC DBCA DCAB DCBA. Note that the D comes first, but there are 6x4 ways since A,B, or C could have been as first as well.
Five songs: 5 x 24 = 120
Six songs: 6 x 120 = 720
Seven songs: 7 x 720 = 5,040
Eight songs: 8 x 5,040 = 40,320
Nine songs: 9 x 40,320 = 362,880
Ten songs: 10 x 362,880 = 3,628,800 ways

Whoa.

That's just for a 10 song CD placed on "random". Imagine an iPod with 500 songs on it. Yikes!

Let's look at the pattern again to figure out what is happening:
1 song : 1 way
2 songs : 2 ways you could pick the first, the second is decided; 2x1=2
3 songs : 3 ways to choose the first, 2 for the second; 3x2x1=6
4 songs : 4 ways for the first then hit me baby one more time with the results from the 3 song calculations; 4x3x2x1
5 songs : 5x4x3x2x1
6 songs : 6x5x4x3x2x1
and on and on.

There is a term for this, it's called the factorial. It looks like this: ! It means, HOLY COW THAT'S A WHOLE LOT!

so 10 songs is 10! = 10x9x8x7x6x5x4x3x2x1.

With over 3 million ways to listen to just 10 songs, no wonder why you've got a good chance for a bad mix!


stay radical.