Glen Turner wrote:
O Plameras wrote:
Another way of saying: factorial 0 = 1 is a "by definition" thing
in Mathematics and everybody then accepts it,
factorial(0) = 1 makes sense, because factorials are a
measure of the number of ways you can combine items.
1! = 1 way to arrange one item (a)
2! = 2 ways to arrange two items (a b), (b a)
3! = 6 ways to arrange three items (a b c) (a c b) (b a c) (b c a)
(c a b) (c b a)
So how many different ways can you arrange the empty set ()?
One. It cannot be zero, as this implies the empty set cannot
be a set (ie, you've defined the empty set out of existence,
which in turn implies no zero (as it is the count of items of
the empty set), and your arithmetic quickly losses usefulness
as operations such as subtraction become undefined).
Yeah, that's one way to make a sense of factorial 0 = 1.
There's another way.
Another way to see that 0! = 1 is by working backward. We know that:
1! = 1
2! = 1!*2
2! = 2
3! = 2!*3
3! = 6
4! = 3!*4
4! = 24
We can turn this around:
4! = 24
3! = 4!/4
3! = 6
2! = 3!/3
2! = 2
1! = 2!/2
1! = 1
0! = 1!/1
0! = 1
In this way a REASONABLE value for 0! can be found.
Your and my explanation are empirical explanations and so
none is in any way a definition.
It's often the way with edge cases that we choose the case
that leaves our arithmetic with the most power.
[ This isn't to say there aren't good uses for limited
arithmetics with slightly differing rules (eg, in computing
it's often convenient to see if ADD can be substituted with
XOR and if the arithmetic properties we need are retained). ]
It's also trivial to show factorial(n-1) <= factorial(n).
So there cannot be greater than one ways to arrange the
empty set.
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html