Hacker News new | ask | show | jobs
by soVeryTired 3583 days ago
>I have the impression that the challenge is in observing the correct algorithm rather than calculating the probability

I've got a stats PhD and I guessed the solution but couldn't calculate the probability of having a max cycle length of 50 or less. To be fair, the calculation isn't hard once you see it, but it's not trivial either.

The 30% figure threw me since I know the probability of a random permutation having a fixed point is 1/e (just over 30%), so I went looking for ways to link the cycle length to the Poisson distribution.