zoukankan      html  css  js  c++  java
  • 「XXI Opencup GP of Tokyo」 Count Min Ratio

    link。


    非 GF 做法:https://xyix.gitee.io/posts/?&postname=cf-gym-102978-c


    简单转化问题:求所有 (x in [1, lfloor R / B floor]) 对应的合法方案数之和。

    对于某一 (x),枚举左边的红蓝球数量,可得:

    [egin{aligned} ans_x =& sum_{b = 0}^{B}sum_{r = bx}^{R - (B-b)x}inom{r + b}{b}inom{R - r + B - b}{B - b} \ =& sum_{b = 0}^{B}sum_{d = 0}^{R - Bx}inom{(bx + d) + b}{b}inom{R - (bx + d) + B - b}{B - b} \ =& sum_{d = 0}^{R - Bx}sum_{b = 0}^{B}inom{(x + 1)b + d}{b}inom{(x + 1)(B - b) + (R - Bx - d)}{B - b} \ end{aligned} ]

    以下记 (t = x + 1)


    系数 (inom{tb + d}{b})广义二项级数 (mathcal B_t(z)) 有关。

    (G(z) = frac{z}{(1 + z)^t}),则它的复合逆 (F(z) = mathcal B_t(z) - 1)。于是:

    [sum_{b=0}inom{tb + d}{b}z^b = (1 + F)^d imesfrac{1 + F}{1 - (t - 1)F} ]

    关于广义二项级数的详细内容可见文末。


    代入原式,可得:

    [egin{aligned} & sum_{d = 0}^{R - Bx}sum_{b = 0}^{B}inom{tb + d}{b}inom{t(B - b) + (R - Bx - d)}{B - b} \ =& sum_{d = 0}^{R - Bx}sum_{b = 0}^{B}left([z^b](1 + F)^d imesfrac{1 + F}{1 - (t - 1)F} ight)left([z^{B-b}](1 + F)^{R - Bx - d} imesfrac{1 + F}{1 - (t - 1)F} ight) \ =& [z^B]sum_{d = 0}^{R - Bx}left((1 + F)^d imesfrac{1 + F}{1 - (t - 1)F} ight)left((1 + F)^{R - Bx - d} imesfrac{1 + F}{1 - (t - 1)F} ight) \ =& (R - Bx + 1)left([z^B](1 + F)^{R - Bx} imesleft(frac{1 + F}{1 - (t - 1)F} ight)^2 ight) \ end{aligned} ]

    考虑对 (H(F) = (1 + F)^{R - Bx} imesleft(frac{1 + F}{1 - (t - 1)F} ight)^2) 进行拉格朗日反演:

    [egin{aligned}[] [z^B]H(F) =&[z^0]zH imes G'G^{-B-1} \ =&[z^0]z(1 + z)^{R - Bx} imesleft(frac{1 + z}{1 - (t - 1)z} ight)^2 imesfrac{1 - (t - 1)z}{(1 + z)^{t + 1}} imesleft(frac{(1 + z)^{(B + 1)t}}{z^{B + 1}} ight) \ =&[z^B]frac{(1 + z)^{(R - Bx) + 2 - (t + 1) + (B + 1)t}}{1 - (t - 1)z} \ =&[z^B]frac{(1 + z)^{R + B + 1}}{1 - xz} \ =&sum_{i = 0}^{B}inom{R + B + 1}{i}x^{B - i} end{aligned} ]

    那么答案为 ((R + 1)sum_{i = 0}^{B}inom{R + B + 1}{i}left(sum_{x = 1}^{lfloor R / B floor}x^{B - i} ight) - Bsum_{i = 0}^{B}inom{R + B + 1}{i}left(sum_{x = 1}^{lfloor R / B floor}x^{B - i + 1} ight))

    多项式求逆算自然数幂和即可。


    一些关于 (mathcal B_t(x)) 的补充。

    (mathcal B_t(x)) 满足方程 (mathcal B_t(x) = xmathcal B^t_t(x) + 1)。当 (t = 2) 时,(mathcal B_2(x)) 即卡特兰数的 OGF,那么 (mathcal B_t) 其实是卡特兰数的推广。

    参考卡特兰数,这个方程至少有如下几种组合意义:

    (1)儿子有序的 (t) 叉树。

    按照定义,显然有方程 (mathcal B_t(x) = xmathcal B^t_t(x) + 1)

    (2)凸多边形的 (t + 1) 边形划分(好像去年 FJOI 考了这道题)。

    选取一条凸多边形上的边,它所在的 (t + 1) 边形将原凸多边形划分成 (t) 份,因此有方程 (mathcal B_t(x) = xmathcal B^t_t(x) + 1)

    (3)((0, 0) o(n, (t - 1)n)) 且始终在直线 (y = (t - 1)x) 下方的路径数。

    仿照卡特兰数,枚举第一次碰到 (y = (t - 1)x) 的点,那么有 (mathcal B_t(x) = xmathcal B_t(x)T(x) + 1),其中 (T(x)) 表示完全不碰到 (y = (t - 1)x) 的方案数。

    考虑这条路径第一次碰到直线 (y = (t - 1)x - i,iin (0, t - 1)) 的时刻(该路径一定会碰到),并按这 (t - 1) 个时刻分段,每一段都贡献一个 (mathcal B_t(x))。因此有 (T(x) = mathcal B_t^{t-1}(x))

    感觉不是很平凡,如果有更好的构造请告诉我(用 Raney 引理直接得到封闭形式并惊讶发现它就是广义二项级数之类的就算了)

    这个组合意义可以用于解决本题。

    p.s:

    尽管上面探讨了 (mathcal B_t) 的组合意义,但是其实 (t) 在取任意值时下文中的公式都是成立的(此时定义为广义二项系数)。

    不过 (mathcal B_t) 有常数项,不方便拉格朗日反演。记 (F = mathcal B_t - 1),它有复合逆 (G = x / (1 + x)^t)。那么:

    [egin{aligned}[] [x^n]mathcal B_t^r =& [x^n](1 + F)^r \ =& [x^0]x(1 + x)^rfrac{1-(t-1)x}{(1 + x)^{t + 1}}frac{(1+x)^{tn+t}}{x^{n+1}} \ =& [x^n](1 + x)^{tn+r-1}(1-(t-1)x) \ =& inom{tn + r - 1}{n} - inom{tn + r - 1}{n - 1}(t - 1)\ =& inom{tn + r}{n} imesfrac{r}{tn + r} end{aligned} ]

    最后来推导 (sum_{n=0}inom{tn + r}{n}x^n = (1 + F)^r imesfrac{1 + F}{1 - (t - 1)F})(当然,右推左是 trivial 的):

    [egin{aligned} inom{tn + r}{n} &= [x^n](1 + x)^{tn + r} \ &= [x^0]left(frac{(1 + x)^t}{x} ight)^n(1 + x)^r \ &= [x^0]G^{-n}(1 + F(G))^r \ &= [x^0]x imes x^{-n}(1 + F)^r imes frac{F'}{F} \ &= [x^n](1 + F)^r frac{xF'}{F} end{aligned} ]

    之后只需再证明 (frac{xF'}{F} = frac{1 + F}{1 - (t - 1)F})

    注意到 (G' = frac{1 - (t - 1)x}{(1 + x)^{t + 1}}),那么有 (frac{xG'}{G} = frac{1 - (t - 1)x}{1 + x})(这也表明 (G) 是微分有限的 废话 它能不微分有限吗),由链式法则求导又有 (F' = frac{1}{G'(F)})

    于是 (frac{xF'}{F} = frac{G(F)}{G'(F)F} = frac{1 + F}{1 - (t - 1)F})

  • 相关阅读:
    6月17日
    6月16日
    6月15日
    6月14日
    6月13日
    6月12日
    6月11日
    6月10日
    6月8日
    6月5日
  • 原文地址:https://www.cnblogs.com/Tiw-Air-OAO/p/14721675.html
Copyright © 2011-2022 走看看