Loading [MathJax]/extensions/TeX/mathchoice.js

Problem #61

Derangements

There are n people and n houses, such that every person owns exactly one distinct house. Out of these n people, k people are special (k \lt = n). You have to send every person to exactly one house such that no house has more than one person, and no special person goes to his own house. Let S(n,k) be the number of ways of doing this. Find the value of S(654321,123456). Give your answer \mod 10^9 + 7.

Contributed by Satyam Vijay

Solved by 40 users

Log in to submit answers.

Is something wrong?

Maintaining a collection of high quality questions is our top priority. If, however, you do find an error, report the problem and we'll make sure it is reviewed soon.