Find the number of permutations of the letters D, I, P, L, O, M, A that do not begin with D or end with A.
My original answer was $7!- (6! \cdot 2) = 3600$, but this isn't correct.
The correct answer is $3720$.
Find the number of permutations of the letters D, I, P, L, O, M, A that do not begin with D or end with A.
My original answer was $7!- (6! \cdot 2) = 3600$, but this isn't correct.
The correct answer is $3720$.
We will subtract the number of permutations of the letters of the word DIPLOMA which have a D in the first position or an A in the last position from the total number of permutations.
There are $7!$ permutations of the seven distinct letters of the word DIPLOMA. Of these, $6!$ have a D in the first position and $6!$ have an A in the last position. However, as Michael Cohen observed in the comments, if we subtract $2 \cdot 6!$ from $7!$, we will have subtracted each permutation which has a D in the first position and an A in the last position twice, once when we subtracted those permutations with a D in the first position and once when we subtracted those permutations with an A in the last position. We only want to subtract those permutations once, so we must add them back. There are $5!$ permutations of the letters of the word DIPLOMA that have a D in the first position and an A in the last position. Hence, the number of permutations of the letters of the word DIPLOMA that do not begin with D or end with A is $$7! - 2 \cdot 6! + 5!$$
We can formalize the above argument by using the Inclusion-Exclusion Principle. The number of elements in the union of sets $A$ and $B$ is $$|A \cup B| = |A| + |B| - |A \cap B|$$ since \begin{align*} |A \cup B| & = |A - B| + |A \cap B| + |B - A| \tag{1}\\ & = |A - B| + |A \cap B| + |B - A| + |A \cap B| - |A \cap B| \tag{2}\\ & = |A| + |B| - |A \cap B| \tag{3} \end{align*}
(1) by the Addition Principle since $A \cup B$ is the union of the disjoint sets $A - B$, $A \cap B$, and $B - A$
(2) add and subtract $|A \cap B|$
(3) by the Addition Principle since $A$ is the union of the disjoint sets $A - B$ and $A \cap B$ and $B$ is the union of the disjoint sets $B - A$ and $A \cap B$
In the problem above, let $U$ be the set of all permutations of the letters of the word DIPLOMA; let $D$ be the set of permutations of the letters of the word DIPLOMA which begin with D; let $A$ be the set of permutations of the letters of the word DIPLOMA which end with A. Then the number of permutations of the letters of the word DIPLOMA which do not begin with D or end with A is \begin{align*} |U| - |D \cup A| & = |U| - (|D| + |A| - |D \cap A|)\\ & = |U| - |D| - |A| + |D \cap A|\\ & = 7! - 6! - 6! + 5!\\ & = 7! - 2 \cdot 6! + 5! \end{align*}