Catalan 数

\ (Catalan \) the number of columns

Given \ (n-\) a \ (0 \) and \ (n-\) a \ (1 \) , are arranged in a certain order of length \ (2N \) sequence satisfies any prefix \ ( 0 \) number of less than all \ (1 \) number is the sequence number \ (Catalan \) columns.

prove:

Order \ (n-\) a \ (0 \) and \ (n-\) a \ (0 \) freely arranged in a length \ (2N \) sequence \ (S \) , if the \ (S \) and does not satisfy any of the prefix \ (0 \) number is not less than \ (1 \) number, there is a minimum position \ (2P + 1 \) , so \ (S \) [ \ (1 , 2P 1 + \) ] have \ (P \) a \ (0 \) , \ (P + 1 \) a \ (1 \) . And the \ (S \) [ \ (2P + 2 \) , \ (\ 2N) ] numbers are negated, comprising \ (np-1 \) a \ (0 \) and \ (NP \) th \ (1 \) . So, we get \ (n-1 \)A \ (0 \) and \ (n + 1 \) a \ (1 \) arranged in sequence.

Similarly, so \ (n-1 \) a \ (0 \) and \ (n + 1 \) a \ (1 \) freely arranged in a length \ (2N \) sequence \ (B \) . Also there must be a minimum position \ (2P +. 1 \) , so \ (s [1,2p + 1] \) have \ (P \) a \ (0 \) , \ (P +. 1 \) one \ (1 \) , the sequence take back counter, to give a \ (n-\) a \ (0 \) , \ (n-\) a \ (1 \) is present consisting of a prefix \ (0 \) ratio \ (1 \) and more sequences.

So, in fact, the number of two sequences is the same:

  1. There \ (n-\) a \ (0 \) , \ (n-\) a \ (1 \) is present consisting of a prefix \ (0 \) than \ (1 \) multiple sequence.
  2. By the \ (n-1 \) a 0, \ (n-1 + \) a \ (1 \) sequences.

So, with all cases minus the illegal situation to get a few Cartland.

inference

The following problems are related to (Catalan \) \ For the number

1. 括号匹配的合法括号序列数量

2.  合法出栈序列数量
3.  $n$ 个节点构成的不同二叉树的数量
4.  平面直角坐标系中,每一步只能向上或向右走,从$(0,0)$到$(n,n)$并且除了两个端点外不接触直线$y=x$的路线数量为$2Cat_{n-1}$。

Guess you like

Origin www.cnblogs.com/doublety/p/11778734.html