Number of Catalan
Make the H (1) =1,h (0) =1,catalan number satisfy the recursive formula:
H (N) = h (1) *h (n-1) + H (2) *h (n-2) + ... + h (n-1) H (1) (where n>=2)
Alternative recursion Type:
H (N) = ((4*n-2)/(n+1)) *h (n-1);
The solution of this recursive relationship is:
H (n+1) =c (2n,n)/(n+1) (n=1,2,3,...)
Application:
1. The problem of parentheses
Matrix chain multiplication: P=a1xa2xa3x......xan, according to the multiplication of the law, do not change its order, only in parentheses to denote the product of the pair, how do you have a number of bracketed schemes?
H (N) Species
2. The problem of stacking order
A stack (infinity) of the stack sequence is a three-in-one,.. N, how many different out-stack sequences are there?
Similar: There are 2n individuals lined up to enter the theater. Admission fee is 5 yuan. of which only n individuals have a 5-dollar bill, the other N people only 10 yuan banknotes, the theater no other banknotes, asked how many of the methods so long as there are 10 of people buy tickets, the ticket office has 5 yuan of money change? (will hold 5 yuan to see as the 5 yuan into the stack, holding 10 yuan to the view to make a stack of 5 yuan out of the stack)
3. Dividing polygons into triangular issues
Similarly: A barrister in a big city works N blocks north of her home and N blocks East. Every day she walks 2n blocks to work.
If she never crosses (but can touch) the diagonal from home to the office, how many possible roads are there?
Similar: Select 2n points on a circle to connect these points in pairs so that the resulting n segments do not intersect the number of methods?
4. The problem of a given node forming a two-fork tree
Given n nodes, how many different two-fork trees can be formed?
First go to a point as a vertex, then the left can be taken 0 to N-1 corresponding, the right is N-1 to 0, 22 pairs multiplied, is H (0) *h (n-1) + H (2) *h (n-2) + + H (n-1) H (0) =h (n))
(capable of constituting H (N))
Analysis on the number of Cattleya