It blew my mind
A long time ago, I was a pure math student sitting in a lecture theater. The lecturer derived the gamma function (
It must be important, it has an exclamation!
Factorials are denoted by a !, for example,
Let's plot the function
I stopped at n = 6 because the numbers got too big to show what I want to show.
To state the obvious,
Integration is fun
Leonard Euler is a huge figure in mathematics; the number
One of the many, many things Euler did was investigate the properties of series involving
We're going to build up a sequence of integrations. hopefully, the pattern should be obvious to you:
With some proof by induction, we can show that the general case is:
(The proof involves some calculus and some arithmetic. If I get some time, I might update this post with a full derivation, just because.)
Euler named a version of this relationship the gamma function and wrote it as:
Go back and look at the integration. Where does it say in the integration that
If we redefine factorial using the gamma function, it becomes meaningful to calculate
or maybe we should write
The gamma function has a very curious property that struck me as being very cool.
When I heard all this, my undergraduate mind was blown.
What Legendre did wrong
Euler defined the gamma function as:
But for various reasons, Legendre re-formatted it as:
Sadly, this is the form universally used now. This form is inconvenient, but like the QWERTY layout of keys on a keyboard, we're stuck with it.
What does it look like?
The chart below shows the gamma function for a range of values. I've limited the range of the x and y values so you can see its shape around zero.
For
What use is it?
Factorials are used in probability theory and any form of math involving combinations. They're one of the bedrock ideas you need to understand to do anything useful. The gamma function is used in statistics, number theory, and quantum physics.
One cool use of the gamma function is calculating the volume and surface area of an n-dimensional sphere:
where:
- r is the radius
- n is the number of dimensions
(n-dimensional spheres crop up in information theory - as you're reading this, you're using something that relies on their consequences.)
But frankly, I don't care about uses in the real world. It's a great function with some really cool properties, and sometimes, that's enough for me.
Programmers are mathematicians too
My high school math teacher told us our calculators would give us an error if we tried calculating factorials for any non-positive integer number. She wanted us to know why it wouldn't work. The people who built my high school calculator had a very literal definition of factorial, but it looks like the good programmers at Google are mathematicians at heart.
Type the word 'calculator' into the Google search box and you should see something like this.
Now type in -1.5! You should get -1.32934038818. Google has implemented the factorial key using the gamma function for numbers that are not just non-positive integers. I've heard that calculators on other systems do the same thing too. This makes me unreasonably happy.
Pure math - but...
Pure math has a very odd habit of becoming essential to business. The mathematicians who developed number theory or linear algebra or calculus didn't do so to make money, they did it to understand the world. But even some very abstract math has spawned huge businesses. The most obvious example is cryptography, but wireless communications rely on a healthy dose of pure math too, as I'll show in a future post.