• 首页

• 官方

• 主题

• 关注

• 联系

# 栈的数学性质：n个不同元素入栈，出栈元素不同排列的个数的推导，卡特兰数（明安图数）的推导

## 二、推导

### 小蚂蚁从(0,0)碰到y=x+1到终点(n,n)就相当于从(0,0)到终点(n-1,n+1)。因此，小蚂蚁所有碰到y=x+1的到(n,n)的路线数就相当于到(n-1,n+1)的路线数，即$$\color{red}{C\text{ }\mathop{{}}\nolimits_{{2n}}^{{n-1}}}$$种。

#### 小蚂蚁从(0,0)到终点(n,n)且不碰到y=x+1的路线有

$\begin{array}{*{20}{l}}{C\text{ }\mathop{{}}\nolimits_{{2n}}^{{n}}\text{ }-\text{ }C\text{ }\mathop{{}}\nolimits_{{2n}}^{{n-1}}}\\{=\frac{{ \left( 2n \left) !\right. \right. }}{{n!n!}}\text{ }-\text{ }\frac{{ \left( 2n \left) !\right. \right. }}{{ \left( n-1 \left) ! \left( n+1 \left) !\right. \right. \right. \right. }}}\\{=\frac{{ \left( 2n \left) !\right. \right. }}{{n!n!}}\text{ }-\text{ }\frac{{n}}{{n+1}}\frac{{ \left( 2n \left) !\right. \right. }}{{ \left( n \left) ! \left( n \left) !\right. \right. \right. \right. }}}\\{= \left( 1-\frac{{n}}{{n+1}} \left) \frac{{ \left( 2n \left) !\right. \right. }}{{n!n!}}\right. \right. }\\{=\frac{{1}}{{n+1}}C\text{ }\mathop{{}}\nolimits_{{2n}}^{{n}}}\end{array}$

### 3.我们先算出当n=1,n=2,n=3,n=4,n=5时的$${f \left( n \right) }$$的值，再总结规律，$${f \left( 1 \left) =1,f \left( 2 \left) =2,f \left( 3 \left) =5,f \left( 4 \left) =14,f \left( 5 \left) =42\right. \right. \right. \right. \right. \right. \right. \right. \right. \right. }$$这怎么看规律？就用眼珠子瞪，很简单啊，知道答案，硬凑就行了。!^.^!

${\begin{array}{*{20}{l}}{\frac{{f \left( 2 \right) }}{{f \left( 1 \right) }}=\frac{{2}}{{1}},\frac{{f \left( 3 \right) }}{{f \left( 2 \right) }}=\frac{{5}}{{2}},\frac{{f \left( 4 \right) }}{{f \left( 3 \right) }}=\frac{{14}}{{5}},\frac{{f \left( 5 \right) }}{{f \left( 4 \right) }}=\frac{{42}}{{14}}}\\{\frac{{f \left( 2 \right) }}{{f \left( 1 \right) }}=\frac{{6}}{{3}},\frac{{f \left( 3 \right) }}{{f \left( 2 \right) }}=\frac{{10}}{{4}},\frac{{f \left( 4 \right) }}{{f \left( 3 \right) }}=\frac{{14}}{{5}},\frac{{f \left( 5 \right) }}{{f \left( 4 \right) }}=\frac{{18}}{{6}}}\\{\frac{{f \left( n+1 \right) }}{{f \left( n \right) }}=\frac{{6+4 \left( n-1 \right) }}{{n+2}}=\frac{{4n+2}}{{n+2}}}\\{f \left( n+1 \left) =\frac{{4n+2}}{{n+2}}f \left( n \right) \right. \right. }\end{array}}$

### 综上，$\color{red} {f\left( n+1 \left) =\frac{{4n+2}}{{n+2}}f \left( n \right) \right. \right.}$

posted @ 2022-09-03 15:47  戈小戈  阅读(2063)  评论(0编辑  收藏  举报