# 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?

The correct answer is 696.

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. – Mark Bennet Jul 4 '15 at 11:13

## 1 Answer

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 :)

• This is not a natural interpretation of "or" in this context, which should probably be "and" to fix the answer. If the question is intended to be "how many do not fit the template DXXXXL" the excluded ones both begin with D and end with L. The question as written seems to exclude DXXXXX and XXXXXL both of which include DXXXXL, so care has to be taken over double-counting and the answer is different from the one given. – Mark Bennet Jul 4 '15 at 10:16
• @MarkBennet I think the usage of "or" is correct, here we consider the union of "do not begin with D" (like ANDILE, INADEL...) and "do not end with L" (like LNIDAE, DANILE...) – Salomo Jul 4 '15 at 10:25
• 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!$. – Mark Bennet Jul 4 '15 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}$. – Salomo Jul 4 '15 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. – Mark Bennet Jan 10 '16 at 15:40