
The exponential function is a miracle - ColinWright
https://blog.plover.com/math/exponential.html
======
kerkeslager
This is such a weird thread. There are a bunch of people arguing about why
their favorite math thing is more a miracle than someone else's favorite math
thing.

Nothing is surprising if you've seen it before. Let's just let each other be
excited about our favorite math, okay?

Euler's identity is the one that gets me:

    
    
        e^(i * pi) + 1 = 0
    

How can this be? The five fundamental constants are related!

~~~
jacobolus
> exp( _iπ_ ) = –1 ... _How can this be?_

The “plain English” expression of this formula is: a half turn rotation in a
plane is equivalent to a reflection across the axis of rotation.

YMMV, but I have found that small children can understand this statement.

~~~
creato
Talking about rotation as if that is obviously relevant completely skips the
surprising and interesting part of this identity.

edit: Said another way, what you said is an explanation for what (cos(pi),
sin(pi)) is. That exp(i*pi) has anything to do with sine or cosine is what
makes the identity interesting, and your explanation says nothing about that.

~~~
garmaine
Complex numbers are about rotation. That’s the only odd insight in Euler’s
equation. Once you get that, it all falls into place (and in fact starts to
explain all the use of complex numbers in engineering).

~~~
posterboy
what does electric engineering have to do with rotation? Generators perhaps
run in circles, an inductor is a coil often enough, but a capacitor?

~~~
mikorym
Electromagnetism concerns movement of what appear to be moving circles. If you
roll a circle with a pen marker it draws a sine or cosine curve. If you try to
draw the spiral of a light wave you get perpendicular sine and cosine curves.
Light is electromagnetic radiation and in turn both electricity and magnetism
are fundamentally connected forces.

~~~
posterboy
there is no "spiral of a light wave" lol. If anything, I'd think of
transversal movement. Ironically I cannot say that nobody has ever seen a
photon. But nobody has ever seen an electron. There could be a model in which
electrons move transversal (at mm/s), mediated by photons, but I have not
looked that closely into it. It's not part of the usual theories.

if you attach a pen to a hoop and move the hoop along a wall, you do not get a
wave, you get (edit: what looks like but isn't) sharp discontinuity where the
pen touches the ground
([https://google.com/search?q=cos%28x-sin%28x%29%29](https://google.com/search?q=cos%28x-sin%28x%29%29))

~~~
garmaine
Circular polarized light is a spiral, at least in terms of how we normally
draw the vector annotation.

------
GlenTheMachine
It is’t the exponential function that’s a miracle, it’s the Maclaurin series.
Think about it. The Maclaurin series says that in a very real sense, the value
of a function at zero, and the value of all of its derivatives at zero,
contains all of the information there is to know about it. Intuitively, this
should be completely unexpected. Why in the world would the derivatives of a
function evaluated at a single point tell you anything whatsoever about the
value of the function arbitrarily far away from that point?

EDIT: as mentioned below, this is not true of _all_ functions, even all
functions that are infinitely differentiable at zero. But it is true for very
large classes of functions.

~~~
md224
> Intuitively, this should be completely unexpected.

It actually makes intuitive sense to me. I like to think of it this way:

1) If we have the value of a function at a given point and we want to
extrapolate the function's values before and after that point, we need to know
how the value is changing at that point: the derivative.

2) But if that derivative isn't constant, that won't get us very far. We also
need to know how the derivative is changing at the given point: the 2nd
derivative.

3) But if that 2nd derivative isn't constant, that won't get us very far. We
also need to know how the 2nd derivative is changing at the given point: the
3rd derivative.

And so on, potentially up to infinity. But once we take into account all of
the derivatives, we know how the value of the function is changing _and_ how
that change is itself changing, and as there is no additional change that
comes "out of nowhere", so to speak, we have enough information to calculate
the value at any other point.

~~~
objektif
But the problem is that the definitions of those derivatives are for
infonitesimal change. What about far away points?

~~~
ddxxdd
Far away points have properties resembling infinitesimally close points, as
long as the function is continuous.

Now when there's a lack of continuity, then we run into a problem.

------
zests
This is behavior that could be expected when you evaluate _any_ infinite
Taylor series far enough away from where the series is centered. Denominators
of a typical Taylor series are fixed and the numerators depend polynomially on
x.

The post is definitely an interesting observation. I would chalk the miracle
up to Taylor series and analytic functions in general, however.

~~~
joppy
I guess the miracle is that the series converges everywhere. For example, the
Taylor series for log(1 + x) only converges for |x| < 1.

------
foxes
The exponential captures the idea of slowly perturbing an object by a small
amount. Suppose you start with some object, perform some action on it, then
add the result back to your original object. On a manifold you can't add
objects together, but you can push your object a little bit along a tangent
vector (think of the tangent vector just as the slope of a function at the
point). If you just recursively do this operation, as long as the amount you
push by grows smaller you end up at a well defined point. Effectively you have
pushed a point 1 unit along a geodesic (locally shortest path). So you can
define the exponential map in much more generality as a Taylor series for more
interesting things than just functions on R. For example given a (matrix) Lie
group G and its Lie algebra (actually the tangent space at the identity), the
exponential map

    
    
      exp : g -> G
    

is defined by its Taylor series

    
    
      exp(X) = 1 + X + (1/2) X^2 + ...
    
    

(X is some n x n matrix).

~~~
boyobo
Everything you said seems to be valid if you replace 'exponential' by 'f'
where 'f' is any real analytic function.

~~~
foxes
First of all I was capturing the defn

exp(f) = lim_{n \rightarrow \infty} (id + f/n)^n,

but yes there are lots of other functions you can define more generally. The
exponential just comes up particularly naturally.

~~~
boyobo
Ah, I didn't realize that's what you were trying to say with the explanation
at the beginning. Now your post makes more sense.

------
thanatropism
I'm late to the party. But let me offer first the finite-differences linear
equation

    
    
        A[n]=A[n-1]*k
    

For A[0] = 1, the solution is the sequence

    
    
        1, k, k^2, k^3, k^4, k^5, k^6....
    

If we let k be the complex number i, this becomes

    
    
        1, i, -1, -i, 1, i, -1, -i, 1...
    

As you can see, the introduction of imaginary parts extends the original idea
of powers-of-k (which if real go exponentially to infinity if k>1 and to 0 if
k<1) to an alternating oscillatory pattern both in the real parts

    
    
        1, 0, -1, 0, 1, 0, -1, 0, 1
    

and the imaginary parts. What you're seeing there is almost the celebrated
relationship between imaginary exponentials and sine functions.

Now: that was the _finite-differences_ linear equation. If instead we take the
_differential_ linear equation

    
    
        f'(x) = kf(x)
    

we get the exponential function. Again, if k=i, you get oscillatory behavior.

------
hyperbovine
This is a special case of a more general phenomenon: quite a lot of
probability density functions (of which the exponential function is an
example) can be expressed as alternating sums containing huge combinatorial
terms. As if by magic, the result is always between zero and one. It’s
actually a large headache for computations.

~~~
amluto
Huh? Probability density functions aren’t bounded between 0 and 1. Their
integrals are exactly 1, but that’s considerably less interesting.

~~~
hyperbovine
Sorry, you are right, meant to say cumulative density function. (Or survival
function, as in the case of exp(-x).)

~~~
amluto
True, but this has never felt like math magic to me. Usually you come up with
a magical function for the PDF or similar, and then normalize it so that the
CDF has the right integral. That last bit is just drudgery, not magic.

If you’re lucky, you can work with unnormalized distributions.

------
kazinator
But this is the case for the polynomial approximation to just about anything.
The individual terms yield wildly different numbers that cancel each other
out, and individually they approximate the desired function poorly.

As a joke, a few years ago I created a polynomial approximation for Fibonacci.

fib(9) suddenly goes beserk and calculates the answer to life, the universe
and everything!

[https://news.ycombinator.com/item?id=14331627](https://news.ycombinator.com/item?id=14331627)

~~~
meuk
You should approximate it with an exponential function. Actually, the nth
Fibonacci can be obtained exactly by rounding an exponential function:

[https://en.wikipedia.org/wiki/Fibonacci_number#Computation_b...](https://en.wikipedia.org/wiki/Fibonacci_number#Computation_by_rounding)

~~~
kazinator
I'm well aware of the closed form for Fibonacci since my undergrad days. This
was produced as a kind of joke. I simply took the first several, plus 42
thrown in, and fit them to an N-th degree polynomial.

------
lacker
This is a very poor description of this formula for e^x - it isn’t a miracle
at all that it converges!

It’s pretty simple. The numerators are x^n. The denominators are n!. For any
x, the denominators grow faster than the numerators, so it’s no surprise that
it converges. The ratio only starts shrinking when n > x but you can see that
with high school math.

 _Somehow all these largish random numbers manage to cancel out almost
completely._

No, they aren’t “largish random numbers”, it’s just the ratio between two
series, one of which grows asymptotically faster than the other.

~~~
Dylan16807
Converging isn't a surprise. This giant mishmash somehow converging near zero
is a surprise, and getting something with e is even more of a surprise.

Nowhere in the post does it express surprise about the fact that each series
converges on _something_.

Separately, "largish random numbers" is a perfectly fine way to describe the
start of the series, which is the most important part for influencing what it
eventually converges on. Somehow despite each series getting increasingly
enormous before dropping back toward zero, the convergence point ends up less
and less perturbed by those enormous terms.

------
agumonkey
From my non mathematician view, it's not one function per se, but how they all
fit together in an ideal framework.

------
a-dub
meanwhile, i just thought it was cool that you could draw a line where it's
slope was equal to it's value.

------
dschuetz
It's beautiful math, yes. But a miracle? I don't know.

------
crystaln
This seems intuitively obvious, not a miracle.

Take every other element in a series that has any regularish omnidirectional
trend, alternate addition and subtraction, and you are quite likely to end up
with a zero convergence.

~~~
boyobo
I'm not sure exactly what you mean here but there I can't think of an
interpretation that makes your statement close to being true.

e.g. 1+4-9+16-25+36-49=-26

------
lopmotr
That doesn't really show that it's amazing. You could say the same about
x-x=0, even for large x. Or about any converging series. Unless all of that is
amazing too - I wouldn't know, not being a mathematician.

~~~
ridiculous_fish
You gave two scenarios which are worth addressing:

"x-x=0". Here we have two terms (x and -x). Their magnitude grows at the same
rate, so it is not surprising that their difference is fixed and the two-term
"series" "converges" to zero.

"Any converging series." Consider the exponential _growth_ function: e^x = 1 +
x + x^2/2 + x^3/6 ... + x^n/n!. This grows fast, but we know that the
factorial is super-exponential so the terms must approach zero for any fixed
x. If the series converges (true though not obvious) then the value must
increase very quickly.

Now consider the exponential _decay_ function. Unlike x-x, the terms are
raised to different powers, so they grow at different rates. And unlike the
exponential growth function, the series converges to zero in the limit.

The "miracle" is not the convergence but how it happens: terms growing in
opposite directions at wildly different rates. It's as if a lopsided spaceship
chaotically fired rockets at full power in all directions, and happened to
stay exactly still.

~~~
lopmotr
I see, it's more amazing than my simple examples. But why is it more amazing
as this presumably uninteresting series I just made up

sum(n=1...infinity, 1/2^n - 1/(2^n+1))

That also has alternating terms that grow differently in opposite directions
and have huge numbers, yet they cancel out so that it converges to something.
Is that uninteresting because each term in a pair has the same exponent, or
because it doesn't converge to something that's closer to zero as something in
the terms increases?

Maybe you can't easily just make up a converging series that has all the
features they listed and that uniqueness makes it interesting?

~~~
boyobo
I would say it's not as interesting because a high-schooler (or Pythagoras)
could easily verify the fact AND they would easily be able to explain how you
came up with that sum.

One of my metrics for determining if a fact F is interesting is if P(F) is
much larger than V(F).

Here P(F) is, vaguely speaking, the amount of effort required to "explain" or
"generalize" the fact, and V(F) is the amount of effort required to verify the
fact. In the case of e^{-x}, each individual example can be verified by an
elementary schooler so V(F) is very small. On the other hand, I don't see how
you could explain the phenomena of convergence to 0 without teaching the
elementary schooler a large part of calculus, so P(F)/V(F) is large.

