Let A, B be the corresponding specified speakers.
(a) Without any restriction the five persons can be arranged among themselves in 5! ways; but the number of ways in which A speaks before B and the number of ways in which B speaks before A together make up 5!. Also, the number of ways in which A speaks before B is exactly equal to the number of ways in which B speaks before A.
Therefore, the required number of ways = 1/2.5! = 60.
(b) Regarding AB in that order as a single person, we can arrange them with the remaining three in 4 ways. Each of these arrangements corresponds to a way in which A speaks immediately before B.
Therefore, the required number of ways in this case = 4! = 24.