FST Exponential & Logarithmic Functions

243 days ago by mpaul

Exponential & Logarithmic Functions

Michel Paul

 
       

Suppose you get $0.01 on the first day of a job,

$0.02 on the second day,

$0.04 on the third day,

$0.08 on the fourth day, etc.

How much money would you receive on the 30th day?

Here's a little Python program that displays the amount you will get on each day:

amount = 0.01 for day in [1..30]: print 'day',day,'---> $',amount amount = 2*amount 
       

Here's a math expression you would use to immediately compute the amount for the 30th day.

If you were using a calculator, this is what you'd enter:

0.01*2^29 
       

The 0.01 represents one penny, 2 represents the doubling, and 20 represents the number of doublings.

You could change the 29 to other values to calculate the amount for different days.

Here's a function that does just that.  It will calculate the amount you will get for any day:

f(x) = 0.01*2^(x-1) show(f) 
       
f(10) 
       

As you can see, on the 10th day you will receive $5.12 , and this should match the value in the table we generated above.

Experiment with this function.  Change the 10 to other values and see what you get.

This is an example of an exponential function.  Exponential functions have this form:

f(x) = ab^x

The variable a represents some initial value, b represents a growth factor, and x is the number of times we apply the growth factor.

The values we have created only show what we are getting on a particular day.

How much money will you have received altogether?

amounts = [f(x) for x in [1..30]] amounts 
       
sum(amounts) 
       

Exponential growth has the form of a geometric sequence:  a, ab, ab^2, ab^3, ... , ab^{n-1}

The sum of this sequence can also be found using geometric series formula: a \frac{b^n - 1}{b-1}

(The sum of a sequence is a series.)

0.01*(2^30 - 1)/(2 - 1) 
       

This is exponential growth.  The growth factor b was 2.

If b < 1 we have exponential decay:

Suppose a glacier is melting at the rate of 10% a year.

What percent will be left after 10 years?

Since the glacier is losing 10% every year, the growth factor ends up being 90%.

Why?  Well, if A represents some amount, then A - .10A = .90A.

So instead of calculating 10% and subtracting, we can instead just multiply by 90%.

amount = 1 for year in [0..10]: print 'year',year,'--->',amount amount = .90*amount 
       

Here's an exponential function describing our situation.  

f(x) = .9^x show(f) 
       
plot(f,0,10) 
       
 
       

Suppose you invest $1000 in an account paying 5% annual interest.

How long would it take to double your money?

amount = 1000 for year in [0..15]: print year,'$',amount amount = 1.05*amount 
       

This is another example of expoential growth.

The growth factor b is 1.05, because we are adding 5% interest to 100%.

If a is some original amount, then a + .05a = 1.05a.

f(x) = 1000*1.05^x show(f) 
       

We can see in the table we generated that the number of years required to double the amount is between 14 and 15.

If we want to determine the specific value of x, we can use logarithms:

1000 \cdot 1.05^x = 2000

1.05^x = 2

x = \log(2, 1.05)

Read the last line to yourself as, "x is the exponent that raises 1.05 to the value of 2."

log(2.0,1.05) 
       

On most scientfic calculators you would enter it like this:

log(2.0)/log(1.05) 
       
 
       

The inverse of an exponential function is a logarithmic function.

To find the inverse of f(x) = b^x:

Write in x  y notation:  y = b^x

Swap x and y:  x = b^y

Say to yourself, "y is the exponent that raises b to the value of x."

Solve for y:  y = \log_{b}x

Again, say to yourself, "y is the exponent (logs are exponents!) that raises b to the value of x."

f^{-1}(x) = \log_{b}x

In schoolish math \log by itself implies a base of 10, known as common logs,

and \ln implies a base of e, known as natural logs.

However, mathematicians themselves don't always think about it that way.

For real mathematicians, \log frequently means natural log, and they don't even care about common logs.

show(plot(e^x,-5,5,color='green')+plot(log,0,5,color='red')+plot(x,-5,5,color='black'),ymax=5,aspect_ratio=1)