Suppose the bottle contains x units of medicine and y units is taken out and replaced with water. The expression to find the the amount of pure medicine solution after replacement by n times is given by

In the given question, v =30mg, x=40 mg.
n=1, since replacement is done only one time. We have to find y.
Substitute values in equation.

So, 10 mg/2.5 ml solution is poured out and replaced with water