A) Since a is last in line, we can disregard a, and concentrate on the remaining letters.
Let's start by drawing out a representation:
_ _ _ _ a
Since the other letters don't matter, then the number of ways simply becomes 4! = 24 ways
b) Since a is before d, we need to account for all of the possible cases.
Case 1: a d _ _ _
Case 2: a _ d _ _
Case 3: a _ _ d _
Case 4: a _ _ _ d
Let's start with case 1.
Since there are four different arrangements they can make, we also need to account for the remaining 4 letters.
![\text{Case 1: } 4 \cdot 4!](https://tex.z-dn.net/?f=%5Ctext%7BCase%201%3A%20%7D%204%20%5Ccdot%204%21)
Now, for case 2:
Let's group the three terms together. They can appear in: 3 spaces.
![\text{Case 2: } 3 \cdot 4!](https://tex.z-dn.net/?f=%5Ctext%7BCase%202%3A%20%7D%203%20%5Ccdot%204%21)
Case 3:
Exactly, the same process. Account for how many times this can happen, and multiply by 4!, since there are no specifics for the remaining letters.
![\text{Case 3: } 2 \cdot 4!](https://tex.z-dn.net/?f=%5Ctext%7BCase%203%3A%20%7D%202%20%5Ccdot%204%21)
![\text{Case 4: } 1 \cdot 4!](https://tex.z-dn.net/?f=%5Ctext%7BCase%204%3A%20%7D%201%20%5Ccdot%204%21)
![\text{Total arrangements}: 4 \cdot 4! + 3 \cdot 4! + 2 \cdot 4! + 1 \cdot 4! = 240](https://tex.z-dn.net/?f=%5Ctext%7BTotal%20arrangements%7D%3A%204%20%5Ccdot%204%21%20%2B%203%20%5Ccdot%204%21%20%2B%202%20%5Ccdot%204%21%20%2B%201%20%5Ccdot%204%21%20%3D%20240)
c) Let's start by dealing with the restrictions.
By visually representing it, then we can see some obvious patterns.
a b c _ _
We know that this isn't the only arrangement that they can make.
From the previous question, we know that they can also sit in these positions:
_ a b c _
_ _ a b c
So, we have three possible arrangements. Now, we can say:
a c b _ _ or c a b _ _
and they are together.
In fact, they can swap in 3! ways. Thus, we need to account for these extra 3! and 2! (since the d and e can swap as well).