莫比乌斯反演推导即μ函数的证明

题目描述

求长度为\(n\)且仅包含小写英文字母且循环节长度恰为\(n\)的字符串的个数。
意思是求一个长度为\(n\)的字符串的个数,它的任意一个子串重复若干次都不能和原串相等
\(f(n)\)为长度为\(n\)的字符串个数,设\(g(n)\)为题目所求答案的个数
显然
\[f(n)=26^n,f(n)=\sum_{d\mid n}g(d)\]
第一个很显然
第二个意思是 任意一个长度为\(d(d\mid n)\)的串,重复\(\frac{n}{d}\)次的和,就是长度为\(n\)的字符串的个数
又设
\[\sum_{d\mid n}\mu(d)=[n=1]\]
\([n=1]\)的意思为当\(n=1\)时,表达式值为\(1\),否则为\(0\)
因为
\[g(n)=\sum_{m\mid n}[\frac{n}{m}=1]g(m)\]
当表达式为真时,\(n=m\)\(g(n)=g(m)\)
\(\sum_{d\mid n}\mu(d)=[n=1]\)代入
\[g(n)=\sum_{m\mid n}\sum_{d\mid\frac{n}{m}}\mu(d)g(m)\]
因为\(m\mid n\)\(d\mid\frac{n}{m}\),所以可以先枚举d
\[g(n)=\sum_{d\mid n}\mu(d)\sum_{m\mid\frac{n}{d}}g(m)\]
再看一开始的\(f(n)\)
\[f(n)=\sum_{d\mid n}g(d)\]
\[g(n)=\sum_{d\mid n}\mu(d)\sum_{m\mid\frac{n}{d}}g(m)\]
代入
\[g(n)=\sum_{d\mid n}\mu(d)f(\frac{n}{d})\]
调换下标\(d\to \frac{n}{d}\)
因为枚举\(d\mid n\)等价于\(\frac{n}{d}\mid n\)
\[g(n)=\sum_{d\mid n}\mu(\frac{n}{d})f(d)\]
因为
\[f(n)=26^n(O(logn)快速幂)\]
\[\sum_{d\mid n}枚举因数(O(\sqrt n))\]
如何求\(\mu(n)\)


已知\[x=\prod_{i=1}^{K}p_i^{a_i}(p_i\in prime),\mu(x)=\prod_{i=1}^{K}[a_i=1](−1)\]
求证\[\sum_{d\mid n}\mu(d)=[n=1]\]
证明:
\(f(n)=\sum_{d\mid n}\mu(d)\)
显然\(f(1)=\mu(1)=1\)
假设已经证明\(f(1)\)\(f(n-1)\)\(f(1)=1\)\(f(2)\)\(f(n-1)\)都为0
当存在某一个\(a_i>0\)
\[f(n)=\sum_{d\mid n}\mu(d),f(\frac{n}{p_i})=\sum_{d\mid\frac{n}{p_i}}\mu(d)\]
\[\because\frac{n}{p_i}<n\]
\[\therefore f(\frac{n}{p_i})=\sum_{d\mid\frac{n}{p_i}}\mu(d)=0\]
\[f(\frac{n}{p_i})=\sum_{d\times p_i\mid n}\mu(d)=0\]
\[\because f(n)=\sum_{d\mid\frac{n}{p_i}}\mu(d)+\sum_{d\not\mid\frac{n}{p_i},d\mid n}\mu(d)\]
\[f(n)=0+\sum_{d\not\mid\frac{n}{p_i},d\mid n}\mu(d)\]
\(\sum_{d\not\mid\frac{n}{p_i},d\mid n}\mu(d)\)\(d\)分解质因数后有\(b_i\)\(p_i\)

\[\begin{cases}b_i\leq a_i(d\mid n)\\b_i>a_i-1(d\not\mid\frac{n}{p_i})\end{cases}\]
\[\therefore b_i=a_i\]
\[\because a_i>1\]
\[\therefore b_i>1\]
\[\mu(d)=0\]
\[\sum_{d\not\mid\frac{n}{p_i},d\mid n}\mu(d)=0\]
\[\therefore f(n)=0+0=0\]
当对于所有\(a_i\)\(a_i=1\)
\[f(n)=\sum_{d\mid n}\mu(d)\]
\[f(n)=\sum_{d\mid\frac{n}{p_i}}\mu(d)+\sum_{d\mid\frac{n}{p_i}}\mu(d\times p_i)\]
\[\because a_i=1\]
所以\(d\)中不含\(p_i\)因式
\[\therefore\sum_{d\mid\frac{n}{p_i}}\mu(d\times p_i)=-\sum_{d\mid\frac{n}{p_i}}\mu(d)\]
\[\therefore f(n)=\sum_{d\mid\frac{n}{p_i}}\mu(d)-\sum_{d\mid\frac{n}{p_i}}\mu(d)=0\]
综上所述,\(f(n)=[n=1]\)

posted @ 2019-03-16 00:36 hzf29721 阅读(...) 评论(...) 编辑 收藏