Hacker News new | ask | show | jobs
by jgershen 5327 days ago
Actually, the probability that all decks ever shuffled are unique is also very high. We can approximate the probability that any two of the n decks shuffled in human history were identical as p=1-n^2/52!

Using the same estimate as the OP for n (1.56x10^23) gives p=3.02x10^-22. Still fantastically low.

3 comments

Nice, I came to the comments to see if someone knew how to calculate this.

Related question. If there are exactly 2N people who vote in a binary election (ie: for presidential candidates) and they have an even 50/50% chance of voting either way, how do I compute the odds that they will have a even split? This is a generous estimate for the probability my vote will matter.

The exact answer is (2n choose n) * (1/2)^(2n). This is approximately sqrt(1/Pi n) as n grows large, with error O(n^(-3/2))
That's the same as the probability that 2N flips of a fair coin result in exactly heads: (2N choose N)(.5^N)(.5^N).

Check out: http://en.wikipedia.org/wiki/Binomial_distribution

> We can approximate the probability that any two of the n decks shuffled in human history were identical as p=1-n^2/52!

I think that this is way too low. Shouldn't it be the quite large number

1 - \prod_{i = 1}^n (1 - (i - 1)/52!)

(a la the birthday paradox)?

Sorry, I was thinking of the complementary probability (that there has been a coincidence).

Mathematica overflowed when I tried to compute this by brute force. The next best thing I can think of is to use the exponential approximation

    1 - x ≈ e^{-x},
good for very small `x`, such as ours. Ignoring the cascading errors gives

    \prod_{i = 1}^n (1 - (i - 1)/52!)
    ≈ \prod_{i = 1}^n e^{-(i - 1)/52!}
    = e^{-n(n - 1)/52!}
    ≈ 1 - n(n - 1)/52!.
The error should be roughly of the size

    \frac1 2\sum_{i = 1}^n [(i - 1)/52!]^2
    ≈ n^3/(2(52!)^2),
which is relatively small. (That's stronger, here, than just saying that it is small.) That is to say: I guess I agree with jgershen after all!
Alright, fine, it is comparatively lower. Better? :)