Let vb = Speed of each bus and vc = speed of cyclist.
Relative speed of buses plying in the same direction of motion of cyclist =vb -vc.
The buses plying in the direction of the motion of the cyclist go past him after every 18 minutes, i.e., 18/60 hrs.
Distance covered is (vb - vc) x 18/60.
Since a bus leaves after avery T minutes, therefore distance is also equal to vb x T/60.
Therefore, (vb - vc) x 18/60 = vb x T/60.....(i)
Relative velocity of the buses plying opposite to the direction of motion of the cyclist is (vb +vc) after every 6 minutes.
Distance covered is (vb +vc) x 6/60
Thus, (vb + vc) x 6/60 = vb x T/60 ......(ii)
Dividing (i) by (ii) we have
(vb - vc/vb + vc) = 18/6 = 1
On simplification, vb = 2vc but vc = 20 kmh-1
Hence, vb = 40 km-1.
From equation (i) (40 -20) x 18/60 = 40 x T/60
or T = 9 minutes.