首页 > 其他分享 >ZJOI2018树--等价类相关计算

ZJOI2018树--等价类相关计算

时间:2023-05-07 22:12:00浏览次数:40  
标签:even frac means -- sum 等价 ZJOI2018 odd

ZJOI2018 树

  • 节点 1 作为树的根。
  • 对于 \(i \in [2, n]\) ,独立地从 \([1, i)\) 中等概率随机选取一个节点作为 \(i\) 的父亲。

通过上面的方法独立的随机生成 \(k\) 棵 \(n\) 个节点的有根树 \(T_1\) 至 \(T_k\) ,他们两两同构的概率是多少。

denote \(s(t)\) the ways assign number to a tree

Define a shift operator \(D_c\) by

\[D_c(\sum_k\frac{a_kx^k}{(k!)^c})=\sum_k\frac{a_kx^{k-1}}{((k-1)!)^c}) \]

we want to know

(now the variable \(t\) always means a tree with size \(|t|\))

\[T_k=\sum_t\frac{x^{|t|}s(t)^k}{(t!)^k} \]

we have a equation

\[D_k(T_k(x))=\prod_{t}\sum_i\frac{x^{i|t|}s(t)^{ik}}{(|t|!)^{ik}(i!)^k}=\exp(\sum_iT_{ik}(x^i)f_{k,i}) \]

here \(f_{k,i}\) means the i-th coefficient of

\[\ln(\sum_j\frac{x^j}{(j!)^k}) \]

so it can be solved by newton iteration or other techniques in \(O(n^2)\)

enum comb vol2 exercise 5.12

Let \(f(n)\) be the number of pairs \((u,v)\) of [n] permutations satisfying \(u^2=v^2\) find egf. of \(f\)

in fact the answer is \(\sum_i p_ix^i\) where \(p_i\) is integer partition , but I do not know how to do that.

but these kind of problem that enumerate information about equivalence class is extremely similar.

when squaring a cycle , it will remain unchanged when it is odd, and split into two when it is odd, so

for odd

\[\prod_{p ~ odd} \sum_m\frac{x^{pm}}{p^m m!}(\sum_k\binom{m}{2k}\binom{2k}{k}k!\frac{p^k}{2^k})^2 \]

\(p^k\) means find a place to link two cycle.

for even

\[\prod_{p ~ even} \sum_{m ~ even} \frac{x^{pm}}{p^mm!}(\binom{m}{m/2}(m/2)!\frac{1}{2^{m/2}})^2 \]

multiply to function gives the answer, though the computation is slow.

\[ \]

标签:even,frac,means,--,sum,等价,ZJOI2018,odd
From: https://www.cnblogs.com/pigpigger/p/17380286.html

相关文章

  • 同行盆友来稿:初探Python变量
    什么是变量在Python编程语言中,变量是用于存储数据值的标识符。它们可以用来引用数据值,而不是直接使用值本身。可以使用等号(=)运算符来将一个值赋给一个变量。变量数据类型有那些变量类型有以下几种:1.整型(int):表示整数,例如:`42`、`-3`、`1000`等。2.浮点型(float):表示浮点数(即带......
  • static关键字
    static全局静态变量1.普通全局变量和static全局静态变量都是静态存储方式。普通全局变量的作用域是整个源程序,当一个源程序由多个源文件组成时,普通全局变量在各个源文件中都是有效的 2.静态全局变量限制了其作用域,只在定义该变量的源文件内有效static局部静态变量局部静态变......
  • DockerFile之ENV使用
    一、Dockerfile代码FROMopenjdk:8-alpine#统一时间,做软链接。ln[参数][源文件或目录][目标文件或目录]RUNrm-rf/etc/localtime&&ln-snf/usr/share/zoneinfo/Asia/Shanghai/etc/localtimeRUNmkdir-p/tzh/zkuiADDconfig.cfg/tzh/zkui/config.cfgADDzkui......
  • FastRPC资料汇总
     DEFCONSafeMode-SlavaMakkaveev-Pwn2OwnQualcommcomputeDSPforfunandprofit.pdf https://github.com/raspberrypi/linux/blob/stable/drivers/misc/fastrpc.c external_fastrpc/fastrpc_apps_user.cat556fa85d14bfdac3c211e27cec9b975f9efb50c6·Evol......
  • POJ 动态规划题目列表
    声明:1.这份列表当然不是我原创的,从文库里下载了一份,放到这里便于自己浏览和查找题目。※最近更新:Poj斜率优化题目1180,2018,3709列表一:经典题目题号:容易:1018, 1050, 1083, 1088, 1125, 1143, 1157, 1163, 1178, 1179, 1189, 1191,1208, 1276, 1322, 1414, 1456, 1458......
  • (hdu step 3.1.7)Children’s Queue(求n个人站在一起有m个人必须是连在一起的方案数)
    题目:Children’sQueueTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):853AcceptedSubmission(s):479 ProblemDescriptionTherearemanystudentsinPHTSchool.Oneday,theheadmasterwhosen......
  • (hdu step 3.2.1)Max Sum(简单dp:求最大子序列和、起点、终点)
    题目:MaxSumTimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):1390AcceptedSubmission(s):542 ProblemDescriptionGivenasequencea[1],a[2],a[3]......a[n],yourjobistocalculatethemaxsu......
  • (hdu step 3.1.3)母牛的故事(简单递推)
    题目:母牛的故事TimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):659AcceptedSubmission(s):481 ProblemDescription有一头母牛,它每年年初生一头小母牛。每头小母牛从第四个年头开始,每年年初也生一头小......
  • (hdu step 3.2.3)Super Jumping! Jumping! Jumping!(DP:求最长上升子序列的最大和)
    题目:SuperJumping!Jumping!Jumping!TimeLimit:2000/1000MS(Java/Others)MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):896AcceptedSubmission(s):518 ProblemDescriptionNowadays,akindofchessgamecalled“SuperJumping!......
  • (hdu step 2.3.8)小兔的棋盘(卡特兰数:从左上角走到右上角的路径数)
    题目:     小兔的棋盘TimeLimit:1000/1000MS(Java/Others)MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):802AcceptedSubmission(s):502ProblemDescription小兔的叔叔从外面旅游回来给她带来了一个礼物,小兔高兴地跑回自己的房间,拆开一看是......