Mixture problem? Repeatedly extract/replace X units of fluid (with fluid #2) to attain X% mixture ratio?

Let's say I have a 100 liter container of water. I extract 10 liters of water, and replace it with 10 liters of juice. Now, the container is now 10% juice / 90% water.

I can keep repeating this to increase the percentage of total juice (Extract 10 liters of mixture, and replace with 10 liters of pure juice)

So, for round two, extracting 10 liters means there are 90 liters left of 90% solution (1 part juice, 9 parts water). (90 liters)(.9) = 81 liters of water. 9 liters of juice. I have removed 10 liters (1 liter juice, 9 liters water) I now replace this with 10 liters of juice. Total of 9+10 = 19 liters of total juice. So, after doing this a 2nd time, I have 19% juice.

If I do this a 3rd time, I remove 10 liters, and the remaining 90 liters have (90)(.81)=73 liters of water and 17 liters of juice (total 90 liters). Replace with 10 liters of juice = 27 liters of juice. 27% juice.

1) How many times do I need to do this to have 90% juice?

2) Is there a general formula that can determine percentage of fluid #2 as a function of number of extract/refill cycles completed?

3) Is there a general formula that can determine how many extract/refill cycles are needed to attain x% of fluid #2?

Also, what would be the correct tag for this question? What category of math is this called? Mixture problem?

-

Suppose that we start with $1$ litre of water, and each time remove a proportion $p$ of the liquid, and replace it with juice. Instead of working directly with the amount of juice, it is much nicer to work instead with the amount of water.

Let $Y_n$ be the amount of water in the container after $n$ replacements. Note that $Y_0=1$.

In general, on the $(n+1)$-th removal, we remove a proportion $p$ of the liquid, and hence of the water, leaving an amount $(1-p)Y_n$ of water. Then we add an amount $p$ of juice, but that does not affect the amount of water in the jug. This gives us the recurrence $$Y_{n+1}=(1-p)Y_n$$ Thus at each iteration, the amount of water decreases by a factor $1-p$. It follows that $$Y_n=(1-p)^n.$$

If $X_n$ is the amount of juice after $n$ iterations, we have $$X_n=1-Y_n=1-(1-p)^n.$$ This answers your Question $2$, except that to get the percentage we need to multiply by $100$.

If the container originally has an amount $A$ of water, and each time we remove a proportion $p$ of the liquid, so an amount $pA$, and replace it with juice, we find that the amount of juice after $n$ iterations is $$A-A(1-p)^n.$$

To answer your Question $1$, we want to know how many iterations are needed until we are $90$ percent juice. Here $p$, the replacement proportion, is $0.1$. And we want to how many iterations are needed until we are $10$ percent water (because $90$ percent juice).

So we want to solve the equation $$(1-0.1)^n=0.1$$ This can be done by trial and error. For these particular numbers, that is perfectly feasible. But in general, we use logarithms, to any base you like. We get $$n \log(0.9)=\log(0.1).$$ My calculator gives $n=21.854345$. Of course, $n$ must be an integer. The conclusion is that $21$ removals are not enough, but $22$ bring us to more than $90$ percent juice.

A general formula can be found in the same way. Suppose that each time we remove a proportion $p$ of the liquid. We want to know how many replacements are needed until the proportion of juice is $x$, meaning that the proportion of water is $1-x$. We need to solve the equation $$(1-p)^n=1-x.$$ Take logarithms. We get $n\log(1-p)=\log(1-x)$, which gives $$n=\frac{\log(1-x)}{\log(1-p)}.$$ This will not in general be an integer, but that is easily dealt with. This answers your Question $3$.

As to the last question, definitely not fluid dynamics!

-
André Nicolas, thanks for much for your time, and such a clean, well-written response. I agree it's easier to focus on the % of water left, and simply keep multiplying by .90 – JackOfAll Mar 2 '12 at 0:42