"Question: Find the number of permutations of 1, 2, 3, 4, 5, 6, 7 that do not have 1 in the first place, nor 4 in the fourth place, nor 7 in the seventh place.
Ans:We use the inclusion-exclusion principle with three properties of the permutations: 1 in the first place; 4 in the fourth place; 7 in the seventh place. Thus the answer is 7! - 6! - 6! - 6! + 5! + 5! + 5! - 4!"
Above is the Q&A from "Maths of Choice", I am not sure whether I got the intuition correct from the provided answer. Below is the inclusion/exclusion of each term which I think corresponds to the answer. Could somebody kindly advise whether I got the intuition right.
7! = permutations of 7 with no repetition
-6! = exclusion of 1 in the first place
-6! = exclusion of 4 in the fourth place
-6! = exclusion of 7 in the seventh place
+5! = inclusion of 2nd,3rd,4th,5th,6th,7th that were excluded when excluding 1 in the 1st place
+5! = inclusion of 1st,2nd,3rd,5th,6th,7th that was excluded when excluding 4 in the 4th place
+5! = inclusion of 1st,2nd,3rd,4th,5th,6th that was excluded when excluding 7 in the 7th place
-4! = exclusion of 2nd,3rd,5th,6th,7th that were included from the last 3 inclusions(+5!+5!+5!).
Update
According to @N. F. Taussig's answer, I should approach as such:
n = 7!
n(a) = -6!; exclusion of 1 in the first place
n(b) = -6!; exclusion of 4 in the fourth place
n(c) = -6!; exclusion of 7 in the seventh place
n(a,b) = +5!; inclusion of 1 and 4 from first & fourth place
n(a,c) = +5!; inclusion of 1 and 7 from first & seventh place
n(b,c) = +5!; inclusion of 4 and 7 from fourth & seventh place
n(a,b,c) = -4!; exclusion of 1,4,7 from first, fourth & seventh place