a) If we take the phrase "no restrictions" quite literally the answer is . That is the number of functions from a set of six to a set of three. But of course that means one professor might be assigned all six.
One the other hand, if each prof. must have at least one course then the answer is 540. That is the number of surjections from a set of six to a set of three.
B) This a much easier question.
The answer is .
That is the number of ways to arrange the string .
For example the arrangement, means Prof A teaches the first and fifth courses; Prof B teaches the second and sixth