Premium problem97. Fixed Points in a Shuffle

Easy Locked

Shuffle n items uniformly. Return the expected number that end up in their original position.

Each item stays put with probability 1/n1/n, and there are n of them, so the answer is exactly 1 for every n above zero. A hundred items or a million: the expected count is still one.

Input

5

Output

1.0

Premium problem

This one's part of Premium. Unlock the full Probability track plus every other premium problem on the site.

Implement solve(...)