2011-05-19, 05:26 PM
If you look at the definition of factorial in terms of the previous value, it's
fact(x) = x*fact(x-1)
fact(0) = 1
for x in non-negative integers.
If you try to extend that to include negative integers, the obvious method is to invert that function so you can go towards the negatives:
fact(x-1) = fact(x)/x
fact(-1) = 1/0
fact(-2) = (1/0)/-1 = (-1/0)
Either you redefine factorials some other more complicated way, or you deal with it being undefined at negative integers. Might as well keep it simple. It still works for real numbers, anyway.
fact(x) = x*fact(x-1)
fact(0) = 1
for x in non-negative integers.
If you try to extend that to include negative integers, the obvious method is to invert that function so you can go towards the negatives:
fact(x-1) = fact(x)/x
fact(-1) = 1/0
fact(-2) = (1/0)/-1 = (-1/0)
Either you redefine factorials some other more complicated way, or you deal with it being undefined at negative integers. Might as well keep it simple. It still works for real numbers, anyway.

