Thursday, April 05, 2012

Why zero factorial equals one (English)

Well, I can think about 2 more ways why we should define 0!=1

There is more below.
Ниже есть продолжение.

I. n!=1*2*3*4..*(n-1)*n - this is definition of n!. n! is multiplication of n factors starting from 1,2,... till n.

For example, 5! is multiplication of 5 factors 1*2*3*4*5 or 5!=1*2*3*4*5.

Similarly, 2! multiplication of 2 factors 1*2 or 2!=1*2.

How much is 1!? 1! is multiplication of 1 factor 1, 1!=1 (you can ask what does multiplication of 1 factor mean? Well, there is "natural" definition. Because n*1=n you can think of multiplication of 1 factor n as simple multiplication n by 1, that is multiplication of 1 factor 1 is m*1=m)

How much is 0!? 0! should be multiplication of 0 factors, so called "empty product". The value of "empty product" is 1. (Again, it is because n*1=n, so for any product we can just add 1 to the product. Alternatively, it can be derived from "empty sum")

II. a) From the formula n!=1*2*3*4..*(n-1)*n we can define recursive formula as follows:

For n>2 n!=n*(n-1)! (note, that n-1>1>0)
For n=2 2!=2
(and 1!=1 by definion)

Let try it:

2!=2 (base case)


But why we chose as base case n=2? Let put it n=1.

For n>1 n!=n*(n-1)! (note, that n-1>0)
For n=1 1!=1

So, if from previous derivation we have 2!=2 by definition (of the base case), now we can calculate it:
2!={2>1}=2!=2*(2-1)!=2*1!={1!=1 by definition of the base case}=2*1*2 that is consistent with the previous definition.

Can we go one step further? Can we define base case for n=0? Let's try

For n>0 n!=n*(n-1)! (note, that n-1>-1, that is for n=0, n-1 will be negative,
and for n=1, n-1 will be 1)
For n=0 0!=?

Well, let's try to figure out what is 2!


In order that this definition will be consistent with previous ones above, we should define 0!=1. That is we should define

For n>0 n!=n*(n-1)! (note, that n-1>-1, we can't put n=0 to this formular, only n>0)
For n=0 0!=1

In this case
1!=0!=1 as expected.

No comments:

Post a Comment