Speedup = TWP/TP.
Twp = Time taken without pipelining.
TP = Time taken with pipelining.
Let number of instructions = n
TWP = n * 4 * (1/3)ns [freq = 3GHz, so clock = (1/3)ns] [AVG CPI = 4]
Tp = [(1 * 5) + (n-1)*1] * (1/2)ns [freq = 2GHz, so clock = (1/2)ns] [AVG CPI = 1]
Speedup = $\frac{n*4*(1/3)}{[(1*5)+(n-1)*1]*(1/2)}$ = $\frac{8n}{3n+12}$
For large number of instructions, Speedup = $\lim_{n \to ∞} \frac{8n}{3n+12}$ = 2.67