47 lines
1.5 KiB
Markdown
47 lines
1.5 KiB
Markdown
---
|
||
title: Factorials
|
||
localeTitle: 阶乘
|
||
---
|
||
## 阶乘
|
||
|
||
### 因子的定义
|
||
|
||
阶乘是将它乘以每个intiger低于结束为1的intiger。如果初始数字为负,则结果为无穷大。
|
||
|
||
因子n是非负整数,定义如下:
|
||
|
||
N! = 1 \* 2 \* ... \*(n - 1)\* n
|
||
|
||
当n = 0时出现特殊情况。即0! = 1 。
|
||
|
||
### 因子的便利性
|
||
|
||
上面的定义为您提供了某些计算的便利。例如,分数内的阶乘通常可以简化如下:
|
||
|
||
例1: 7! / 5! =(1 \* 2 \* 3 \* 4 \* 5 \* 6 \* 7)/(1 \* 2 \* 3 \* 4 \* 5)= 6 \* 7 = 42
|
||
|
||
例2: (n + 1)! / n! =(1 \* 2 \* ... \* n \*(n + 1))/(1 \* 2 \* ... \* n)= n + 1
|
||
|
||
### 替代定义
|
||
|
||
或者,阶乘可以定义如下:
|
||
|
||
0! = 1
|
||
|
||
N! = n \*(n - 1)!如果n> 0
|
||
|
||
这种递归定义意味着与传统定义完全相同。将其应用于上面的第二个例子,我们得到:
|
||
|
||
(n + 1)! / n! =(n + 1)\* n! / n! = n + 1
|
||
|
||
### 旁白:扩展到非整数
|
||
|
||
请注意,上面定义的阶乘仅适用于非负整数。实际上,有一个阶乘的推广也延伸到非整数,即Gamma函数。特别是,对于任何自然数n ,你有n! = Gamma(n + 1)= n \* Gamma(n) 。
|
||
|
||
有关更多信息,请参阅[将factorial扩展为参数的非整数值](https://en.wikipedia.org/wiki/Factorial#Extension_of_factorial_to_non-integer_values_of_argument) 。
|
||
|
||
一个棘手的例子,很多人可能不知道0! = 1.如需进一步证明,请参阅更多信息下的链接。
|
||
|
||
#### 更多信息:
|
||
|
||
[阶乘](http://www.purplemath.com/modules/factorial.htm) |