当前位置:网站首页>Application scenarios of Catalan number
Application scenarios of Catalan number
2022-07-03 06:39:00 【I also want to write bugs today】
List of articles
Carter LAN number
Derivation of Cartland number :
Carter LAN number (Catalan)

Application scenarios
Suppose there is n A left bracket and n Right parenthesis , How many legal combinations do they have .
Altogether C(2n,n) Combinations of , Suppose these combinations are A aggregate .
For illegal combinations , There must be a prefix , The number of right parentheses is more than that of left parentheses 1 individual , such as())(()Chinese prefix()), And the suffix must be the right bracket less than the left bracket 1 One((), We reverse the suffix ( The left bracket becomes the right bracket , The right bracket becomes the left bracket ), In this way, the right bracket in the whole combination is n+1, The left bracket is n-1. There are C(2n,n-1) Combinations of , Suppose they are B aggregate .
A Illegal combinations in can be pushed through inversion B All cases in the set , and B Collections can also be pushed out by reversing A Illegal combination in . therefore A The illegal quantity in is equal to C(2n,n-1).
Sum up , There are legal combinations C(2n,n)-C(2n,n-1) Kind of .n How many legal ways to get in and out of the stack .
The number of any prefix out of the stack must be less than the number of prefix in the stack , So this problem turns into the bracket problem above . Its combination is also C(2n,n)-C(2n,n-1) Kind of .Altogether n Nodes , How many ways to form a binary tree .
Yes 0 Nodes , The method is empty tree , The way to form a binary tree 1 Kind of .
Yes 1 Nodes , The tree is for itself ,1 Kind of .
Yes 2 Nodes , root + Left or root + Right ,2 Kind of .
Yes n Nodes , Select a node as the head node ; The left side of the head node 0 Nodes , On the right n-1 Nodes ; The left side of the head node 1 Nodes , On the right n-2 Nodes ; The left side of the head node 2 Nodes , On the right n-3 Nodes ... Can be launchedk(n)=k(0)*k(n-1)+k(1)*k(n-2)+....+k(n-2)*k(1)+k(n-1)*k(0), That is to say, the number of Cartland C(2n,n)-C(2n,n-1) Combination mode .
边栏推荐
- golang操作redis:写入、读取kv数据
- Yolov2 learning and summary
- Print time Hahahahahaha
- Create your own deep learning environment with CONDA
- After the Chrome browser is updated, lodop printing cannot be called
- [C /vb.net] convert PDF to svg/image, svg/image to PDF
- Condition annotation in uni-app realizes cross segment compatibility, navigation jump and parameter transfer, component creation and use, and life cycle function
- “我为开源打榜狂”第一周榜单公布,160位开发者上榜
- 远端rostopic的本地rviz调用及显示
- 剖析虚幻渲染体系(16)- 图形驱动的秘密
猜你喜欢

DBNet:具有可微分二值化的实时场景文本检测

Scroll view specifies the starting position of the scrolling element

ruoyi接口权限校验

Selenium ide installation recording and local project maintenance

JMeter performance automation test

Summary of remote connection of MySQL

Interesting research on mouse pointer interaction

Local rviz call and display of remote rostopic

Yolov1 learning notes

23 design models
随机推荐
每日刷题记录 (十一)
机器学习 | 简单但是能提升模型效果的特征标准化方法(RobustScaler、MinMaxScaler、StandardScaler 比较和解析)
In depth analysis of kubernetes controller runtime
UTC时间、GMT时间、CST时间
golang操作redis:写入、读取hash类型数据
Chapter 8. MapReduce production experience
Advanced technology management - do you know the whole picture of growth?
IC_EDA_ALL虚拟机(丰富版):questasim、vivado、vcs、verdi、dc、pt、spyglass、icc2、synplify、INCISIVE、IC617、MMSIM、工艺库
Install VM tools
Example of joint use of ros+pytoch (semantic segmentation)
2022年华东师范大学计科考研复试机试题-详细题解
Yolov2 learning and summary
Mysql database binlog log enable record
使用conda创建自己的深度学习环境
Une exploration intéressante de l'interaction souris - pointeur
修改MySQL密码
Naive Bayes in machine learning
Click cesium to obtain three-dimensional coordinates (longitude, latitude and elevation)
Interesting research on mouse pointer interaction
Docker advanced learning (container data volume, MySQL installation, dockerfile)