Cattelan Number Summary

Cattelan number, the first few terms of Cattelan number are : 1, 1, 2, 5, 14, 42, 132, 429, 1430

Let h(1)=1, h(2)=1 , the catalan number satisfies the recurrence formula [1]

h(n)= h(1)*h(n-1)+h(2)*h(n-2) + ... + h(n-1)h(1) (n>=3)

The applications of Cattelan numbers are essentially applications of recursive equations

bracketing problem

  Matrix chain multiplication: P=a1×a2×a3×…×an , according to the associative law of multiplication, the order is not changed, and only parentheses are used to represent paired products. How many parenthesis schemes are there? (h(n) species )

pop order problem

The push sequence of   a stack ( infinity ) is 1 , 2 , 3 , ... , n , how many different pop sequences are there ?

  analyze

  For each number, it must be pushed once and popped once. We set the push to state '1' and the pop to state '0' . All states of n numbers correspond to 2n - bit binary numbers consisting of n ones and n zeros . Since the operands waiting to be pushed onto the stack are arranged in the order of 1n , and the operand b pushed onto the stack is greater than or equal to the operand a popped off the stack (a≤b) , the total number of output sequences = scan from left to right by n A 2n -bit binary number composed of 1 and n 0s , and the number of solutions for the cumulative number of 1s is not less than the cumulative number of 0s .

The number of schemes for filling n 1s  in a 2n -bit binary number is c(2n,n), and the remaining n bits that are not filled with 1s are automatically filled with 0s . Subtract the number of solutions that do not meet the requirements (scanning from left to right, the cumulative number of 0 is greater than the cumulative number of 1 ) is the required number.

  The characteristic of the number that does not meet the requirements is that when scanning from left to right, the cumulative number of m+1 0s and the cumulative number of m 1s must first appear on an odd bit 2m + 1 , and then 2 ( nm ) There are nm 1s and nm-1 0s on the -1 bit . If the 0s and 1s on the latter 2(nm)-1 bits are interchanged to make them nm 0s and nm-1 1s , the result is 1 composed of n + 1 0s and n -1 1s 2n digits, i.e. an undesired number corresponding to a number consisting of n+1 zeros and n -1A permutation of 1s .

  Conversely, for any 2n -bit binary number composed of n +1 0s and n -1 1s , since the number of 0s is 2 more, 2n is an even number, so there must be a cumulative number of 0s in an odd-numbered digit Cumulative number over 1 . Also in the latter part , 0 and 1 are swapped to make it a 2n -digit number composed of n 0s and n 1s , that is, the 2n - digit number composed of n +1 0s and n -1 1s must correspond to one that does not meet the requirements . number of.

  Therefore, the undesirable 2n digits correspond to the permutation of n + 1 0 and n - 1 1 in one- to-one correspondence.

  Obviously, the number of schemes that do not meet the requirements is c(2n,n+1) . This results in the total number of output sequences =c(2n,n)-c(2n,n+1)=1/(n+1)*c(2n,n) .

  (The subscript of this formula starts from h(0)=1 )

  similar question

2n people lined up to enter the theater   . Admission fee is 5 yuan. Among them, only n people have a 5 -yuan bill, and the other n people only have 10 -yuan bills, and there are no other bills in the theater. How many ways are there so that as long as there are 10 -yuan people who buy a ticket, the ticket office will have a 5 -yuan bill to change? ( The arrival of the person holding 5 yuan is regarded as putting 5 yuan into the stack, and the arrival of the person holding 10 yuan is regarded as popping a certain 5 yuan in the stack )

Triangulation of convex polygons

  Find the number of ways to divide a convex polygonal region into triangular regions.

Similar: A large city attorney works n blocks north and n blocks east   of her residence . Every day she walks 2n blocks to work. If she never crosses (but can hit) the diagonal line from home to office, how many possible paths are there?

Similar: How many ways to select 2n points on a circle and connect these points in pairs such that the resulting n line segments do not intersect ?

The problem of forming a binary tree with given nodes, given N nodes, how many different binary trees can be formed? (can form h ( N ) pieces)

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326861183&siteId=291194637