Jump right to the exercises!

[Many thanks to my brilliant husband Ray, who formulated this problem and said ‘I think the number $\,\text{e}\,$ is lurking here somewhere’.]

The irrational number $\,e\,$ can show up in unexpected places!
Here's a real-life problem where the number $\,e\,$ makes a surprising appearance.
The appearance of $\,e\,$ isn't until the very end, so be patient!

We recently suspected that we had a batch of bad (toxic) water in our RV (Recreational Vehicle).
It's not easy to completely empty the tank—a little bit is always left in the bottom and gets mixed into the newly-added water.
We wanted to flush out the bad stuff, and be certain that the level of toxicity that remained was very, very small.

Of course, we could probably rig up some type of siphon to completely eliminate the toxic liquid.
Or, we might tie together strips of rags, insert in the tank, and soak up the bad stuff.
Instead, we pulled out the ‘mathematical toolbox’ and went to work.

We started pondering:

Let's formulate the situation mathematically.
We'll define an iteration to be:   add clean (non-toxic) liquid; drain.
(For us, the ‘clean liquid’ is safe water!)
Each time the tank is drained, the same (newly-diluted) amount remains in the tank.

We will assume perfect mixing.
That is, every time clean liquid is added, it gets thoroughly mixed with the prior solution.


At start-up, the liquid in the tank is considered to be $\,100\%\,$ toxic.
After each iteration (add clean liquid, drain), the resulting liquid is part toxic and part clean.

The volume units for $\,x\,$ and $\,y\,$ must be the same.
Depending upon the tank size, units of gallons, cubic feet, or fluid ounces might be appropriate.

Define toxicity as the fraction of the diluted volume that is toxic.
Because of the assumption of perfect mixing, if (say) $\,50\%\,$ is toxic after adding clean liquid, then $\,50\%\,$ is still toxic after draining.

The First Iteration

The Second Iteration

We'll look at just one more iteration, to ensure that the emerging pattern is crystal clear.

The Third Iteration

Here's a table that summarizes the first few iterations:

iteration toxicity
after iteration $\,i\,$
volume of TOXIC solution
at end of iteration
initial state initial toxicity:   $\displaystyle \frac{x}{x} = 1 = 100\%$ $x$
$1$ $\displaystyle\frac{x}{x+y}$ $\displaystyle\left(\frac{x}{x+y}\right)\cdot x$
$2$ $\displaystyle\frac{\left(\frac{x}{x+y}\right)\cdot x}{x+y} = \left(\frac{x}{x+y}\right)\cdot \left(\frac{x}{x+y}\right) = \left( \frac{x}{x+y}\right)^2$ $\displaystyle\left(\frac{x}{x+y}\right)^2\cdot x$
$3$ $\displaystyle\frac{\left(\frac{x}{x+y}\right)^2\cdot x}{x+y} = \left(\frac{x}{x+y}\right)^2\cdot \left(\frac{x}{x+y}\right) = \left( \frac{x}{x+y}\right)^3$ $\displaystyle\left(\frac{x}{x+y}\right)^3\cdot x$

The Toxicity after $\,n\,$ Iterations

A clear pattern is established.
The toxicity at the end of iteration $\,n\,$ is $\displaystyle\,\left(\frac{x}{x+y}\right)^n\,$.
(If desired, proof by induction can be used to verify this formula.)

Minimizing the Toxicity with Unlimited Clean Liquid Available

Note that $\,y\,$ is always strictly positive, since we're always diluting with some clean liquid.
Thus, $\displaystyle\,\frac{x}{x+y}\,$ is always less than $\,1\,$, since the denominator is greater than the numerator.
Multiplication by a number less than $\,1\,$ always results in a smaller number.
Therefore, viewed as a function of $\,n\,$, $\displaystyle\left( \frac{x}{x+y} \right)^n\,$ is a strictly decreasing function.
This is not surprising—we expect the toxicity to go down after each iteration of ‘add clean liquid and drain’.
Also notice that as $\,n\,$ goes to infinity, the toxicity goes to zero.

For a fixed value of $\,n\,$ and an unlimited supply of clean liquid, how can we make the toxicity as small as possible?
Make $\,y\,$ as big as possible!
That is, fill the tank, drain, and repeat.
Again, no surprise here.

Let's look at a specific example.
Suppose there are always $\,0.5\,$ gallons left when a $\,16\,$ gallon water tank is drained. (We have a very small trailer!)
Let's fill and drain three times.
Thus, let:

The resulting toxicity is: $$ \left(\frac{x}{x+y}\right)^3 = \left(\frac{0.5}{0.5+15.5}\right)^3 = \frac{1}{32{,}768} $$ One part in $\,32{,}768\,$ parts. That's pretty dilute!

Minimizing the Toxicity for a Fixed Volume of Clean Liquid

Here's the more interesting situation.
Suppose there is only a fixed volume $\,T\,$ of clean liquid available, to be used in $\,n\,$ iterations.
Thus, $\displaystyle\,y = \frac{T}{n}\,$ is added at each iteration.

The toxicity after $\,n\,$ iterations is: $$ \begin{alignat}{2} \text{toxicity after $\,n\,$ iterations } &= \left( \frac{x}{x+y}\right)^n\qquad\qquad & &\text{(formula for toxicity)} \cr\cr &= \left( \frac{x}{x+\frac{T}{n}}\right)^n & &\text{(definition of $\,y\,$)} \cr\cr &= \left( \frac{\frac 1x\cdot x}{\frac 1x\bigl(x+\frac{T}{n}\big)}\right)^n & &\text{(multiply by $\,1\,$ inside the parentheses, in the form $\frac{\frac 1x}{\frac 1x}$)} \cr\cr\cr &= \left( \frac{1}{1 + \frac{T/x}{n}}\right)^n & &\text{(algebra)} \cr\cr &= \frac{1}{\bigl(1 + \frac{T/x}{n}\bigr)^n} & &\text{(algebra, and $\,1^n = 1\,$ for all $\,n\,$)} \cr\cr \end{alignat} $$

At this point, we need to borrow a fact from calculus: $$ \text{as } n\rightarrow\infty,\quad \bigl(1 + \frac {t}{n}\bigr)^n \rightarrow {\text{e}}^t $$ You saw a special case of this result in an earlier section: $$ \text{as } n\rightarrow\infty,\quad \bigl(1 + \frac {1}{n}\bigr)^n \rightarrow {\text{e}}^1 = \text{e} $$ Thus: $$ \text{as } n\rightarrow\infty,\quad \left(1 + \frac {T/x}{n}\right)^n \rightarrow {\text{e}}^{T/x} $$

Recall that toxicity is a decreasing function of $\,n\,$; for each additional iteration, the toxicity gets smaller.
With a fixed volume of clean liquid available, more iterations mean that you are pouring in less each time.
In this situation, though, you don't approach a toxicity of zero!
Instead: $$ \text{as } n\rightarrow\infty, \qquad \frac{1}{\bigl(1 + \frac{T/x}{n}\bigr)^n} \rightarrow \frac{1}{{\text{e}}^{T/x}} $$

So, there's the surprising appearance of the irrational number $\,\text{e}\,$!
To minimize the toxicity with a fixed amount of clean liquid available, we should pour in a tiny bit, drain, and repeat, repeat, repeat!

Here's a comparison of the toxicity levels achieved for three different ‘flushing’ scenarios.
Each assumes we have 10 gallons of clean water available to flush out our 16 gallon tank, which starts out having 0.5 gallons of toxic water at the bottom.

scenariovalues of variablestoxicity
use all the clean water at once $$ \begin{gather} x = 0.5\cr y = 10\cr n = 1 \end{gather} $$ $$ \frac{0.5}{0.5+10} = \frac 1{21} $$
pour in $\,5\,$ gallons, drain, repeat $$ \begin{gather} x = 0.5\cr y = 5\cr n = 2 \end{gather} $$ $$ \left(\frac{0.5}{0.5+5}\right)^2 = \frac 1{121} $$
use all the water in five equal volume iterations $$ \begin{gather} x = 0.5\cr y = \frac{10}{5} = 2\cr n = 5 \end{gather} $$ $$ \left(\frac{0.5}{0.5+2}\right)^5 = \frac 1{3125} $$

What is the best that we could do (mathematically, not realistically) with this scenario?
The limiting value is: $$ \frac{1}{{\text{e}}^{T/x}} = \frac{1}{{\text{e}}^{10/0.5}} \approx \frac{1}{4.85\times 10^8} $$ That's pretty close to zero!

Master the ideas from this section
by practicing the exercise at the bottom of this page.

When you're done practicing, move on to:
simple versus compound interest
On this exercise, you will not key in your answer.
However, you can check to see if your answer is correct.