# Bottle rinsing with fixed amount of wash water

Given $L$ units of wash water, we want to wash out a vessel (eg, a milk bottle, honey jar, chemistry flask...) using a series of rinses that minimize the amount of Stuff other than water remaining in the jar.

Suppose $R$ units of liquid remain in the vessel each time we pour out the rinse; and suppose the original concentration of Stuff is $\alpha$, ie there is $R\cdot\alpha$ units of Stuff in the jar originally. Also suppose complete mixing of wash water with residue, so that when we add $x$ units of water to the $R$ in the jar, the new concentration is $\frac{R\cdot\alpha}{R+x}$. For example, if we put all $L$ units of wash water in at once, our final result is $R\cdot\frac{R\cdot\alpha}{R+L}$ units of Stuff left in the jar.

(A better model would make $R$ a function of drainage time and viscosities, make new concentration a function of shake time, allow variable amounts of wash water, and account for differences in viscosity of water vs. Stuff, etc. In this simplified problem we ignore all that. However, if I have the physics all wrong even in the simplified scenario, please let me know.)

Question 1: Suppose $L=1$, $R=0.01$, $\alpha=1$. For each $k\in \{2...7\}$, where $k$ is a fixed number of rinses, what is an optimal division of wash water? (For example, when $k=2$, is $(L/2, L/2)$ the best division? If not, what is?)

Question 2: For some $(L,R,\alpha)$, suppose the best result (ie, least residue) occurs in a $k$-way division. That is, if $B_k(L,R,\alpha)$ denotes the best result for a $k$-way division, we suppose $B_k(L,R,\alpha) \le B_j(L,R,\alpha) \forall j \ne k$.] With another value $L'$ in place of $L$, will it be that true $B_k(L',R,\alpha) \le B_j(L',R,\alpha) \forall j \ne k$ ?

Other questions: [Like Q2, but with $R$ or $\alpha$ or combinations of $L,R,\alpha$ varying]

• Hello! I've added some of the LaTeX, but I'm not entirely sure what the following symbols are, as my computer cannot render them: ₖ, ⱼ, ₖ, and ⱼ. Do you know what these symbols are? – user20 Aug 7 '14 at 21:06
• @Emrakul, I've now replaced those subscript j and k characters with _j and _k LaTex, and ∀, ≠, ≤ chars with \forall, \ne, \le. Thanks for the edit! – James Waldby - jwpat7 Aug 7 '14 at 22:34

More rinses are better, and equally divided is optimal.

To show this, we first assume we will do only two rinses and show that evenly divided is best. Let us use $a$ in the first rinse, then $L-a$ in the second. After the two rinses, we have $\frac R{R+a}\cdot \frac R{R+L-a}$ left, so we want to maximize $(R+a)(R+L-a)=R^2+RL+La-a^2$, which occurs at $a=\frac L2$

Now we argue that given one rinse of a given size, we are better off splitting it in two equal halves. We do that until we have the maximum allowable number of rinses. Given two unequal rinses, we are better evening them up.

Let's look at the case where $k$ is 2. We'll define $x_1, x_2$ such that $x_1+x_2=L$ to represent how much we use each time, with $0<=x_1,x_2<=L$.

As you noted, after the first rinse, the concentration in the jar is $\alpha_1 = \frac{R\cdot\alpha}{R+x_1}$. Then, the concentration in the jar after the second rinse is $$R_2=\frac{R\cdot\alpha_1}{R+x_2}=\frac{R\cdot\frac{R\cdot\alpha}{R+x_1}}{R+x_2}=\alpha\cdot\frac{R}{R+x_1}\cdot\frac{R}{R+x_2}$$

So in general, we are trying to minimize $\prod_{n=1}^k{\frac{R}{R+x_n}}$, which is the same as maximizing $\prod_{n=1}^k{R+x_n}$.

I don't have time to do more than this right now, but hopefully this might be able to help other people who are looking at this problem.