I'll betcha that you could show me the math involved in calculating this, though, and I'd enjoy seeing it.

OK, you asked for it.

Suppose you're playing one of your 1449 tracks. The chance that the next track will also come from the same one of your 160 albums is 1/160. The chance that the one after will too, is another 1/160 [*]. So, for each of the 1449 tracks in the playlist, the chance that it'll be the start of a run of three from the same album is 1/(160*160).

The chance of this happening somewhere in the playlist of 1449 tracks is thus 1449*1/(160*160) [*] or about 5.7%.

But the original event wasn't three in a row, it was three out of four. The probability of the fourth track not being from that album, is 159/160 [*]. So the chance of three in a row from the same album followed by the fourth not being from that album is 159/(160*160*160). But to find the probability of "three out of four", there are four positions the fourth, not-from-the-same-album, track could be in. So the probability of any given track being the start of a run of three-out-of-four is 4*159/(160*160*160).

The chance of this happening at least once in a playlist of 1449 tracks is 1449*4*159/(160*160*160) or about 22.5%.

So it won't happen every time you shuffle, but it's not the end of the world for our randomisation algorithm.

Peter


[*] Ignoring very small second-order terms. For instance, the probability of the next track being from the same album isn't 1/160, it's slightly reduced by the fact you've just played a song from that album, so that not quite 1/160 of the remaining songs are also from that album.