I would not recommend this method, but if you want to save time you can plug in the formula. The solution is given below. Chris gave the original solution, however I think he is lacking a bit of explanation. This is my take on his original solution.
The formula is -
\(\frac{QuantityOfAleft}{QuantityOfAoriginallyPresent} = (1-\frac{R}{T})^n\)
R = Replacing quantity of B
T = Total quantity of mixture
n = number of operations of replacement
We are replacing water in the mixture with pure milk.
Quantity of A originally present = 8 litres (water)
Then, \(\frac{Quantity of A left}{8} = (1−\frac{10}{20})^n\), where R is the amount of the mixture replaced by milk in each of the steps = 10 litres, T is the total volume of the mixture = 20 litres, and n is the number of times the cycle is repeated.
Therefore, Quantity of A (water) left = 2 litres.
This is the quantity of water in the mixture after the process is done twice.
So, the final quantity of water in the 20-litre mixtures is 2 litres.
Hence, the mixture will have 18 litres of milk and 2 litres of water.
Ratio of milk to water = 18:2 = 9:1