zoukankan      html  css  js  c++  java
  • 第二类斯特林数

    第二类斯特林数##

    第二类斯特林数,记为(egin{Bmatrix} n \ m end{Bmatrix})(S(n,m)),表示将(n)个元素划分到(m)个非空无序集合的方案数

    计算式##

    计算式有两种,递推式和通项式

    --递推式--
    (n)个元素有两种选择,自己独立为一个集合,或者加入之前的集合

    [egin{Bmatrix} n \ k end{Bmatrix} = egin{Bmatrix} n - 1 \ k - 1 end{Bmatrix} + egin{Bmatrix} n - 1 \ k end{Bmatrix} * k ]

    --通项式--
    根据容斥:

    [egin{Bmatrix} n \ m end{Bmatrix} = frac{1}{m!} sumlimits_{k = 0}^{m} (-1)^{k} {m choose k} (m - k)^{n} ]

    可以用(NTT)(O(nlogn))的时间内计算出所有的关于(n)相同的(egin{Bmatrix} n \ m end{Bmatrix})
    不过通常会结合其它式子展开化简

    性质##

    接下来不加证明地给出一些性质:

    [egin{Bmatrix} 0 \ 0 end{Bmatrix} = 1 ]

    [egin{Bmatrix} n \ 0 end{Bmatrix} = 0 [ n >0] ]

    [egin{Bmatrix} n \ n end{Bmatrix} = 1 ]

    [egin{aligned} egin{Bmatrix} n \ 2 end{Bmatrix} &= egin{Bmatrix} n - 1 \ 1 end{Bmatrix} + egin{Bmatrix} n - 1 \ 2 end{Bmatrix} * 2 \ &= 1 + egin{Bmatrix} n - 1 \ 2 end{Bmatrix} * 2 \ &= 2^{n - 1} + 1 end{aligned}]

    [egin{Bmatrix} n \ n - 1 end{Bmatrix} = {n choose 2} ]

    [egin{Bmatrix} n \ n - 2 end{Bmatrix} = {n choose 3} + 3 * {n choose 4} ]

  • 相关阅读:
    Ios8代码关闭输入预测问题
    iOS10 拍照崩溃问题
    iOS 圆的放大动画效果
    12-指针
    11-数组、字符串
    09-函数
    iOS 动画
    iOS 传值 委托(delegate)和block 对比
    IOS Table中Cell的重用reuse机制分析
    IOS 网络请求
  • 原文地址:https://www.cnblogs.com/Mychael/p/8975571.html
Copyright © 2011-2022 走看看