数论--卡特兰数

来源:互联网 发布:手机ui界面设计软件 编辑:程序博客网 时间:2024/04/29 01:42

Catalan 卡特兰数

1,2,5,14,42,132,429...

1.catalan(n) = C(n 2n)/(n + 1) 但是计算时一般不用,容易溢出

2.c[0] = 1

c[n + 1] = c[0] * c[n] + c[1] * c[n - 1] + ... + c[n] * c[0]

3.c[0] = 1

(n + 2) * c[n + 1] = (4 * n + 2) * c[n] 

递推公式 c[n + 1] = (4n + 2) / (n + 2) * c[n].


应用:

1.多边形的三角剖分数目

三角形->1

4边形->2

五边形->5

2.数字加括号的方式

(1 2) ->1种

(1 2) 3,1 (2 3) -> 2种

((1 2) 3) 4,(1 2)(3 4),(1 (2 3)) 4,1 ((2 3) 4),1(2 (3 4)) -> 5种

3.the number of rooted, trivalent trees with n+1 nodes 

4. the number of paths of length 2n through an n-by-n grid that do not rise above the main diagonal 

在2n * 2n的棋盘上,从(1,1)至(2n,2n)而不穿过对角线的走法(一侧)

5.不同形态的二叉树数目

6.The number of ways 2n people, seated round a table, can shake hands in n pairs, without their arms crossing.

原创粉丝点击