The reason why the factorial of 0 is 1 In my opinion, it is inappropriate for some people to deduce 0! = 1 by using the factorial recurrence formula The premise of recurrence formula n! = n * (n-1)! Is n > 1, so it is wrong to substitute 1 to get 0! = 1 Factorial is defined as n! = 1 * 2 * 3 *. * n or n! = n *. * 3 * 2 * 1, starting from or ending at 1 So 1! = 1 * 1 and not equal to 1 * 0! =In the permutation formula, P = n! / (m-n)! In order to make the equation hold when m = n, the denominator cannot be 0, so 0! = 1 is specified. Moreover, we know that there is only one way to take n elements from n elements, so it can only be specified equal to 1, not equal to 2, 3 The last sentence is wrong. There are n! Ways to take n elements from n non primes, so p = n, so 0! = 1 cannot be equal to 2,3

The reason why the factorial of 0 is 1 In my opinion, it is inappropriate for some people to deduce 0! = 1 by using the factorial recurrence formula The premise of recurrence formula n! = n * (n-1)! Is n > 1, so it is wrong to substitute 1 to get 0! = 1 Factorial is defined as n! = 1 * 2 * 3 *. * n or n! = n *. * 3 * 2 * 1, starting from or ending at 1 So 1! = 1 * 1 and not equal to 1 * 0! =In the permutation formula, P = n! / (m-n)! In order to make the equation hold when m = n, the denominator cannot be 0, so 0! = 1 is specified. Moreover, we know that there is only one way to take n elements from n elements, so it can only be specified equal to 1, not equal to 2, 3 The last sentence is wrong. There are n! Ways to take n elements from n non primes, so p = n, so 0! = 1 cannot be equal to 2,3

0! Equal to 1 is defined to make it meaningful when combined with other operations
In some programming, there may be n!
You can only for I: = 1 to n do TMP: = TMP * I; (Pascal)
The initial value of TMP can only be 1, otherwise there will be a problem