Last week, I covered Binary Logarithm. Here is the magic number that we use in logarithm a lot as well, except in this time, it is at the base of ‘e’, instead of the 2, which we call this natural logarithm. It is helpful in my opinion to know and understand the concept of number ‘e’ and natural logarithm to solve problems to be a computer science industry person. The number ‘e’ is often called Euler’s number these days. ‘e’ is just another form of constants like the ‘π’. Well, why is ‘e’ so important? To answer that in a sentence, it represents the natural growth (or decay or anything that does similar) in our life, \(f(x)=e^x\). It can be used to estimate the growth/decay in our life.
John Napier discovered the logarithm in 1618 but did not define any natural constant for it. The discovery of the constant itself is credited to Jacob Bernoulli in 1683,[7][8] who attempted to find the value of the following expression (which is in fact e):
[e = {\displaystyle \lim _{n\to \infty }\left(1+{\frac {1}{n}}\right)^{n}} = 2.7182818284590452353602874713526624977572470936999595749669676277240⋯]
Leonhard Euler later introduced the letter ‘e’ as the base for natural logarithms and used it for the next few years.
In order to understand Euler’s number, you need to understand what exponential growth is. When you think of exponential growth, you are probably thinking “growing fast”. Let me start by giving some examples of exponential growth, \({x^2}\) as we all know grows fast. However, \({x^2{^0}}\) probably grows faster. They all grow fast. Following equation came as a result that they all grow fast,
[a_n=(1+\frac {1}{n})^n]
If we punch in numbers from \(a_1\) to \(a_2{_0}\), we have,
You can see the number slowly moves closer to 2.71. We can modify above equation in this fashion:
[b_n=\sum_{n=0}^\infty \frac {1}{n!}]
Now let’s calculate this from \(b_1\) to \(b_2{_0}\),
We can see this is moving much faster and similarly reaches closer and closer to 2.71. People have gone through these numbers and gone up to 12,884,901,000 decimal places which are ridiculously crazy given that the number goes to infinity.
Below 2 are probably the most common real life usage you will find that heavily uses this magic number.
Let’s talk about the 2 applications I listed above.
Let’s say P = \(250,342e^0{^.{^0{^1{^2{^t}}}}}\) where t = 0 represents the population in the year 2000. What is the expected population in the year 2015? To find the population in the year 2015, we need to let t = 15. P = \(250,342e^0{^.{^0{^1{^2{^({^1{^5{^)}}}}}}}}\) = \(250,342e^0{^.{^1{^8}}}\) which is around 299,714 people. Let’s tweak the problem a little bit. What if we wanted to know the time when the population reaches 400,000? 400,000 = \(250,342e^0{^.{^0{^1{^2{^t}}}}}\) given that rate of 1.2% growth, we have time taking roughly 39 years then. Let’s take a look at another population example, A scientist starts with 100 bacteria in an experiment. After 5 days, she discovers that the population has grown to 350. Let’s determine the equation for this bacteria population growth. First, we know with some constant with 5 days it grew from 100 to 350. Applying this to the function representation, 350 = \(100e^5{^c}\) then if we calculate for the constant, c, we get 0.25055. So now equation for the growth given this layout becomes \(P = 100e^0{^.{^2{^5{^0{^5{^5{^t}}}}}}}\). With this equation, we can apply this to estimate future growth such as what is population going to be after 30 days? and so on.
Probably the most common example for the exponential growth is in the investment. What is your interest you would get given rate and the frequency (number)?
\(A = P(1+\frac {r}{n})^n{^t}\) would be the equation where,
Let’s say bank offers you 100% of interest per year with one dollar in your bank account. Awesome deal! What’s the equation to calculate the return? \(($1+\frac {1}{1})^1\) which is equal to $2. Now, what ‘if’ bank offered interest every 6 months? \((1+\frac {1}{2})^2\). The rate is 1/2 as its 2 times a year and frequency would be 2 in one year which is $2.25. So, we actually have the higher number than $2. That’s somewhat exciting. What if we make it more frequent, say every month? The equation becomes \((1+\frac {1}{12})^1{^2}\) which is like $2.61. Woohoo, it’s growing!! Now, let’s make it more frequent, like every day. What’s the equation? It’s \((1+\frac {1}{365})^3{^6{^5}}\) which is like $2.71 and it didn’t jump a lot this time, like 10 cents as opposed to the big jump in the beginning. If we kept on going to even smaller frequency, you will notice it just stays as $2.71 as this number is what we say ‘e’, natural growth.
Here we have a slightly more realistic example:
An investment of $500 is made in a 6-year condition that earns 4\(\frac 1 2\)% annual interest that is compounded monthly. How much is the bank account worth at the end of the 6-year term
Well, this is easy since we had a similar example above, let’s just put the numbers into the equation above: \((1+r)^n\). We then get \(500(1+\frac {0.045}{12})^1{^2}\) where 0.045 is just same as 4\(\frac 1 2\)%. So if we calculate this, we get that the account will be worth $654.65 at the end of the 6-year term.