(a) The speeds are vw=1.333×108≈2.26×108m/s and vg=1.53×108=2×108m/s.
twater=2.26×1080.30≈1.33×10−9s
tglass=2×1080.20=1.0×10−9s
The pulse through the glass emerges first. Light is slower in glass, but it has only 20cm to travel instead of 30cm; the time depends on both the speed and the distance.
(b) The glass must take the same 1.33×10−9s:
d=vgt=2×108×1.33×10−9≈0.27m
About 27cm of glass takes as long as 30cm of water. (Equivalently, d×1.5=30×1.33.)