Defining zero factorial
johndcook.com
johndcook.com
Dividing by n of course, (n-1)!=n!/n. This immediately extends the notion of factorials backwards to 0!=1!/1.
It's only a matter of checking to see which factorial-dependent formula (usually arising in context of combinatorics, or gamma function) fits - and it turns out (luckily) that everything fits.
Edit: Even if it tuned out some things don't fit, we would still be free to define 0! as 1 as a convention. But the fact that everything fits, makes it a useful definition - prevents you from checking a lot of edge cases, eliminating the need of many ``if (k==0) ...`` from codes.
But wait! If you interpret 1/0 in a limit sense... there is no result, because there's no constraint that the neighborhood of 0 is entirely positive or entirely negative (obviously, the neighborhood of 1 is entirely positive). You'd only get an answer of "infinity" if you were limiting a function like "1 / 0^2".
Sure enough, we see that the gamma function has no limit at the nonpositive integers, always approaching positive infinity from one side and negative infinity from the other side. So the factorial of a negative integer doesn't exist. What point are you trying to make?
On the complex plane, there is more than one side to approach from. And the convention that was used when I learned complex analysis (stereographic projection), is that there is only one value of infinity, which can be approached from many directions. Under this model, the point at infinity is much better-behaved than the points at infinity in real analysis.
The Gamma function is characterized as having poles at the negative integers. That's a very straightforward description, and the behavior is well-understood and relatively easy to deal with. Certainly easier to deal with than the value of e^-x as x->0 (that singularity is essential, rather than a pole).
If you want to think a little more:
You are given a value v, which you are told is n! for some n, which you are not told. Find a general algorithm to produce (n-1)!.
I have an algorithm which, I fear, may not have the most efficient running time.
The number of ways to do A and then B is the number of ways to do A times the number of ways to do B. The number of ways to do nothing and then A should be the same as the number of ways to do A. This implies that the number of ways to do nothing is the multiplicative identity, one.
However, this same reasoning would say (-1)! = 1, (-2)! = 1, etc. And while you could define negative factorials that way, it's better in practice to leave negative factorials undefined.
The negative factorial issue arises from a slightly awkward specification of the set, not from jameshart's core idea.
But conceptually the primary use case in combinatorics is for permutations, i.e. $n!=|S_n|$, which only makes sense for $n \ge 0$. You could even make an argument for n!= because $|S_0|$ should be 1 on its own (because there's exactly one permutation of the empty set) without saying that it makes formulas easier. (This, I note again, matters regardless of what the gamma function does.)
There's also some controversy about whether "there are no natural numbers <= 0"...
This is hardly rigorous mathematics, but I find it interesting that it should converge to the same prediction, when I gave it no bias that it should be that way.
This is due to the gamma function extension: https://www.youtube.com/watch?v=QhDDpSju3uY
The empty product is 1 so that $\prod_{x \in S \setminus T}x\prod_{x \in T}x = \prod_{x \in S}x$ holds for all $T \subseteq S$.
It's the exact same reason why the empty sum is zero (zero being the neutral element of a monoid using additive notation).
n! is commonly defined as the product of all positive integers less than or equal to n. For n = 0, this is the product of the empty set.
Arguing about what it should be "in general" is treating math like reality television, and it makes you dumber.
O! Isn't a big controversy, but the idiocy surrounding O^0 (which is usefully different in combinatorics vs in analysis) is mind-boggling.
• If p(x) = ∑[n=0..∞] a_n x^n is a power series, then p(0) = a_0 is its constant term, but it makes no sense to write this unless 0^0 = 1.
• The power rule d/dx [x^n] = n x^(n−1) holds for n = 1 and x = 0, but this requires 0^0 = 1.
The reason that some people believe it’s important to undefine 0^0 in analysis is that the limiting expression
lim[x → a] f(x)^g(x)
does not necessarily exist when lim[x → a] f(x) = lim[x → a] g(x) = 0. But all this means is that we have to draw a distinction between the _value_ 0^0, which equals 1, and the indeterminate _limiting form_ 0^0, which is an abbreviation for the above type of limit.
It is not uncommon for values to evaluate differently from the corresponding limiting forms. For example, the value floor(0) equals 0, but the limiting form floor(0) is indeterminate. It may seem surprising that such a discrepancy arises for exponentiation, but all it means is that exponentiation is discontinuous at (0, 0), as it must be.
(Note however that the above limit _does_ exist with mild conditions on f and g: if f, g are complex analytic functions with f not identically zero, then the limit equals 1.)
See also Donald Knuth’s _Two notes on notation_: http://arxiv.org/abs/math/9205211.
Similarly, floor(−1/n) converges to −1, which tells us that the _limiting form_ floor(0) is not always equal to 0; but the _value_ floor(0) is still equal to 0. Nobody uses this to argue that the value of floor(0) should be undefined or context-dependent.
But you are right, what I meant is there is no way to define 0^0 maintaining continuity of the power function. Why is this important? Because power is a continuous function otherwise.