# Introducing the Factorial: the Exclamation Mark of Math

Permutations of an ordered subset – choose K of N: Image by Mike DeHaan

The formula for “choosing ‘k’ permutations from a set of ‘n’ elements’ = P(n, k) = (n!)/( (n-k)! ). For set ‘C’, this was 3!/1! = 6/1 = 6.

Finally for this section, the number of “k-subsets” also is calculated with factorials. This is the problem for combining selected elements but without regard to permuting them into various sequences. From set ‘C’ above, the three 2-subsets are {a,b}, {a,c}, {b,c}.

The formula for combining or “choosing” k-subsets is usually shown in the above image, where C(n, k) = (n!)/( k! * (n-k)! ).

These concepts and formulas are useful in discrete probabilty theory, where one must determine the proportion of items that might be selected versus all the combinations that could be chosen.

Plot of the Gamma Function: Image adapted from Alessio Damato

### Extending the Factorial Beyond Positive Integers

The first and simplest extension is to define “zero factorial” = 0! = 1, for the reason that there is exactly one way to arrange zero objects. In other words, the empty set, {}, has exactly that one permutation.

The gamma function for positive integers is defined as Γ(n) = (n-1)!. This is not an extension of the factorial function, but simply defines part of the gamma function in terms of factorials.

The gamma function may be extended to all positive Real numbers by defining it as the smooth line that fits the points defined by the factorials of positive integers. This integration function plots a smooth curve that joins the (n, n!) points on the Cartesian plane for ( x > zero, Γ(x) ) in the Real numbers. Note the U-shaped curve in the upper right quadrant of the plot. In the integration version of the gamma function, ‘e’ is the base of natural logarithms, with a value of approximately 2.718.

Gamma Function as an Integral.

Finally, the general gamma function extends to negative Real numbers and complex numbers. (Complex numbers have the form “z = x + iy”, where ‘z’ is Complex, ‘x’ and ‘y’ are Real, and ‘i’ is the square root of -1). The value of the integral function approaches infinity as the argument approaches each negative integer. Γ(x) never has the value zero.

Another equation defining the gamma function is Γ(x) = (x-1) * Γ(x-1), which is more reminiscent of the recursive definition of the factorial function on positive integers.

The gamma function has applications in probability and statistics, particularly when dealing with continous variables. However, any further discussion about the gamma function will be deferred for much later articles.

### A Future for Factorials in Decoded Science

We will also put an exclamation point on factorials through topics in permutations, combinations, and probability, as well as practical applications of each. To whet your appetite, one application of factorials is to calculate how many different bingo cards are required for a complete set.

References:
Weisstein, E. W. Factorialk-Subset; Permutation.  MathWorld–A Wolfram Web Resource. (1999-2012). Accessed August 8, 2012.

Pages: 1 2

• joe franco

why is 0! = 1

• Mike DeHaan

Excellent question. By appeal to authority in Wolfram, “The special case 0! is defined to have value 0!=1, consistent with the combinatorial interpretation of there being exactly one way to arrange zero objects (i.e., there is a single permutation of zero elements, namely the empty set)”.
Wikipedia’s “Gamma function” has the line
“Combining this with Γ(1) = 1, we get Γ(n) = (n-1)!”
when defining the gamma function.
Plus…
SosMath discusses the gamma function as an integral, noting that “e^(-1) = 1″ (and should have noted “x^0 = 1″). Further down the page, they derive Γ(1) = 1 from the integral.
(See http://sosmath.com/calculus/improper/gamma/gamma.html ).
My basic answer is: it works out nicely when relating factorials to the gamma function.
(Sorry I hadn’t checked my mail over the weekend!)