Consider arranging the odd integers of the given sequence (1,3,5,7,9,............,n-1 or n) in n spaces, such that none of them occupies the same position as thier numerical value (i.e., 1 doesn't stay in the first position, or 3 in the third, and so on.)
You'll have to choose a position for (1) from n positions other than the first position. This can be done in n-1 ways.
Similarly, (3) can be anywhere other than in the third position or the chosen position for (1).There are n-2 ways of assigning a position to (3).
- There are n/2 odd numbers in the sequence if n is even and n+1/2 odd numbers if n is odd.
Having placed all but the last (odd) number,
1)if n is odd, there are n-1/2 ways to place the last number.
Hence, there are (n-1)!/(n-3/2)! ways to arrange the odd integers.
So, there are (n-1/2)!.(n-1)!/(n-3/2)! ways of permutating all the numbers in the sequence 1,2,3,.....n (since there will be n-1/2 even numbers).
2)if n is even, there are n/2 ways to place the last odd number.
So, there are (n-1)!/(n-2/2)! ways of arranging the odd numbers and (n/2)!.(n-1)!/(n-2/2)! total ways of permutating all the numbers in the sequence.