-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
94 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
contents: | ||
contents: | ||
- name: 图论 | ||
directory: 图论 | ||
- name: 数学 | ||
directory: 数学 | ||
- name: 数据结构 | ||
directory: 数据结构 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
contents: | ||
contents: | ||
- name: 流 | ||
directory: 流 | ||
- name: lca | ||
code: lca.cpp | ||
code-pre: lca-pre.tex | ||
code-post: lca-post.tex | ||
- name: 流 | ||
directory: 流 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
contents: | ||
contents: | ||
- name: maxFlow | ||
code: maxFlow.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
contents: | ||
- name: 排列组合 | ||
code-pre: 排列组合-pre.tex | ||
- name: 斐波那契数列 | ||
code-pre: 斐波那契数列-pre.tex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
组合数的性质: | ||
|
||
\[ | ||
\binom{n}{m}=\binom{n}{n-m}\tag{1} | ||
\] | ||
|
||
相当于将选出的集合对全集取补集,故数值不变。(对称性) | ||
|
||
\[ | ||
\binom{n}{k} = \frac{n}{k} \binom{n-1}{k-1}\tag{2} | ||
\] | ||
|
||
由定义导出的递推式。 | ||
|
||
\[ | ||
\binom{n}{m}=\binom{n-1}{m}+\binom{n-1}{m-1}\tag{3} | ||
\] | ||
|
||
组合数的递推式(杨辉三角的公式表达)。我们可以利用这个式子,在 $O(n^2)$ 的复杂度下推导组合数。 | ||
|
||
\[ | ||
\binom{n}{0}+\binom{n}{1}+\cdots+\binom{n}{n}=\sum_{i=0}^n\binom{n}{i}=2^n\tag{4} | ||
\] | ||
|
||
这是二项式定理的特殊情况。取 $a=b=1$ 就得到上式。 | ||
|
||
\[ | ||
\sum_{i=0}^n(-1)^i\binom{n}{i}=[n=0]\tag{5} | ||
\] | ||
|
||
二项式定理的另一种特殊情况,可取 $a=1, b=-1$。式子的特殊情况是取 $n=0$ 时答案为 $1$。 | ||
|
||
\[ | ||
\sum_{i=0}^m \binom{n}{i}\binom{m}{m-i} = \binom{m+n}{m}\ \ \ (n \geq m)\tag{6} | ||
\] | ||
|
||
拆组合数的式子,在处理某些数据结构题时会用到。 | ||
|
||
\[ | ||
\sum_{i=0}^n\binom{n}{i}^2=\binom{2n}{n}\tag{7} | ||
\] | ||
|
||
这是 $(6)$ 的特殊情况,取 $n=m$ 即可。 | ||
|
||
\[ | ||
\sum_{i=0}^ni\binom{n}{i}=n2^{n-1}\tag{8} | ||
\] | ||
|
||
带权和的一个式子,通过对 $(3)$ 对应的多项式函数求导可以得证。 | ||
|
||
\[ | ||
\sum_{i=0}^ni^2\binom{n}{i}=n(n+1)2^{n-2}\tag{9} | ||
\] | ||
|
||
与上式类似,可以通过对多项式函数求导证明。 | ||
|
||
\[ | ||
\sum_{l=0}^n\binom{l}{k} = \binom{n+1}{k+1}\tag{10} | ||
\] | ||
|
||
通过组合分析一一考虑 $S=\{a_1, a_2, \cdots, a_{n+1}\}$ 的 $k+1$ 子集数可以得证,在恒等式证明中比较常用。 | ||
|
||
\[ | ||
\binom{n}{r}\binom{r}{k} = \binom{n}{k}\binom{n-k}{r-k}\tag{11} | ||
\] | ||
|
||
通过定义可以证明。 | ||
|
||
\[ | ||
\sum_{i=0}^n\binom{n-i}{i}=F_{n+1}\tag{12} | ||
\] | ||
|
||
其中 $F$ 是斐波那契数列。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
\begin{enumerate} | ||
\item 卡西尼性质(Cassini's identity):$F_{n-1} F_{n+1} - F_n^2 = (-1)^n$。 | ||
\item 附加性质:$F_{n+k} = F_k F_{n+1} + F_{k-1} F_n$。 | ||
\item 取上一条性质中 $k = n$,我们得到 $F_{2n} = F_n (F_{n+1} + F_{n-1})$。 | ||
\item 由上一条性质可以归纳证明,$\forall k\in \mathbb{N},F_n|F_{nk}$。 | ||
\item 上述性质可逆,即 $\forall F_a|F_b,a|b$。 | ||
\item GCD 性质:$(F_m, F_n) = F_{(m, n)}$。 | ||
\end{enumerate} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
contents: | ||
contents: | ||
- name: disjoint_set_union | ||
code: disjoint_set_union.cpp | ||
- name: fenwick-tree | ||
|