How many permutations of the sequence 1, 2, 3...N where none of the first K numbers in the original sequence is in it's place?

340 Views Asked by At

For the sequence 1, 2, 3 ... N there are of-course N! permutations. But for a given K, where 1 < K ≤ N how many permutations are there given none of 1, 2, 3, ... K is in the 1st, 2nd, ... Kth position correspondingly.

I have seen somewhere that the solution is

(N-K)! - C[K,1] * (N-K-1)! + C[K,2] * (N-K-2)! + ... + C[k,k] * (N-2K)!

But I don't quite understand it. A little help?