Alice and Bob play a lot of games. Here's what a game looks like. At first they agree on a positive integer . Then they do the following simultaneously: Alice writes down a permutation of the first positive integers, and Bob writes down a (possibly empty) subset of the first positive integers. Alice wins if there is at least one index such that both and are inside the set that Bob picked.
Assuming they both make their choices uniformly at random (that is, Alice chooses a random permutation and Bob chooses a random subset), what is the probability that Alice wins?
Input Format
Output Format
Note: It is guaranteed that the probability can be expressed as a rational number that exists modulo .
In case of , Alice can only choose the permutation . Alice wins if Bob chooses the subset and loses if Bob chooses the empty subset . So the probability that Alice wins is .
In case of , Alice can choose either or . In the former case, Alice wins if Bob chooses anything except the empty set ( choices). In the latter case, Alice wins if and only if Bob chooses the set . So the probability is .
In case of , similarly exhausting the possibilities we can see that Alice wins with the probability .