Introducing the Factorial: the Exclamation Mark of Math

N Factorial from 1 to 5 or 10, image by Mike DeHaan

N Factorial from 1 to 5 or 10. Image by Mike DeHaan

What is a “factorial,” and how is it used in mathematics?

The Mathematical Definition of Factorial for Positive Integers

In mathematics, a factorial is a function applied to natural numbers greater than zero. The symbol for the factorial function is an exclamation mark after a number, like this: 2!

The usual definition of “n factorial” is “n! = n * (n – 1) * (n – 2) *…* 2 * 1,” where ‘n’ is a positive integer.

The first handful of factorial values from positive integers are: 1! = 1; 2! = 2; 3! = 3*2 = 6; 4! = 4*3*2 = 24; and 5! = 5*4*3*2 = 120. In the image, only the first five factorial results are plotted although the first ten have been calculated.

Recursive Definition for the Factorial

A recursive definition for the factorial function is “n! = n * (n-1)!”, placing the lower limit for the recursion at n=2.

Would you like to see more articles like this?
Support This Expert's Articles, This Category of Articles, or the Site in General Here.
Just put your preference in the "I Would Like to Support" Box after you Click to Donate Below:


Factorial Function: Practical Uses

Although the factorial function deals with repeated multiplication, its most obvious use in math is to compute the number of ways in which ‘n’ objects can be permuted.

A permutation is a re-arrangement of a set. For example, set A={a} has exactly one arrangement. However, set B={a,b} could be re-arranged as {b,a}; and set C={a,b,c} has the six permutations {(a,b,c), (a,c,b), (b,a,c), (b,c,a), (c,a,b), (c,b,a)}.

Note that |A| = 1 (set A has one element), |B| = 2 and |C| has three; but they have 1, 2 and 6 permutations respectively. Our readers are invited to list the permutations for set D={a,b,c,d}, but there should be two dozen in that permutation set.

This extends to selecting permutations of an ordered subset. From set C={a,b,c}, how many ways can two elements be selected and permuted? The solution set is {(a,b), (b,a), (a,c), (c,a), (b,c), (c,b)}, and has six elements.

Click to Read Page Two: The Formula for Choosing K

© Copyright 2012 Mike DeHaan, All rights Reserved. Written For: Decoded Science


  1. e says

    I wrote javascript in the console to play with the concept.

    to be honest, I think the reason math is so impenetrable for people is that if you took the same way people write math problems out to code, people would hate your guts. Everything is horrible shorthand. I came to this page because I wanted to know how the formula on this page works (

    There’s no explanation of the logic behind these concepts, or why they get you to the right answer. I can appreciate the quick and dirty need to just utilize functions and things people have already figured out, but for the curious mind there is so little nourishment. Why does it work, what do these sub calculations represent, if I wanted to recombined them in different ways to solve new problems, I can’t because I don’t know what they mean.

    I can really struggle thinking just factorial out for an hour, to say, well the reason 3*2 works is that the 2 represents the number of times each element can appear at the beginning of the set, and 4*3*2 works because the each element can appear at the beginning of the set 3 times, and when you’ve accounted for those possibilities, the number of remaining variations for those sets are the number of times each element of the remaining elements are going to appear first, but be damned if anyone is going to try to put that in English, or spend more than the 5 minutes I spent hear trying to make it actually coherent to someone just encountering this concept. And the only reason I can sort of make sense of it is because I spent a lot of time thinking about it one time as a kid, not because any teacher tried to explain or even knew themselves why it worked.

    ok that’s my rant ! At least the page I found above was better than the broken responses you normally find when asking ‘what actually is sin’ and people just tell you what sin is useful for.

    var factorial = function(n) {
    if (n > 2) { return n * factorial(n – 1) } else { return n } }

    • K.S.Patel says

      5!8!2! = 120*40320*2 = 9676800
      5! = 5*4*3*2*1 = 120
      8! = 8*7*6*5*4*3*2*1 = 40320
      2! = 2*1 = 2

  2. Lee Shafer says

    I just saw the clock where all the hours are expressed as some formula involving only 9. I don’t get 7 o’clock. To make 7 you need that last part to =1. There is a line with .9 under it. I never had that in school.what is that?it obviously equals one. Lee

    • Poorva says

      9 – Root 9 + .9 with bar

      = 9 – 3 + .9
      = 6 + .9
      = 6.9
      = 7

      as per the maths rule, we sum up the number when it exceeds 0.5 .. Here the .9 has a bar .i.e. 6.999999999999 (Infinite) hence we summed it up to 7

      • Bill says

        6 point (infinite number of 9s) is the same as 7. No need to round up.
        5 is wrong as it uses 9! (factorial) to mean 9+8+…+1 rather than multiplied by

  3. Mike DeHaanMike DeHaan says

    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.
    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 ).
    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!)

    • meshfields_blog says

      Because the number of possible permutations of 0! is 1. The empty set { } is still one empty set with one permutation inside.

      Proof: Let n=1, using the definition n! = n*(n-1)! then is
      1! = 1*0! which can be simplified to 1 = 0!. ■

Leave a Reply

Your email address will not be published. Required fields are marked *