There are N students numbered from 1 to N standing in front of N chairs numbered from 1 to N. What is the number of ways the students can sit such that they don't sit on their own chairs? Student i cannot sit on chair i in none of the arrangements.
Example: when N = 4, {4,1,3,2} is not a valid arrangement as 3rd student sits on 3rd chair which is not allowed. {4,3,2,1} is allowed
Eg: when N = 2 there is only 1 possible arrangement, {2,1}
Eg: when N = 3 there are 2 arrangements, {2,3,1},{3,1,2}