Let time of arrival be a random variable x.
then, its p.d.f. is f(x)=(15,0≤x≤50,elsewhere
Assume waiting time be g(x), a function of arrival time.
g(x)=(0,0≤x≤2(Greenlight)5−x,2≤x≤(Redlight)
Average waiting time
=E(g(x))=∫∞−∞g(x)f(x)dx
=∫50g(x).15dx+∫∞−∞g(x).0 dx
=∫200×15dx+∫52(5−x)×15dx
=[x−x210]52
=910=0.9