How many permutations of the letters DANIEL do not begin with D or do not end with L?

How many permutations of the letters DANIEL do not begin with D or do not end with L?

This answer does not make sense as there are 120 (5!) ways the letters can be arranged so that they start with D, however subtracting this from the total number of permutations, 720 (6!), we get a number less than 696 with only having attempted half the problem!

Any help is much appreciated, thanks in advance.

• I think you are right in your interpretation of the problem as you have written it. Can you make sure you have quoted the question you've been given, because small changes in the wording can make a big difference in the meaning. Jul 4, 2015 at 11:13

The requirement "do not begin with D or do not end with L" is a bit tricky, for instance, it means that "DANILE" is accepted. Hence, what is not accepted is of the form "DXXXXL", and therefore we have $6!-4!=696$ possibilities :)
• But that is not the calculation you have done. The answer would be $6!-2\times 5!+4!$ not $6!-4!$ - the count of the union being $5!+5!-4!$ with the $4!$ being the double-counting element. You are counting the intersection as $4!$. Jul 4, 2015 at 10:34
• @MarkBennet Oh, just ignore my last comment, I got something confused there, let me clarify here: Take $S_\text{D}$ and $S_\text{L}$ be the set of possibilities of having D at begin and having L at end, respectively. Now, what we want to eliminate is $\neg (\neg S_\text{D} \cup \neg S_\text{L})$, that is $S_\text{D} \cap S_\text{L}$. Jul 4, 2015 at 11:05
• @CCC You want to eliminate strings of the pattern $DXXXXX$ and $XXXXXL$ and there are $5!$ of each type. But the $4!$ strings of the form $DXXXXL$ are of both types and have therefore been counted twice (once for each type) - so subtract $4!$ to make sure they are counted only once. Jan 10, 2016 at 15:40