Question 1183064
<font color=black size=3>
Part (a)


I'll break things up into cases.<ul><li>Case 1: the letter A is in slot 1</li><li>Case 2: the letter A is in slot 2</li><li>Case 3: the letter A is in slot 3</li><li>Case 4: the letter A is in slot 4</li><li>Case 5: the letter A is in slot 5</li></ul>Conveniently, the case number and the slot number line up perfectly.


If case 1 happens, then we have 4 letters to permute (B,C,D,E) in four slots. That gives us 4! = 24 different permutations in this case.
Since we'll refer to this later, I'll make A = 24.


If case 2 occurs, then D must go in the three remaining slots to the right of A. That consequently means that we have 3 choices for the first slot (B, C or E)
So we have...<ul><li><font color=blue>3</font> choices for slot 1 (either B, C or E)</li><li><font color=blue>1</font> choice for slot 2 (the letter A)</li><li><font color=blue>3</font> choices for slot 3 (D plus any of {B,C,E} such that we don't pick whatever was in slot 1) </li><li><font color=blue>2</font> choices for slot 4</li><li><font color=blue>1</font> choice for slot 5</li></ul>Once we arrive at slots 3 through 5, we have this countdown going on (3,2,1)
Overall, we have <font color=blue>3</font>*<font color=blue>1</font>*<font color=blue>3</font>*<font color=blue>2</font>*<font color=blue>1</font> = 18 different permutations to satisfy case 2.
Let B = 18 so we can use it later.


Now onto case 3.
We have<ul><li><font color=blue>3</font> choices for slot 1 (B, C or E)</li><li><font color=blue>2</font> choices for slot 2 (B, C, or E but we cannot reuse whatever is in slot 1)</li><li><font color=blue>1</font> choice for slot 3 (the letter A)</li><li><font color=blue>2</font> choices for slot 4 (D, plus whatever isn't already taken)</li><li><font color=blue>1</font> choice for slot 5 (whatever letter hasn't been used yet)</li></ul>We therefore have <font color=blue>3</font>*<font color=blue>2</font>*<font color=blue>1</font>*<font color=blue>2</font>*<font color=blue>1</font> = 12 permutations here.
Let C = 12


Then case 4 would have...<ul><li><font color=blue>3</font> choices for slot 1 (B, C, or E)</li><li><font color=blue>2</font> choices for slot 2 (same as before but we cannot reuse a letter)</li><li><font color=blue>1</font> choice for slot 3 (same idea but now we cannot reuse those two letters)</li><li><font color=blue>1</font> choice for slot 4 (the letter A goes here)</li><li><font color=blue>1</font> choice for slot 5 (the letter D must go here to be to the right of A)</li></ul>We have <font color=blue>3</font>*<font color=blue>2</font>*<font color=blue>1</font>*<font color=blue>1</font>*<font color=blue>1</font> = 6 permutations for case 4.
Let D = 6.


Lastly, we consider case 5.
There are no permutations possible such that A is in slot 5 and D is to the right of letter A.
So E = 0.


Add up the results we found
A+B+C+D+E = 24+18+12+6+0 = <font color=red>60</font>


Interestingly, this value is exactly half of 5! = 120. I'll let you decide if that's a coincidence or not. 


<font color=red>Answer: 60</font>


===================================================================================================
Part (b)


Again we consider various cases
Case 1: The string contains DB
Case 2: The string contains BE
Case 3: both cases 1 and 2 happen simultaneously


The sample space of letters to pick from is {A,B,C,D,E}
That reduces to {A,C,E} when we kick out D and B. This is because D and B must be together, so we "glue" them together to form the "megaletter" DB.
In other words, we get this new set: {A,C,E,DB} where again DB is treated as one item.


There are 4 letters in that new set so there are 4! = 24 permutations.
You should find that there are 24 permutations of {A,C,D,BE} as well.


So the number of strings in case 1 and case 2 are 24 items each.


For case 3, we consider the set {A,C,DBE} where now we treate "DBE" as one item.
This is because we want DB and BE to happen at the same time. So they must share that common B as the glue or bridging letter.


There are 3! = 6 permutations here


The question is now: How many strings are there such that we have DB, BE, or both?
That would be 24+24-6 = <font color=red>42 strings</font>


We simply add up the counts for cases 1 and 2, then subtract off the count for case 3. 
Case 3 is the overlapping portion between cases 1 and 2. When adding cases 1 and 2, we are double-counting that overlapped portion. 
For more info, see the inclusion-exclusion principle.
<a href = "https://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle">https://en.wikipedia.org/wiki/Inclusion%E2%80%93exclusion_principle</a>


Or you could think of it like this
n(A or B) = n(A) + n(B) - n(A and B)


<font color=red>Answer: 42</font>


===================================================================================================


To verify either answer, you can use this handy permutation calculator to generate all 5! = 120 strings (admittedly it sounds like a lot of strings but a computer can do this very quickly and you can use a search feature to pick out the items you want)
<a href = "https://www.mathsisfun.com/combinatorics/combinations-permutations-calculator.html">https://www.mathsisfun.com/combinatorics/combinations-permutations-calculator.html</a> 
You can also take advantage of the pattern search tool on that same link to quickly filter out the stuff you don't want.
</font>