The formula for speedup of a non pipelined system with a pipelined system: $\frac{k*n}{k+(n-1)}$,
where k is the number of stages=5 and n is the number of instructions. (this formula does not take in account the hazards) for that we have to add 20% of total instructions worth cycles more in the formula because for every 5th clock cycle we have to create a bubble.
New formula: $\frac{k*n}{k+(n-1)+\frac{n}{5}}$, now put k=5 and n=100. You get
speedup= $\frac{500}{(5+99+20)}$=$\frac{500}{124}$=4.03
But when sometimes we are not given the value of number of instructions, so we take ‘n’ to be infinity.
taking ‘n’ common in numerator and denominator: $\frac{n(5*k)}{n(\frac{5*k}{n}+6+\frac{(-5)}{n})}$ = $\frac{5*k}{6}$
(since n>>k, (k/n)-->0) = 25/6 = 4.16667 ≈ 4.17