\chapter{Exponential Functions as Models}

\specialsection{Introduction}
In everyday speech, the phrase ``it's growing exponentially'' seems to 
have become quite common in the early 2000's.  Most of us probably understand saying
that to be equivalent to the assertion that whatever is being described is growing 
\emph{really fast}.  In mathematical modeling, this statement is also 
frequently made, but it has a much more precise meaning.  Exponential models can 
indeed describe quantities that grow rapidly.  But that is not always the case--other exponential 
models describe exponential decay where a quantity decreases and approaches zero.  Moreover,
even when we have exponential growth in the technical sense, we can also make 
much more precise and quantitative statements about how exactly how the growth works and
changes over time.  

\begin{example}
\label{ExpGrowthOrDecay}
For organisms living in a habitat with unlimited resources,\footnote{This is 
clearly not a realistic assumption over the long run, but it might be
essentially the case in the short run as long as the population of the organisms is 
sufficiently small.} in each time period of a fixed length, we would expect there
to be numbers of births and deaths proportional to the total size of the 
population and this assumption is the basis for a new, non-linear 
of mathematical model describing how the population changes over time.   

For instance, for populations of animals with life spans longer than a year, 
we often take the time in years; for bacteria, insects, etc. we might find
a shorter time interval to be more convenient.  The ratios
$$b = \frac{\rm live\ births\ per\ year}{\rm total\ population}\ {\rm and}\ 
d = \frac{\rm deaths\ per\ year}{\rm total\ population}.$$
are called the \emph{birth and death rates}.\footnote{Biologists and demographers sometimes normalize
these differently, looking at the ratios per 1000 population.}  Over the short run, we usually assume
these remain constant.  The difference $b - d$, which reflects both additions to the 
population via births and subtractions from the population due to deaths, is then called the 
\emph{net growth rate} (per year).  

If the population
was $P(0)$ at the end of some year, then in the next year there would be
$b\cdot P(0)$ births and $d \cdot P(0)$ deaths.  Hence, at
the end of the next year 
the population $P(1)$ would be given by 
\begin{equation}
\label{eq:OneStep}
P(1) = P(0) + b\cdot P(0) -d \cdot P(0) = (1 + b - d)P(0).
\end{equation}
Similarly, at the end of the second year, substituting from Equation~\eqref{eq:OneStep},
the population would be 
$$P(2) = (1 + b - d)P(1) = (1 + b - d)\cdot (1 + b - d)P(0) = (1 + b - d)^2 P(0).$$
After any number $n\ge 0$ of years, in fact, the same reasoning gives
\begin{equation}
\label{eq:nSteps}
P(n) = (1 + b - d)^n P(0).
\end{equation}
If $P(0) = $ some constant $c$ and we extend Formula~\ref{eq:nSteps} to values of $t \ge 0$ that
are not necessarily whole numbers, then we see
$$P(t) = c (1 + b - d)^t,$$
where the constant $c = P(0)$.
This is a first example of an \emph{exponential model}, so called because functions of 
this form are
examples of exponential functions of $t$. 

If the birth rate exceeds the death rate, that is, if $b > d$, then 
it is easy to see that $b - d > 0$ and $1 + b - d > 1$. For instance, if 
$b = .24$ (This would say $24$ births per $100$ population per year)
and $d = 0.15$ ($15$ deaths per $100$ population per year),\footnote{These values would indicate a species with
a relative short life span and a high turn-over in the population!} 
then $b - d = .09$, and $P(t) = c (1.09)^t$.  A plot with $c = 100$
for $0 \le t \le 10$ is shown in Figure~\ref{fig:ExpGrowthPlot}.  This is the situation
called \emph{exponential growth}, and note that the population is indeed increasing
more and more rapidly as $t$ increases.
\begin{figure}
\begin{center}
\includegraphics[width=2.5in,width=2.5in]{ExpGrowth.png}
\caption{The Model $P = 100 (1.09)^t$, $0 \le t \le 10$.}
\label{fig:ExpGrowthPlot}
\end{center}
\end{figure}

On the other hand, the death rate could exceed the birth rate in some situations,
for instance if the species considered is prey for some other predator species
and their reproduction is not fast enough to replace the individuals lost due to 
the predation.  In
this situation $b < d$, so
$b - d < 0$ and hence $1 + b - d < 1$.  For instance, 
$b = .14, d = 0.20$, then $b - d = -.06$, and $P(t) = c (.94)^t$.  A plot with $c = 100$
for $0 \le t \le 10$ is shown in Figure~\ref{fig:ExpDecayPlot}.  This is the situation
called \emph{exponential decay}. The population function is decreasing and in purely 
mathematical terms, its values will get closer and closer to 0.  
\begin{figure}
\begin{center}
\includegraphics[width=2.5in,width=2.5in]{ExpDecay.png}
\caption{The Model $P = 100 (.94)^t$, $0 \le t \le 10$.}
\label{fig:ExpDecayPlot}
\end{center}
\end{figure}

Note that the functions $P(t) = 100 (1.09)^t$ and 
$P(t) = 100 (.96)^t$ will have many values that are not whole numbers.  
This makes perfect sense in the ``Mathematical World'' in Figure~\ref{fig:MathModels}.
But it gives real-world predictions of the population that do not make strict sense, 
because a population is always a whole number of individuals and the population changes
by adding or losing single individuals.  The population model thus does not match
the properties of the real-world population in every respect.  Nevertheless, the 
agreement is close enough to give useful information in many situations.   
To make the transition between the model and its implications, we usually
simply round the value of $P(t)$ to yield a population that 
is a whole number of individuals.   
\end{example}


In this chapter we will develop 
\emph{exponential models} in general, and study their properties and
applications.  

\specialsection{Exponential Functions}
As is the case with linear functions, exponential functions can be defined
and characterized in various ways.  The most basic specifies the formulas
that define these functions.  Thinking in those terms, we say
$f$ is an exponential function if there is a constant $a > 0$ such that
$f(x) = a^x.$
The domain of one of these functions contains all real numbers.
For modeling purposes we will usually generalize this slightly to include
a constant $c$ multiplying the $a^x$, so we will also say any function
defined by an equation
\begin{equation}
\label{eq:ExponentialFunction}
f(x) = c\cdot a^x
\end{equation}
is exponential.  As we saw in Figures~\ref{fig:ExpGrowthPlot} and \ref{fig:ExpDecayPlot}, 
$$
\framebox{$a > 1 \Rightarrow {\rm exponential\ growth}$} \quad {\rm and} \quad 
\framebox{$0 < a < 1 \Rightarrow {\rm exponential\ decay.}$}
$$ 

Looking back at Equation~\eqref{eq:LogDef}, we can see that the $a^x$ functions
are closely related with the base-$a$ logarithms because
$$y = a^x \Leftrightarrow x = \log_a(y).$$
In mathematical terms, this says that $f(x) = a^x$ and $g(x) = \log_a(x)$ are
\emph{inverse functions}.
Each of these functions ``undoes'' the other and returns
the input that produced a given output value from the other function:
$$f(g(x)) = x\quad {\rm and}\quad g(f(x)) = x, $$
or more specifically, for all real numbers $x$
\begin{equation}
\label{eq:Log}
\log_a(a^x) = x
\end{equation}
and for all positive real numbers $x > 0$, 
\begin{equation}
\label{eq:AntiLog}
a^{\log_a(x)} = x.
\end{equation}
The pair of functions $f(x) = 2^x$ and $g(x) = \log_2(x)$ are plotted in 
Figure~\ref{fig:ExpLogPlot}.  
\begin{figure}
\begin{center}
\includegraphics[width=2.5in,width=2.5in]{ExpLogPlot.png}
\caption{$y = 2^x$ in red and $y = \log_2(x)$ in blue. The line $y = x$ is shown dashed in black.}
\label{fig:ExpLogPlot}
\end{center}
\end{figure}
In high school algebra or precalculus, you may have learned that graphs
of inverse functions are mirror images across the line $y = x$.  This
is visible in Figure~\ref{fig:ExpLogPlot} if you imagine a larger range of 
$x$-values being used to generate the plot. 

In practical terms, the fact that $a^x$ and $\log_a(x)$ define inverse functions
means that logarithms are very useful for solving
equations involving exponential functions -- where the variable appears in an exponent.  

\begin{example}
\label{ExpEqEx}
The exponential function $f(x) = 3.4 \cdot 3^x$ grows with $x$ and has range
equal to all positive real numbers.\footnote{Technical Note: This assertion actually follows from 
a calculus result called the Intermediate Value Theorem, but we will take it as intuitively
plausible from the shape of an increasing exponential graph as in Figure~\ref{fig:ExpLogPlot}.}
For instance, suppose we want to determine the $x$ for which 
\begin{equation}
\label{eq:ExpEqExEq}
10 = 3.4 \cdot 3^x.
\end{equation}
This can be done by taking logarithms and using the statements in Proposition~\ref{LogProps}.
One way is to simply apply a logarithm function, for instance $\log_{10}$ to both sides of the
previous equation, then parts (1) and (4) of the proposition:
$$\log_{10}(10) = \log_{10}(3.4\cdot 3^x),$$
so 
$$1 = \log_{10}(3.4) + \log_{10}(3^x) = \log_{10}(3.4) + x \log_{10}(3).$$
Then we can solve algebraically for $x$:
$$x = \frac{1 - \log_{10}(3.4)}{\log_{10}(3)} \doteq .982.$$
Alternatively, starting again from Equation~\eqref{eq:ExpEqExEq}, we could divide
both sides by $3.4$ and then take logarithms and use Proposition~\ref{LogProps}, part (4):
$$\log_{10}\left(\frac{10}{3.4}\right) = \log_{10}(3^x) = x \log_{10}(3).$$
This shows
$$x = \frac{\log_{10}\left(\frac{10}{3.4}\right)}{\log_{10}(3)} \doteq .982$$
as before.  $\triangle$   
\end{example}

It follows from what we said in Chapter 3 that: 
\begin{itemize}
\item For linear functions, 
\emph{changing $x$ by a fixed amount gives $y$-values differing by a fixed amount}. 
\end{itemize}
Namely, from Equation~\eqref{eq:Slope}, if $y = f(x) = m x + b$, then changing
$x$ to $x + \Delta x$ produces a change in $y$ satisfying 
$$\Delta y = m \Delta x$$
independent of $x$.  For example if $y = f(x) = -7.3 x + 9$, increasing
$x$ by $1$ decreases $y$ by $7.3$, since the slope is $-7.3$. 

Exponential functions have a parallel, but different property.  Namely, if we have any
$y = c\cdot a^x$ and we change $x$ to $x + \Delta x$, now the ratio 
$$\frac{c a^{x+\Delta x}}{c a^x} = \frac{c a^x \cdot a^{\Delta x}}{c a^x} = a^{\Delta x}$$
simplifies because the $c a^x$ factors cancel.  This means that: 
\begin{itemize}
\item For exponential functions, 
\emph{changing $x$ by a fixed amount gives $y$-values in a fixed proportion. (The proportion
depends on the constant $a$ and $\Delta x$, but not on $x$)}. 
\end{itemize}  
The change in $y$ is not a constant amount in this case:
$$\Delta y = c a^{x + \Delta x} - c a^x = c a^x (a^{\Delta x} - 1);$$
it is \emph{proportional to $y = c a^x$ (again with a proportionality constant
depending on $a$ and the change in $x$}.  
For example if $y = f(x) = 3.7\cdot 2^x$, then increasing $x$ by $1$
\emph{doubles} the value of $y$:  By the rules for exponents,
$$3.7 \cdot 2^{x + 1} = 3.7 \cdot 2^x \cdot 2^1 = 2\cdot (3.7 \cdot 2^x).$$
The value for $x + 1$ is twice as large since $a = 2$ and $\Delta x = 1$. 

For uses in modeling, this way of thinking about exponential functions is 
probably the most important one.  What it says, for instance, is that an exponential
function is completely determined by:
\begin{enumerate}
\item[(a)] \emph{Its value} for one input value of the independent variable, and
\item[(b)] \emph{A percentage rate of growth or decrease} for a given change in 
the independent variable, or more or less equivalently, the ratio between its values 
for any two values of the independent variable.
\end{enumerate}  
Here are examples illustrating how to find the formula of an exponential
function from information of this kind.

\begin{example}
\label{ExponentialExamples}
(a) Suppose we know that the number of individuals in a population of some 
species of animals in a 
habitat is given by an exponential function of the independent variable $t$,
representing time.  The population is equal 
to $120$ individuals at time $t = 0$ and that 
the population is declining at a rate of $3\%$ per year.  That is, 
at the end of each year, population is $3\%$ smaller than it was at
the start.  We want to find an exponential function 
$$P(t) = c \cdot a^t$$
That matches this given information.    If we substitute $t = 0$, 
then we can determine the value of $c$ immediately:
$$120 = c \cdot a^0 = c.$$ 
Then, taking $t$ in years, the information we are given about the 
rate of decrease says 
$$\frac{P(1) - P(0)}{P(0)} \times 100\% = -3\%.$$
Therefore 
$$\frac{120\cdot a^1 - 120}{120} = -.03 \Rightarrow a = 1 - .03 = .97.$$
Therefore, our population function is
$$P(t) = 120 \cdot (.97)^t.$$

(b) Now suppose we have a quantity $Q$ that is increasing exponentially
as a function of $t$ in seconds.  We know that $Q(1) = 37.4$ and 
$Q(3) = 2.3\cdot Q(1)$.  We want a formula $Q(t) = c \cdot a^t$ for 
the corresponding exponential function again.   Note that this example
is slightly more complicated than (a) because we do not know the 
value at $t = 0$.  So we cannot determine the value of $c$ immediately
as before.  However, we do know
\begin{eqnarray*}
37.4 &=& Q(1) = c \cdot a^1 = c\cdot a, \ {\rm and}\\
86.02 &=& 2.3 \cdot 37.4 = Q(3) = c\cdot a^3.
\end{eqnarray*}
and we have two simultaneous equations to solve for $a,c$.  
If we divide the second of these equations,
\begin{eqnarray*}
c \cdot a &=& 37.4\\
c \cdot a^3 &=& 86.02,
\end{eqnarray*}
by the first we obtain
$$a^2 = 2.3 \Rightarrow a = \sqrt{2.3} \doteq 1.517.$$
Then the first equation can be used to solve for $c$:  
$$c \doteq \frac{37.4}{1.517} \doteq 24.65.$$
Our exponential function is (approximately)
$$Q(t) = 24.65 \cdot (1.517)^t.$$  

(c)  If the two values of the exponential function are known for 
values of the independent variable not differing by a whole
number (this was a simple feature of examples (a) and (b) above), 
then we might need to solve an equation like the following hypothetical
relation:
\begin{equation}
\label{eq:HypRel}
36.5 = a^{4.23}
\end{equation} 
to find the value of $a$.  This can be
done by writing the exponent as $\frac{423}{100}$ and raising
both sides to the $\frac{100}{423}$ power to solve for $a$:
$$a = (36.5)^{\frac{100}{423}} \doteq 2.34$$
Your calculator is using logarithms to do this sort of 
calculation; you could also take logarithms on both sides
of Equation~\eqref{eq:HypRel} to obtain
$$\log_{10}(36.5) = 4.23\cdot \log_{10}(a) \Rightarrow \log_{10}(a) = \frac{\log_{10}(36.5)}{4.23} \doteq .369,$$
so that by Equation~\eqref{eq:AntiLog},
$$a = 10^{.369} \doteq 2.34.$$
A comment is probably in line here -- these computations are somewhat sensitive
to rounding and the final results can be different-looking depending on how
many decimal digits are used.  The value for $a$ is rounded to 3 digits since 
the other numbers were only given to that precision.  $\triangle$
\end{example}

For future reference, we record the pattern seen in part (a) of Example~\ref{ExponentialExamples}
in a general form.
If the values of a quantity $Q$ are modeled by an exponential function 
whose value changes by $r \%$ per unit change in the 
independent variable $t$, then the model will have the form
\begin{equation}
\label{eq:PercentChangeExp}
\framebox{$Q(t) = Q(0)\cdot \left(1 + \frac{r}{100}\right)^t$.}
\end{equation}
Note that $r > 0$ gives $a = 1 + \frac{r}{100} > 1$ and we have exponential growth.
On the other hand $r < 0$ gives $a < 1$ and we have exponential decay.  
The percent change cannot be less than $-100\%$, so $a > 0$.

\begin{example}
The exponential model $Q(t)$ with $Q(0) = 5.9$ and $Q$ undergoing $2.3\%$ growth per year
is
$$Q(t) = 5.9\cdot \left(1 + \frac{2.3}{100}\right)^t = 5.9 \cdot (1.023)^t$$
($t$ in years). $\triangle$
\end{example}

\specialsection{Exponential Models}
There are a number of situations where the use of an exponential function as a mathematical
model is especially suitable.  Many of these involve cases where there is
a theoretical reason why exponential functions fit the data better than linear functions.
For instance, it can be shown that: 
\begin{proposition}
\label{ExpProp}
Any function with the property that 
changing the independent variable by a fixed amount gives function values values in a fixed proportion
is an exponential function.
\end{proposition} 
We said above that exponential functions have this property.  However, this statement is
saying something different.  We are claiming now that exponential functions are 
\emph{the only functions} with this property.\footnote{Technical Note: This is the 
the logical \emph{converse} of the statement we made before and it can be shown to be true using calculus.  We will not go into the details here.}  Hence if we know or suspect that the property
in Proposition~\ref{ExpProp} holds, then there is a theoretical reason to turn to 
an exponential model first.  

The first example is exactly the situation discussed in Example~\ref{ExpGrowthOrDecay} from the 
Introduction to this chapter.  Populations of organisms in resource-rich habitats can follow
exponential growth models, at least over short time-scales.  Any real-world habitat is limited,
though, in the number of individuals that can be supported.  Exponential growth models
involve population functions whose values eventually exceed any positive number.  After long enough,
the population size predicted by the model would be so large that the surface area of the Earth would 
not be big enough to hold all the organisms(!)\footnote{A classic \emph{Star Trek} original series episode, 
called ``The Trouble With Tribbles,'' comes to mind.  If you haven't seen it, you should :) }  Similarly, 
after a long enough time, an exponential decay model will eventually reach values $< 1$.
We cannot have $.54$ of an individual as a population value either! \emph{In other words, over
the long run, an exponential population model will necessarily eventually cease being realistic.} 

Another situation leading to exponential models and having important environmental implications
is given in the following example.

\begin{example}
\label{RadioactiveDecay}
Some chemical elements come in radioactive forms or \emph{isotopes} with the same number of protons but
more or fewer neutrons in each atomic nucleus than in the most common, stable forms.  This 
includes both elements with
large atomic numbers that are almost always radioactive (like Uranium and Plutonium), and other
elements with smaller atomic numbers that have both stable and radioactive forms (like Carbon).
A sample of a radioactive isotope will \emph{decay} over time, whereby some of the atomic nuclei
in the sample will split into nuclei of lighter elements and emit radiation of various forms.  Exposure to 
high levels of radioactive decay can cause radiation sickness; background radioactive decay from 
sources in the natural environment is also always present.

The way radioactive decay works is that in a sample of a radioactive isotope, whether or not
any given nucleus decays is thought to be an essentially random process.  But in each 
time period of a given length, the \emph{same proportion of the atoms decays} (at 
least approximately). 
Hence the number remaining (or the mass of the remaining radioactive material) satisfies
Proposition~\ref{ExpProp} above, and this can be 
modeled by a function of the form 
$$Q(t) = Q(0) a^t$$
for some $0 < a < 1$.  Values of $a$ close to $1$ correspond to ``slow'' decay, while values of $a$
close to $0$ correspond to ``fast decay.''  The way a value for $a$ is usually determined is 
often by specifying the so-called \emph{half-life} of the element.  
\begin{itemize}
\item \emph{The half-life of a radioactive isotope is the time it takes for one-half of 
a sample to decay, or equivalently, the time it takes for a sample to decay to one-half
of the original amount.}
\end{itemize}

(a) For instance the half-life of the isotope Uranium-235\footnote{This isotope is used in fuel for nuclear
power plants and in nuclear weapons because it is ``fissile''-- that is, a large enough sample will 
produce a self-sustaining nuclear fission chain reaction, where decay products stimulate other nuclei to 
decay. The more common Uranium-238 does not have this property.} 
is $7.038 \times 10^8 = 703,800,000$ years.
Only slightly unrealistically, let us assume that the Earth had some amount $Q(0)$ of
Uranium-235 when it first coalesced (approximately) 
$4.543 \times 10^9$ years ago.  We can ask, how much of that original amount is left at present?
First we need to determine the value for $a$ in the exponential model $Q(t) = Q(0) a^t$ for the amount
of Uranium-235 present at time $t$.  By the definition of the half-life, we have
$$\frac{1}{2} Q(0) = Q(0) a^{7.038 \times 10^8}$$
so dividing out the $Q(0)$ and taking logarithms, we can solve for $a$:
$$-\log_{10}(2) = (7.038\times 10^8) \log_{10}(a),$$
hence
$$\log_{10}(a) = \frac{-\log_{10}(2)}{7.038 \times 10^8} \doteq -4.277 \times 10^{-10}.$$
Raising $10$ to the power on each side of this equation,   
$$a \doteq .99999999901518.$$
Then since it has been about $4.543 \times 10^9$ years since the beginning of the Earth's lifetime, 
we have 
$$Q(4.543 \times 10^9) \doteq Q(0)\cdot (.99999999901518)^{4.543\times 10^9} \doteq .0114\cdot Q(0).$$
In other words, about $1\%$ of the original Uranium-235 is still left today, 
$4.543$ billion years later.\footnote{Technical Note:  I did
these calculations using mathematical software that allows use of arbitrarily many decimal digits in 
floating point numbers rather than using a calculator, where the value of $a$ would round to 1.  
I actually used 20-digit floating point numbers.}  This is \emph{extremely} slow decay
and it illustrates one of the issues concerning long-half-life radioactive elements in 
spent nuclear fuels, waste products of other processes, etc.  Measurable amounts of them tend to stay around
an extremely long time!  This is one of the main technical issues in handling nuclear waste products
and one of the reasons why nuclear power generation is controversial in environmental discussions.

(b)  Here is another related example.  The half-life of radioactive Cobalt-60 is about 5.27 years.
We ask -- how long will it take for a sample of Cobalt-60 to decay to $5\%$ of the original amount?
Our exponential model is $Q(t) = Q(0) a^t$.  The information about the half-life says 
$$Q(5.27) = Q(0) a^{5.27} = .5 \cdot Q(0).$$
Therefore, solving as in part (a), we obtain
$$\log_{10}(a) = \frac{-\log_{10}(2)}{5.27} \doteq -0.05712.$$
Then 
$$a \doteq 10^{-0.05712} \doteq .877.$$
To answer the question, then, we need to solve for $t$ in the equation
$$(.05)\cdot Q(0) = Q(0) (.877)^t.$$ 
Taking logarithms, we find
$$t = \frac{\log_{10}(.05)}{\log_{10}(.877)} \doteq 22.8\ {\rm years}.$$
We will reconsider what we did here next.  $\triangle$ 
\end{example}

The process we used in Example~\ref{RadioactiveDecay} part (b) to solve for $a$ is 
certainly direct.  If we use some additional properties of logarithms, though, 
it is also possible to derive a formula giving $a$ directly in terms of the
half-life, so that this process can be bypassed.  Namely the definition of 
the half-life says if $t_{1/2}$ is that amount of time, then
$$(.5)\cdot Q(0) = Q(t_{1/2}) = Q(0) a^{t_{1/2}}, $$
which shows
$$\log_{10}(a) = \frac{-\log_{10}(2)}{t_{1/2}}.$$
Instead of computing the value of the ratio on the right, we can also just
consider the effect of raising $10$ to both sides of the equation here.  This 
yields 
$$a = 10^{\log_{10}(a)} = 10^{\frac{-\log_{10}(2)}{t_{1/2}}} = 
\left(\frac{1}{2}\right)^{ 1/t_{1/2} }.$$
Hence the formula for an exponential decay model can be written in the following form
\emph{directly} if we know the half-life, $t_{1/2}$:
\begin{equation}
\label{eq:AltExpDecay}
\framebox{$Q(t) = Q(0) \cdot \left(\frac{1}{2}\right)^{t/t_{1/2}}.$}
\end{equation}

\begin{example}
\label{HalfLifeModel}
For example, a radioactive decay model for a quantity with half-life 
$12,000$ years could also been written immediately using Equation~\eqref{eq:AltExpDecay}:
$$Q(t) = Q(0) \cdot \left(\frac{1}{2}\right)^{t/12000}$$
(with $t$ in years).
The corresponding value of $a$ in the general form Equation~\eqref{eq:ExponentialFunction}
is 
$$a = \left(\frac{1}{2}\right)^{1/12000} \doteq .999653.$$
Note that this is slightly less than $1$, as we expect for decay.
$\triangle$
\end{example}


\specialsection{Semi-log Plots and Fitting Exponential Models}
In Chapter 3, we discussed the process of ``fitting'' a linear model to a data set using
least squares regression.  There is a corresponding process of fitting exponential models
as well and we will introduce it this section.  Via the ``magic of logarithms'' we will 
see, in fact, that all the techniques we learned before can be applied to this case 
as well!

If we are examining a data set and we notice a consistent curvature (or ``concavity'')
in the point plot, then the residuals for a linear model might show the kind of consistent
sign pattern we discussed in Chapter 3.  If this happens, it is probably worthwhile to 
consider whether an exponential model is a better fit.  A first step here might be
to perform a standard transformation on the pointplot by plotting the dependent variable
(function) values on a \emph{logarithmic scale}.  If the original data set consists of
points $(x_i,y_i)$, this would mean examining the new point plot showing the points
$(x_i,\log_{10}(y_i))$ (any other logarithm function could also be used for this).  

\begin{example}
\label{Ebola201415}
A serious outbreak of the Ebola virus, primarily in the West African countries 
of Guinea, Liberia, and Sierra Leone, started in spring 2014 and continued into the
fall of 2015.  In the initial phases, many health care workers were infected by 
sick patients and died themselves.
Hospitals and clinics in the area were overwhelmed.  In response, many countries outside the affected region
sent medical assistance and a few of the volunteer medical workers who went were also infected,
spreading a very small number of Ebola cases to the U.S., Spain, the U.K., and Italy in 
the fall of 2014.  News coverage
of these infections came close to causing panic at the time, even though the volunteer 
health worker victims were quickly quarantined by public health officials in their countries 
and there was no secondary spread outside the original African region.  The following table shows the 
initial phase of the epidemic according to data from World Health Organization 
bulletins.\footnote{The data is summarized at 
{\tt https://en.wikipedia.org/wiki/West$\_$African$\_$Ebola$\_$virus$\_$\\
epidemic$\_$timeline$\_$of$\_$reported$\_$cases$\_$and$\_$deaths}, accessed June 30, 2017.}
\begin{table}[ht]
\renewcommand\arraystretch{1.5}
\caption{Ebola Outbreak -- March 22 through July 30, 2014.}
\label{Ebola}
\noindent\[
\begin{array}{|c|c|c|}
\hline
{\rm Date} & {\rm Cumulative\ Total\ Cases} & {\rm Cumulative\ Deaths} \\ 
\hline
{\rm 22\ March} & 49 & 29\\ 
\hline
{\rm 31\ March} & 130 & 82\\
\hline
{\rm 14\ April} & 176 & 110\\
\hline
{\rm 1\ May} & 239 & 160\\
\hline
{\rm 12\ May} & 260 & 182\\
\hline
{\rm 27\ May} & 309 & 202\\
\hline
{\rm 17\ June} & 528 & 337\\
\hline
{\rm 2\ July} & 779 & 481\\
\hline
{\rm 14\ July} & 982 & 613 \\
\hline
{\rm 23\ July} & 1201 & 672\\
\hline
{\rm 30\ July} & 1437 & 825\\ 
\hline
\end{array}
\]
\end{table}
The word ``cumulative'' in the column headings means that the numerical
values represent the total cases and deaths reported \emph{up to and including 
the given date}.
For instance there were 130 cases reported on or before 31 March, including
the 49 cases reported on or before 22 March plus 81 new cases between
22 March and 31 March.
 
To investigate and model this data in the ways we have discussed, we need 
a way to convert the 
dates to numerical values.  The simplest way to do that is to count
the number of days after the initial date of March 22, yielding times in 
days as follows:
$$0,9, 23, 40, 51, 66, 87, 102, 114, 123, 130.$$
We use these as the first coordinates (values of time as independent
variable) to generate the plots in Figure~\ref{fig:EbolaFirstPhase}.  The points shown as black
asterisks are the total cases; the red circles are the numbers of deaths
\begin{figure}
\begin{center}
\includegraphics[width=3.0in,width=3.0in]{EbolaCasesAndDeaths.png}
\caption{Ebola Outbreak, March 22 - July 31, 2014. Cases = $*$, Deaths = $\circ$.}
\label{fig:EbolaFirstPhase}
\end{center}
\end{figure}
Examining this plot, it should be pretty clear that linear models would exhibit
the sort of systematic sign patterns in the residuals that we warned about before.
Because of the upward curvature, the first segment at the left of the point plot would lie
above the regression line, the middle portion would lie below, and the 
final segment at the right would lie above again.  Hence, it is possible that a different
sort of model would match these data sets better.\footnote{This is also indicated
by various theoretical mathematical models of the spread of infectious diseases 
that we will discuss later in the course.}

Let's see what happens if we take the logarithms of the numbers of infected
individuals and deaths, shown in Figure~\ref{fig:EbolaFirstPhaseLog}.
\begin{figure}
\begin{center}
\includegraphics[width=3.0in,width=3.0in]{EbolaCasesAndDeathsLog.png}
\caption{Ebola Outbreak, March 22 - July 31, 2014; vertical axis shown on logarithmic scale.  
Cases = $*$, Deaths = $\circ$.}
\label{fig:EbolaFirstPhaseLog}
\end{center}
\end{figure}
Note that (apart from an apparent anomaly in the data for $t = 0$, corresponding to March 22)
these new plots look much more like what we expect if a \emph{linear model} is going to be a good fit(!)
The data points for March 22 also come from the very start of the epidemic; it is probably
to be expected that the eventual pattern of spread characteristic of the early phase of the 
outbreak has not yet ``set in.'' $\triangle$ 
\end{example}

Returning to the general discussion, plotting the points $(x_i,\log_{10}(y_i))$ is 
called generating a \emph{semi-log plot} of the data set (the name is supposed to
suggest that only the $y_i$ are plotted on a logarithmic scale).   
If a linear model is a good fit for the transformed points shown in the semi-log
plot then notice what happens.  Suppose that 
\begin{equation}
\label{eq:SemiLogFit}
\log_{10}(y) = \hat{m} x + \hat{b}
\end{equation}
is the fitted linear model and notice that we have written $\log_{10}(y)$ instead
of $y$ on the left hand side because of the data transformation we used.  To obtain
an equivalent model for the original quantity $y$, not $\log_{10}(y)$, we just
raise 10 to the powers on both sides of Equation~\eqref{eq:SemiLogFit}:
$$y = 10^{\log_{10}(y)} = 10^{\hat{m} x + \hat{b}}.$$
Using rules for exponents, this can be rewritten as
\begin{equation}
\label{eq:FittedExpModel}
\framebox{$y = (10^{\hat{b}})\cdot (10^{\hat{m}})^x$.}
\end{equation}
This has the form given in Equation~\eqref{eq:ExponentialFunction} with 
$$c = 10^{\hat{b}} \quad {\rm and} \quad a = 10^{\hat{m}}.$$

Putting everything together we have the following process for fitting an
exponential model to a data set:
\begin{itemize}
\item Starting from the original $(x_i,y_i)$ data points, apply the 
transformation $y_i \mapsto \log_{10}(y_i)$ to each point (and perhaps generate
the semi-log plot of the points $(x_i,\log_{10}(y_i))$ to evaluate approximate
linearity)
\item Fit a linear model $\log_{10}(y) = \hat{m} x + \hat{b}$ to the transformed
data set
\item The corresponding exponential model for $y$ as a function of $x$ is
obtained as in Equation~\eqref{eq:FittedExpModel}
\end{itemize}

\begin{example}
\label{EbolaContinued}
We illustrate the process outlined above using the Ebola datasets studied in 
Example~\ref{Ebola201415}.  The fitted linear model for the semi-log form
of the cumulative total cases is 
$$\log_{10}(y) = 1.915 + .0009543 t,$$
($t$ in days) yielding 
$$y = 10^{1.915}\cdot (10^{.009543})^t \doteq 82.2 \cdot (1.0222)^t.$$
Note that one way to interpret this model is that the number of infected individuals
was increasing at a bit more than $2\%$ \emph{per day(!)}  It is no wonder that the 
World Health Organization was immediately concerned about the severity of the 
outbreak.  

Similarly, the fitted linear model for the semi-log form of the cumulative
deaths is
$$\log_{10}(y) = 1.727 + .009299 t,$$
($t$ in days again) yielding
$$y = 10^{1.727} \cdot (10^{.009299})^t \doteq 53.3 \cdot (1.0216)^t.$$
The cumulative deaths were increasing at a slightly slower rate, but
still more than $2\%$ per day. 
The models are plotted together with the datasets in Figure~\ref{fig:EbolaModels}. 
\begin{figure}
\begin{center}
\includegraphics[width=3.0in,width=3.0in]{EbolaCasesAndDeathsModels.png}
\caption{Ebola Outbreak, March 22 - July 31, 2014. Cases = $*$, Deaths = $\circ$, 
Models shown dashed.}
\label{fig:EbolaModels}
\end{center}
\end{figure}
The agreement between models and data is very close.  $\triangle$
\end{example}

To conclude our discussion, we mention two different ways to use 
the Excel spreadsheet environment to perform computations like these.
You have the option of either
\begin{itemize}
\item doing the process as described and shown in this text, or 
\item using the {\it Exponential Trendline} options shown in the Chart Tools/Trendline menu, 
but on the \emph{untransformed}, $(x_i,y_i)$ data set.
\end{itemize}
Those Excel options perform the computations exactly as we have described them but they
automate the process so you don't have to do the logarithmic transformation
yourself.\footnote{This means Excel is giving you a shortcut, but as always it's good
to know what is going on ``under the hood!''}  Also, excel reports the
result using the $e^x$ exponential function, so some conversion is necessary to put the 
Excel output into the forms we have used.  Here's what you need to know.  A function
like $e^{.00133 t}$ can be rearranged using rules for exponents:
$$e^{.00133 t} = (e^{.00133})^t \doteq (1.00133)^t.$$
So this exponential model would be showing about $1.3\%$ growth per unit time.

\specialsection{Chapter Project}
The Chapter Project for this chapter will be to continue the study of the 2014-2015
Ebola outbreak begun above in Examples~\ref{Ebola201415} and \ref{EbolaContinued}.
The data we were using there comes from the Wikipedia page
\vskip 10pt
{\tt https://en.wikipedia.org/wiki/West$\_$African$\_$Ebola$\_$virus$\_$epidemic$\_$\\
timeline$\_$of$\_$reported$\_$cases$\_$and$\_$deaths}
\vskip 10pt
On that page, you will see a large table with the data we used at the bottom and rows
above that giving the later course of the outbreak, all the way to November 2015,
when the outbreak was declared to be concluded.  (The rows are in reverse chronological
order, for some reason.) The cumulative cases and 
deaths are also broken down by country, with separate totals for Guinea, Liberia,
and Sierra Leone. 

For the project, you want to start out by getting all of this data into Excel
or another spreadsheet program.  You will need to convert the dates to the 
numerical form we used above (days after the initial report of Ebola cases on March 22, 2014).   
It will be more convenient to have the rows in chronological order, too.  
There are a few values that are reported as $\ge 8881$ or
similar.  You can just omit the $\ge$ for the purposes of this assignment.  

Most of the work you will do will involve analyzing subsets of the data along
the lines of what we did in the examples above, to try to develop answers
to the following questions.

\begin{enumerate}
\item[(A)]  Considering the total reported cases and total deaths for the whole
course of the outbreak, for how long did the cases and deaths continue increasing
at about $2\%$ per day?  When does it seem that the tide started to turn, in the sense that the epidemic
was starting to ``slow down'' noticeably 
from the $2\%$ per day rate of increase.\footnote{It had to do that at some time; if it didn't, then
we would probably all be dead by now!}  Try fitting models starting at March 22, 2014, 
but going farther than we did above.  
Some landmarks to watch for are November 2, 2014,  27 May 2015, 26 July 2015, and so forth.  
Explain how you are determining that ``turn of the tide.''  Also, can you identify
something definite that happened about that time that might have been a cause
for the epidemic starting to come under control?  
\item[(B)]  Examining the data, it is pretty clear that the course of the outbreak
was different in Guinea as compared to Liberia and Sierra Leone.  Fit exponential
models for initial phases of the epidemic in each ot the three countries separately.
Were the numbers of infections and deaths increasing at a rate of $2\%$ at the 
start in all three countries?  
\item[(C)] Not everyone who was infected with Ebola died as a result of the 
infection.  Some people
actually recovered.  How did the percentage of infected people who recovered change
over the course of the epidemic?  Consider both the aggregate figures and the figures
by country?  What type of model fits that data the best?  Note: One would hope that
as an epidemic progresses, health care professionals would accumulate useful experience
in how to treat the disease successfully so that their treatment outcomes would improve
over time.  Was that the case here?
\end{enumerate}
Assignment:  Submit a spreadsheet showing all of your calculations with the 
Ebola data set.  Answer the questions above in a separate text document.  As always, document
your sources if you consult things other than the Wikipedia page given above.  

\begin{xcb}{Chapter Exercises}
\begin{enumerate}
\item Solve the following exponential equations using logarithms proceeding as in Example~\ref{ExpEqEx}.
\begin{enumerate}
\item[(a)] $28.3 = 4.5 (3.4)^{2x}$.
\item[(b)] $4^x = 3.5\cdot 2^x$.
\item[(c)] $7.9 = 2.8 (7.4)^x + 5.6$.
\end{enumerate}

\item  Find the exponential functions $f(t) = c\cdot a^t$ satisfying 
\begin{enumerate}
\item $f(0) = 3.2$ and $f(1) = 2.9$.
\item $f(0) = 7.8$ and $f(5) = 4.3\cdot f(1)$.
\item $f(2.1) = 20.3$ and $f(5.6) = 25.4$. 
\end{enumerate}

\item  Find the exponential functions $f(t) = c\cdot a^t$ satisfying 
\begin{enumerate}
\item $f(0) = 8.54$ and $f$ decreasing at a $15\%$ rate for each unit
change in $t$.  (Hint:  See Equation~\eqref{eq:PercentChangeExp}.)
\item $f(1.2) = 3.7$ and $f$ growing at a $3\%$ rate for each unit change in $t$.  
\end{enumerate}

\item Let $Q(t)$ be an exponential function of time $t$.  The 
\emph{doubling time} of $Q$ is the value $t = t_2$ for which 
$Q(t_2) = 2 Q(0)$.  
\begin{enumerate}
\item What is the doubling time for $Q(t) = 5 \cdot (1.75)^t$?
\item What is the doubling time for $Q(t) = 18.3 \cdot (3.4)^t$?
\end{enumerate}

\item Show in general that the doubling time for any $Q(t) = Q(0) a^t$ is given by 
$$t_2 = \frac{\log_{10}(2)}{\log_{10}(a)}.$$
What does this mean if $0 < a < 1$?

\item Show that an exponential model with a doubling time $t_2$ can be written
down immediately in the form 
$$Q(t) = Q(0)\cdot 2^{t/t_2}.$$
What is the corresponding value for $a$ as in Equation~\eqref{eq:ExponentialFunction}?
(Hint:  Look at the derivation of Equation~\eqref{eq:AltExpDecay} in the text.) 

\item The radioactive isotope Strontium-90 has a half-life of 28.8 years and is produced
by nuclear fission (in particular by early nuclear weapons testing).  It has
associated human health concerns because
it is chemically equivalent to stable Strontium-88 and hence similar to Calcium.
It tends to be concentrated in the bodies of cows ingesting contaminated plant material 
and it is excreted in their milk.  
\begin{enumerate}
\item Determine an exponential model $Q(t) = Q(0) a^t$ for the amount of Strontium-90
present in a sample as a function of time.
\item How long will it take for a sample of Strontium-90 to decay to $.01\%$ of the 
original amount present?
\end{enumerate} 

\item The radioactive isotope Carbon-14 has a half-life of about $5730$ years.  It is
naturally present in the atmosphere at the level of 1 part per trillion, almost entirely
as a product of 
an interaction between cosmic rays and Nitrogen atoms in the upper atmosphere.  
Carbon-14 is chemically similar
to stable Carbon-12, and hence forms compounds that are incorporated into plants and 
animal tissues.  As long as the plant or animal is alive, the Carbon-14 in its tissues
is replenished by its metabolic processes from the reservoir of atmospheric Carbon-14.  
However, as soon as the plant or animal
dies, the amount of Carbon-14 remaining in the organic materials left begins to decay.
For this reason, measurements of the Carbon-14 can be used to estimate the age of those organic
materials (i.e. the time elapsed since the death of the plant or animal they came 
from).\footnote{This \emph{radiocarbon dating} technique was developed by a group led by 
a physical chemist named Willard F. Libby, who devoted part of his career to work with 
radioactive isotopes--including a role in a branch of the ``Manhattan Project'' that
produced the first usable fission nuclear weapons--and 
part to environmental issues including development of
air pollution standards in California.  He received the 1960 Nobel Prize in 
Chemistry for the radiocarbon dating technique.}  
\begin{enumerate}
\item The rate of production of Carbon-14 has been estimated to be about 1.7 atoms of
Carbon-14 per square centimeter, per second over the whole surface area of the 
Earth.\footnote{See for instance, G. Kovaltsov, A. Mishev, I. Usoskin, ``A new model
of cosmogenic production of radiocarbon ${}^{14}C$ in the atmosphere,'' arXiv:1206.6974.}
How many atoms of Carbon-14 is that per year?
\item Determine an exponential model $Q(t) = Q(0) a^t$  for the amount of Carbon-14
present in a sample as a function of time.
\item A piece of cloth found in a newly discovered tomb contains $34\%$ as much
Carbon-14 as a comparable newly-made piece of cloth. Use this information to 
estimate how old the tomb is.  What assumptions are you making?
\end{enumerate}

\item  We discussed various examples of human population data in Chapter 3 and 
fitted linear models.  In this exercise, you will work with the historical record
of U.S. population data from the Federal Census taken every 10 years given in 
Table~\ref{USPopulation}. 
\begin{table}[ht]
\renewcommand\arraystretch{1.5}
\caption{U.S. Population According to Federal Census Records}
\label{USPopulation}
\noindent\[
\begin{array}{|c|c||c|c|}
\hline
{\rm Census} & {\rm Population} & {\rm Census} & {\rm Population}\\ 
\hline
1790 & 3,929,214 & 1800 & 5,308,483\\
\hline
1810 & 7,239,881 & 1820 & 9,638,453\\
\hline
1830 & 12,866,020 & 1840 & 17,069,453\\
\hline
1850 & 23,191,876 & 1860 & 31,443,321\\
\hline
1870 & 38,558,371 & 1880 & 50,189,209\\
\hline
1890 & 62,979,766 & 1900 & 76,212,168\\
\hline
1910 & 92,228,496 & 1920 & 106,021,537\\
\hline
1930 & 123,202,624 & 1940 & 132,164,569\\
\hline
1950 & 151,325,798 & 1960 & 179,323,175\\
\hline
1970 & 203,211,926 & 1980 & 226,545,805\\
\hline
1990 & 248,709,873 & 2000 & 281,421,906\\
\hline
2010 & 308,745,538 & & \\
\hline
\end{array}
\]
\end{table}
\begin{enumerate}
\item[(a)]  Fit linear and exponential models to this data set.  Is one of them
a noticeably better fit than the other?  Interpret what your model says about
the rate of growth of the U.S. population over time.
\item[(b)]  The discussion of population models in Example~\ref{ExpGrowthOrDecay}
involves several assumptions that are not good matches for the situation with
the U.S. population.  For example, has the U.S. population changed only 
by births and deaths?  Have the birth and death rates been \emph{constant}? 
Discuss and answer by referring to the data in Table~\ref{USPopulation}.
\end{enumerate}

\item 
The data in Table~\ref{Trout} gives the length (in mm) and the weight
(in g) of 42 fish caught in the Spokane River in Washington State.\footnote{Source: Langkamp and Hull, 
Quantitative
Environmental Learning Project, {\tt http://seattlecentral.edu/qelp/sets/023/023.html}, downloaded
on June 30, 2017.}  (Each row of the table gives the data for two fish.)
\begin{table}[ht]
\renewcommand\arraystretch{1.5}
\caption{Trout weight and length data.}
\label{Trout}
\noindent\[
\begin{array}{|c|c||c|c|}
\hline
{\rm Length\ (mm)} & {\rm Weight (g)} & {\rm Length (mm)} & {\rm Weight (g)}\\ 
\hline
457 & 855 & 405 & 715\\
\hline
455 & 975 & 460 & 895\\
\hline
335 & 472 & 365 & 540\\
\hline
390 & 660 & 368 & 581\\
\hline
385 & 609 & 360 & 557\\
\hline
346 & 433 & 438 & 840\\
\hline
392 & 623 & 324 & 387\\
\hline
360 & 479 & 413 & 754\\
\hline
276 & 235 & 387 & 538\\
\hline
345 & 438 & 395 & 584\\
\hline
326 & 353 & 270 & 209\\
\hline
359 & 476 & 347 & 432\\
\hline
259 & 202 & 247 & 184\\
\hline
280 & 248 & 265 & 223\\
\hline
309 & 392 & 338 & 460\\
\hline
334 & 406 & 332 & 383\\
\hline
324 & 353 & 337 & 363\\
\hline
343 & 390 & 318 & 340\\
\hline
305 & 303 & 335 & 410\\
\hline
317 & 335 & 351 & 506\\
\hline
368 & 605 & 502 & 1300\\
\hline
\end{array}
\]
\end{table}
\begin{enumerate}
\item Fit linear and exponential models to this data set.  Is either one clearly superior?
\item (Looking ahead to Chapter 5.) Does either a linear or exponential relationship between length and mass 
seem likely on geometric grounds?  For instance, let us consider a (very) simplified model where 
the fish are all \emph{scaled copies of one another}, with tissues of constant mass density
(mass per unit volume).  That is, suppose the individual fish have exactly the same
shape and uniform density.   But for each individual fish, 
each linear dimension in the ``standard model'' of
this species is multiplied by a constant\footnote{``Scaled copy'' would mean these constants
are the same for all dimensions in each individual fish, but they could vary from
individual to individual.} to get the corresponding dimensions of the individual.
What would be true about the mass as a function of length in that case?
\end{enumerate}
\end{enumerate}
\end{xcb}

\endinput 





