Answer:
17: 480
(We first arrange all of the candidates except b in a line. This can be done in 5! ways. We now add b to the line. Since we now want to count the arrangements where b is positioned next to a, there are two possibilities for the position of b. (Either left of a or right of a).
There are thus 2⋅5! ways of arranging the candidates so that a and b are next to each other, and hence 6!−2⋅5!=4⋅5!=480 ways of arranging the candidates so that a and b are not next to each other)
18: i don't know sorry