Factorial

The factorial of a non-negative integer ( n ), denoted as ( n! ), is the product of all positive integers from 1 to ( n ). It is formally defined as:

– ( n! = n times (n – 1) times (n – 2) times ldots times 2 times 1 )

For the special case of ( n = 0 ), the factorial is defined as ( 0! = 1 ).

Factorials are commonly used in mathematics, particularly in permutations, combinations, and other areas of combinatorial analysis. They also play a significant role in calculus, probability theory, and various mathematical equations. The factorial function grows very rapidly with larger values of ( n ).