Mike Anderson Wrote: 
> ...I frequently find that a random mix will select two songs off the
> same album within a short span of songs, even though I have quite a few
> albums (more than 600)...
Despite having a mathematics degree, I too was initially suckered by
the birthday paradox and was surprised by the frequency of multiple
tracks from a single album in a random playlist. To recover my pride,
since someone mentioned the birthday paradox
(http://en.wikipedia.org/wiki/Birthday_paradox), I could resist doing
the calculations. Here are some probabilities for seeing at least two
tracks from the same album (any album, not a particular album) for a
collection of 350 albums (my collection) and 650 (Mike's).

350 albums, playlist with
assuming replacement (individual tracks may repeat)

10 tracks, probability 12.2%
20 tracks, probability 42.5%
30 tracks, probability 72.2%
40 tracks, probability 90.1%

650 albums, playlist with
10 tracks, probability 6.7%
20 tracks, probability 25.6%
30 tracks, probability 49.3%
40 tracks, probability 70.6%

and assuming no replacement (individual tracks do not repeat in the
random playlist)

350 albums, playlist with
10 tracks, probability 11.0%
20 tracks, probability 39.3%
30 tracks, probability 68.5%
40 tracks, probability 87.7%

650 albums, playlist with
10 tracks, probability 6.0%
20 tracks, probability 23.4%%
30 tracks, probability 45.8%
40 tracks, probability 68.9%

Anyone who is inclined to do their own calculations and has a copy of R
(http://www.r-project.org) can use the following code to calculate the
"collision probability":

collision <- function(albums, playlist, tracks = 10, replacement =
TRUE) {
        n <- albums
        t <- tracks
        k <- playlist
        if (replacement)
                1 - exp(lfactorial(n) - lfactorial(n-k) - k*log(n))
        else
                1 - exp(k*log(t) + lfactorial(n) + lfactorial(n*t-k) -
lfactorial(n-k) - lfactorial(n*t))
}

Apologies for being a bit of a dag.


-- 
smc2911
------------------------------------------------------------------------
smc2911's Profile: http://forums.slimdevices.com/member.php?userid=4388
View this thread: http://forums.slimdevices.com/showthread.php?t=19696

_______________________________________________
Discuss mailing list
[email protected]
http://lists.slimdevices.com/lists/listinfo/discuss

Reply via email to