How this calculation works
Count permutations that leave exactly the requested number of items in place.
Choose k fixed positions and derange the remaining n−kA worked example
Choose two of five positions in ten ways, then derange the remaining three in two ways.
Good to know
The remaining items may not stay in their original positions.
Reference: NIST DLMF, Functions of Number Theory (opens in a new tab) ↗
Read the result
Count permutations that leave exactly the requested number of items in place.
The primary result is labeled “Permutations”. Keep the input definitions in view when comparing this result with another method.
Try a related calculation
The remaining items may not stay in their original positions.
For a related exercise, try the greatest common divisor.
A few questions, answered
How can I check the default inputs by hand?
Choose two of five positions in ten ways, then derange the remaining three in two ways.
Which rule does this calculator apply?
Choose k fixed positions and derange the remaining n−k