(a) S×L is the set of all (coach, locker) pairs, so
∣S×L∣=∣S∣×∣L∣=3×3=9.
The nine pairs are (P,L1),(P,L2),(P,L3),(Q,L1),…,(R,L3). A relation is any subset of these nine, and building a subset means making an independent in-or-out decision about each pair. That is 2 choices, nine times over:
29=512.
The loosest setting permits 512 allocations.
(b) Now each of the three coaches must receive exactly one locker — this is precisely a function S→L. Coach P can be given any of the 3 lockers, and independently so can Q, and independently so can R:
3×3×3=33=27.
The normal setting permits 27 allocations. Note the direction of the exponent: it is ∣L∣∣S∣, one choice from L for each member of S, not the other way round.
(c) The strictest setting asks for a function S→L that is one-one and onto, that is, a bijection. Fill the lockers in order: P may take any of the 3 lockers; Q must then take one of the 2 that remain; R is left with the 1 remaining locker.
3×2×1=3!=6.
The strictest setting permits 6 allocations.
(d) f is neither one-one nor onto.
Not one-one. f(P)=L2 and f(R)=L2, so two different coaches are mapped to the same locker while P=R.
Not onto. The lockers actually used are {L2,L3}, so the range of f is {L2,L3}, not the whole of L. Locker L1 is nobody's image, and it sits empty.

The two failures arrive together, and that is no accident. S and L both have exactly three elements, and for a map between two finite sets of the same size, one-one and onto are equivalent — so as soon as f repeats a locker it must also miss one.
(e) Every strict allocation is also a normal one, so subtract:
27−6=21.
So 21 of the 27 normal allocations fail the strict test.
In each of those 21, at least two coaches are sent to the same locker. Since all three coaches are still allocated and only three lockers exist, that sharing leaves at least one locker with nobody assigned to it. The allocation f of part (d) is one of these 21: P and R share L2, and L1 goes unused.