Example (1) : N: Number of Permutations (N!) : Visual Example

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

Example (1)

If n! is defined as the product of all positive integers from 1 to n, then:


1! = 1*1 = 1
2! = 1*2 = 2
3! = 1*2*3 = 6
4! = 1*2*3*4 = 24
...
n! = 1*2*3*...*(n-2)*(n-1)*n
and so on.
Logically, n! can also be expressed n*(n-1)! .
Therefore, at n=1, using n! = n*(n-1)!
1! = 1*0!
which simplifies to 1 = 0!

Example (2)
The idea of the factorial (in simple terms) is used to compute the number of permutations
(combinations) of arranging a set of n numbers.
n:

Number of Permutations (n!):

Visual example:

{1}

{1,2}, {2,1}

{1,2,3}, {1,3,2}, {2,1,3}, {2,3,1}, {3,1,2},


{3,2,1}

10

3,628,800

ummm, you get the idea...

Therefore,
0

{}

It can be said that an empty set can only be ordered one way, so 0! = 1.

Why does 0! = 1 ?
Usually n factorial is defined in the following way:
n! = 1*2*3*...*n
But this definition does not give a value for 0 factorial, so a natural question is:
what is the value here of 0! ?
A first way to see that 0! = 1 is by working backward. We know that:
2! = 1!*2
3! = 2!*3
4! = 3!*4

1! = 1
2! = 2
3! = 6
4! = 24

We can turn this around:


3! = 4!/4
2! = 3!/3
1! = 2!/2
0! = 1!/1

4! = 24
3! = 6
2! = 2
1! = 1
0! = 1

In this way a reasonable value for 0! can be found.


How can we fit 0! = 1 into a definition for n! ? Let's rewrite the usual definition
with recurrence:
1! = 1
n! = n*(n-1)! for n > 1

Now it is simple to change the definition to include 0! :


0! = 1
n! = n*(n-1)! for n > 0

Why is it important to compute 0! ?


An important application of factorials is the computation of number combinations:
n!
C(n,k) = -------k!(n-k)!

C(n,k) is the number of combinations you can make of k objects


out of a given set of n objects. We see that C(n,0) and C(n,n)
should be equal to 1, but they require that 0! be used.
n!
C(n,0) = C(n,n) = ---n!0!

So 0! = 1 neatly fits what we expect C(n,0) and C(n,n) to be.


Can factorials also be computed for non-integer numbers? Yes, there is a famous
function, the gamma function G(z), which extends factorials to real and even
complex numbers. The definition of this function, however, is not simple:
inf.
G(z) = INT x^(z-1) e^(-x) dx
0

Note that the extension of n! by G(z) is not what you might think:
when n is a natural number, then G(n) = (n-1)!
The gamma function is undefined for zero and negative integers, from which we
can conclude that factorials of negative integers do not exist.

You might also like