Find the number of permutations of integers from $1$ to $10$ inclusive that do not start with $1$ and do not end with $10$ Find the number of permutations of integers from $1$ to $10$ inclusive that
$a)$ do not start with $1$ and do not end with $10$.
$b)$ no odd integer will be in its right place.
$c)$ numbers $1$, $4$ and $7$ are not in their right places.
For the question $a)$, I tried something like this:
Since the first place cannot be a $1$, there are $9$ ways to fill it. Similarly, the last position can't be a $10$, so there are only $8$ ways to fill it. The remaining digits can be filled in $8!$ ways.
So by rule of product, the answer would be $9 \cdot 8 \cdot 8!$.
But the answer given in the key seems different. I'm not sure if I have gone wrong somewhere in my approach.
 A: All three parts of this problem can be solved by using the Inclusion-Exclusion Principle.

Find the number of permutations of integers from $1$ to $10$ inclusive that do not start with $1$ and do not end with $10$.

We will subtract the number of permutations which start with $1$ or end with $10$ from the total number of permutations.
There are $10!$ permutations of the ten distinct integers $1, 2, 3, 4, 5, 6, 7, 8, 9, 10$.
If we place a $1$ in the first position, there are $9!$ ways to permute the remaining nine distinct integers in the remaining nine positions.
If we place a $10$ in the last position, there are $9!$ ways to permute the remaining nine distinct integers in the remaining nine positions.
Subtracting those permutations with a $1$ in the first position or a $10$ in the last position from the total number of permutations gives us a preliminary count of
$$10! - 9! - 9!$$
but we have subtracted too much.  We have counted those permutations which have both a $1$ in the first position and a $10$ in the last position twice, once when we subtracted those permutations which have a $1$ in the first position and once when we subtracted those permutations which have a $10$ in the last position.  We only want to subtract such cases once, so we must add them to the total.
If we place a $1$ in the first position and a $10$ in the last position, the remaining eight distinct integers can be permuted in the remaining eight positions in $8!$ ways.
Hence, the number of permutations of the integers $1, 2, 3, 4, 5, 6, 7, 8, 9, 10$ which do not start with $1$ and do not end with $10$ is
$$10! - 2 \cdot 9! + 8!$$
I suggest that you try part (c) next.  Subtract the number of permutations which have a $1$ in the first position or a $4$ in the fourth position or a $7$ in the seventh position from the total number of permutations by using the Inclusion-Exclusion Principle.  Doing so is easier than doing part (b) since you have three excluded conditions rather than five.
