User:Arsalan gujjar/sandbox

The factorial function is formally defined by the product

or recursively defined by

Both of the above definitions incorporate the instance

in the first case by the convention that the product of no numbers at all is 1. This is convenient because: There is exactly one permutation of zero objects (with nothing to permute, "everything" is left in place). The recurrence relation (n + 1)! = n! × (n + 1), valid for n > 0, extends to n = 0. It allows for the expression of many formulae, such as the exponential function, as a power series:

It makes many identities in combinatorics valid for all applicable sizes. The number of ways to choose 0 elements from the empty set is. More generally, the number of ways to choose (all) n elements among a set of n is.