<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://tcs.nju.edu.cn/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=210.28.131.14</id>
	<title>TCS Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://tcs.nju.edu.cn/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=210.28.131.14"/>
	<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Special:Contributions/210.28.131.14"/>
	<updated>2026-05-01T06:36:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Generating_functions&amp;diff=3112</id>
		<title>Combinatorics (Fall 2010)/Generating functions</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Generating_functions&amp;diff=3112"/>
		<updated>2010-07-14T03:15:02Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Catalan Number */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Stirling&#039;s Approximation ==&lt;br /&gt;
As we have seen, answers to many counting problems are expressed in terms of factorials. It is important for us to know roughly how large &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt; is, i.e. the asymptotic order of &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt;. This is done by the famous [http://en.wikipedia.org/wiki/Stirling&#039;s_approximation &#039;&#039;&#039;Stirling&#039;s approximation&#039;&#039;&#039;], also called &#039;&#039;&#039;Stirling&#039;s formula&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Theorem (Stirling&#039;s approximation)|&lt;br /&gt;
:&amp;lt;math&amp;gt;n!\sim \sqrt{2\pi n}\left(\frac{n}{e}\right)^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
The symbol &amp;lt;math&amp;gt;\sim\,&amp;lt;/math&amp;gt; means that &amp;lt;math&amp;gt;\lim_{n\rightarrow\infty}\frac{n!}{\sqrt{2\pi n}\left(\frac{n}{e}\right)^n}=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The proof of the Stirling&#039;s approximation is complicated. We will prove the following easier proposition.&lt;br /&gt;
{{Theorem|Proposition|&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln (n!)=n\ln n-n+O(\ln n)\,&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|&lt;br /&gt;
The logarithm of &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\ln (n!)=\sum_{k=1}^n\ln k&amp;lt;/math&amp;gt;. &lt;br /&gt;
Since &amp;lt;math&amp;gt;f(x)=\ln x&amp;lt;/math&amp;gt; is an increasing function of &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; for all positive &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, we have &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\ln (n!)=\sum_{k=1}^n\ln k \le \int_2^{n+1}\ln x\, \mathrm{d}x  =(n+1)\ln(n+1)-(n+1)-2\ln 2+2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Note that&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln(n+1)-\ln n=\int_{n}^{n+1}\frac{1}{x}\,\mathrm{d}x&amp;lt;\frac{1}{n},&amp;lt;/math&amp;gt;&lt;br /&gt;
thus &amp;lt;math&amp;gt;n\ln (n+1)&amp;lt;n\ln n+1&amp;lt;/math&amp;gt;. Combining this with the above upper bound,&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln (n!)\le n\ln n-n+O(\ln n).&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The full proof of Stirling&#039;s approximation involves a more precise estimation of the constant factor in &amp;lt;math&amp;gt;O(\ln n)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Binomial coefficient ===&lt;br /&gt;
For binomial coefficient, we can approximate it by the Stirling&#039;s approximation of factorial, but we also have an easier (but loose) estimation.&lt;br /&gt;
{{Theorem|Proposition|&lt;br /&gt;
:&amp;lt;math&amp;gt;\left(\frac{n}{k}\right)^k\le {n\choose k} &amp;lt; \left(\frac{\mathrm{e}n}{k}\right)^k&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|&lt;br /&gt;
The lower bound is easy:&lt;br /&gt;
:&amp;lt;math&amp;gt;{n\choose k}=\frac{n}{k}\cdot\frac{n-1}{k-1}\cdots\frac{n-k+1}{1}\ge\frac{n}{k}\cdot\frac{n}{k}\cdots\frac{n}{k}=\left(\frac{n}{k}\right)^k&amp;lt;/math&amp;gt;.&lt;br /&gt;
For the upper bound, &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{e}^{nx}&amp;gt;(1+x)^n=\sum_{i=1}^n{n\choose i}x^i&amp;gt;{n\choose k}x^k,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
for any &amp;lt;math&amp;gt;0\le k\le n&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Setting &amp;lt;math&amp;gt;x=\frac{k}{n}&amp;lt;/math&amp;gt;, we have&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{e}^k&amp;gt;{n\choose k}\left(\frac{k}{n}\right)^k.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;{n\choose k} &amp;lt; \left(\frac{\mathrm{e}n}{k}\right)^k&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Generating Functions ==&lt;br /&gt;
In Stanley&#039;s magnificent book &#039;&#039;Enumerative Combinatorics&#039;&#039;, he comments the generating function as &amp;quot;the most useful but most difficult to understand method (for counting)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution to a counting problem is usually represented as some &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; depending a parameter &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. Sometimes this &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; is called a &#039;&#039;counting function&#039;&#039; as it is a function of the parameter &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.  &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; can also be treated as a infinite series:&lt;br /&gt;
:&amp;lt;math&amp;gt;a_0,a_1,a_2,\ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ordinary generating function (OGF)&#039;&#039;&#039; defined by &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
G(x)=\sum_{n\ge 0} a_nx^n.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;G(x)=a_0+a_1x+a_2x^2+\cdots&amp;lt;/math&amp;gt;. An expression in this form is called a [http://en.wikipedia.org/wiki/Formal_power_series &#039;&#039;&#039;formal power series&#039;&#039;&#039;], and &amp;lt;math&amp;gt;a_0,a_1,a_2,\ldots&amp;lt;/math&amp;gt; is the sequence of &#039;&#039;&#039;coefficients&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the generating function can be expanded as&lt;br /&gt;
:G(x)=&amp;lt;math&amp;gt;(\underbrace{1+\cdots+1}_{a_0})+(\underbrace{x+\cdots+x}_{a_1})+(\underbrace{x^2+\cdots+x^2}_{a_2})+\cdots+(\underbrace{x^n+\cdots+x^n}_{a_n})+\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
so it indeed &amp;quot;generates&amp;quot; all the possible instances of the objects we want to count.&lt;br /&gt;
&lt;br /&gt;
Usually, we do not evaluate the generating function &amp;lt;math&amp;gt;GF(x)&amp;lt;/math&amp;gt; on any particular value. &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; remains as a &#039;&#039;&#039;formal variable&#039;&#039;&#039; without assuming any value. The numbers that we want to count are the coefficients carried by the terms in the formal power series. So far the generating function is just another way to represent the sequence&lt;br /&gt;
:&amp;lt;math&amp;gt;(a_0,a_1,a_2,\ldots\ldots)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The true power of generating functions comes from the various algebraic operations that we can perform on these generating functions. We use an example to demonstrate this.&lt;br /&gt;
&lt;br /&gt;
=== Fibonacci numbers  ===&lt;br /&gt;
Consider the following counting problems.&lt;br /&gt;
* Count the number of ways that the nonnegative integer &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; can be written as a sum of ones and twos (in order).&lt;br /&gt;
: The problem asks for the number of compositions of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; with summands from &amp;lt;math&amp;gt;\{1,2\}&amp;lt;/math&amp;gt;. Formally, we are counting the number of tuples &amp;lt;math&amp;gt;(x_1,x_2,\ldots,x_k)&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;k\le n&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;x_i\in\{1,2\}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sum_{i=1}^k x_i=n&amp;lt;/math&amp;gt;.&lt;br /&gt;
: Let &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; be the solution. We observe that a composition either starts with a 1, in which case the rest is a composition of &amp;lt;math&amp;gt;n-1&amp;lt;/math&amp;gt;; or starts with a 2, in which case the rest is a composition of &amp;lt;math&amp;gt;n-2&amp;lt;/math&amp;gt;. So we have the recursion for &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; that&lt;br /&gt;
::&amp;lt;math&amp;gt;F_n=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Count the ways to completely cover a &amp;lt;math&amp;gt;2\times n&amp;lt;/math&amp;gt; rectangle with &amp;lt;math&amp;gt;2\times 1&amp;lt;/math&amp;gt; dominos without any overlaps.&lt;br /&gt;
: Dominos are identical &amp;lt;math&amp;gt;2\times 1&amp;lt;/math&amp;gt; rectangles, so that only their orientations --- vertical or horizontal matter.&lt;br /&gt;
: Let &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; be the solution. It also holds that &amp;lt;math&amp;gt;F_n=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt;. The proof is left as an exercise.&lt;br /&gt;
&lt;br /&gt;
In both problems, the solution is given by &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; which satisfies the following recursion.&lt;br /&gt;
:&amp;lt;math&amp;gt;F_n=\begin{cases}&lt;br /&gt;
0 &amp;amp; \mbox{if }n=0\\&lt;br /&gt;
1 &amp;amp; \mbox{if }n=1\\&lt;br /&gt;
F_{n-1}+F_{n-2} &amp;amp; \mbox{if}n\ge 2.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; is called the [http://en.wikipedia.org/wiki/Fibonacci_number Fibonacci number].&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Theorem|&lt;br /&gt;
::&amp;lt;math&amp;gt;F_n=\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)&amp;lt;/math&amp;gt;,&lt;br /&gt;
:where &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
The quantity &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; is the so-called [http://en.wikipedia.org/wiki/Golden_ratio golden ratio], a constant with some significance in mathematics and aesthetics.&lt;br /&gt;
&lt;br /&gt;
We now prove this theorem by using generating functions.&lt;br /&gt;
&lt;br /&gt;
The ordinary generating function for the Fibonacci number &amp;lt;math&amp;gt;F_{n}&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}F_n x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
We have that &amp;lt;math&amp;gt;F_{n}=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;n\ge 2&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
G(x) &lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{n\ge 0}F_n x^n&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
x+\sum_{n\ge 2}(F_{n-1}+F_{n-2})x^n.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
For generating functions, there are general ways to generate &amp;lt;math&amp;gt;F_{n-1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F_{n-2}&amp;lt;/math&amp;gt;, or the coefficients with any smaller indices.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
xG(x)&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}F_n x^{n+1}=\sum_{n\ge 1}F_{n-1} x^n=\sum_{n\ge 2}F_{n-1} x^n\\&lt;br /&gt;
x^2G(x)&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}F_n x^{n+2}=\sum_{n\ge 2}F_{n-2} x^n.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
So we have&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=x+(x+x^2)G(x)\,&amp;lt;/math&amp;gt;,&lt;br /&gt;
hence&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\frac{x}{1-x-x^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
The value of &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; is the coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; in the Taylor series for this formular, which is &amp;lt;math&amp;gt;\frac{G^{(n)}(0)}{n!}=\frac{1}{\sqrt{5}}\left(\frac{1+\sqrt{5}}{2}\right)^n-\frac{1}{\sqrt{5}}\left(\frac{1-\sqrt{5}}{2}\right)^n&amp;lt;/math&amp;gt;. Although this expansion works in principle, the detailed calculus is rather painful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
There is an easier way to get this coefficient than directly expanding the Taylor series. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1-x-x^2&amp;lt;/math&amp;gt; has two roots &amp;lt;math&amp;gt;\frac{-1\pm\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Denote that &amp;lt;math&amp;gt;\phi=\frac{2}{-1+\sqrt{5}}=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{2}{-1-\sqrt{5}}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;. Then &amp;lt;math&amp;gt;(1-x-x^2)=(1-\phi x)(1-\hat{\phi}x)&amp;lt;/math&amp;gt;, so we can write &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{x}{1-x-x^2}&lt;br /&gt;
&amp;amp;=\frac{x}{(1-\phi x)(1-\hat{\phi} x)}\\&lt;br /&gt;
&amp;amp;=\frac{\alpha}{(1-\phi x)}+\frac{\beta}{(1-\hat{\phi} x)},&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; satisfying that&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{cases}&lt;br /&gt;
\alpha+\beta=0\\&lt;br /&gt;
\alpha\phi+\beta\hat{\phi}= -1.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
Solving this we have that &amp;lt;math&amp;gt;\alpha=\frac{1}{\sqrt{5}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta=-\frac{1}{\sqrt{5}}&amp;lt;/math&amp;gt;. And&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\frac{x}{1-x-x^2}=\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\phi x}-\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\hat{\phi} x}&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the expression &amp;lt;math&amp;gt;\frac{1}{1-z}&amp;lt;/math&amp;gt; has a well known expansion:&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{1}{1-z}=\sum_{n\ge 0}z^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; can be expanded as&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
G(x)&lt;br /&gt;
&amp;amp;=\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\phi x}-\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\hat{\phi} x}\\&lt;br /&gt;
&amp;amp;=\frac{1}{\sqrt{5}}\sum_{n\ge 0}(\phi x)^n-\frac{1}{\sqrt{5}}\sum_{n\ge 0}(\hat{\phi} x)^n\\&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)x^n.&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
So the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;th Fibonacci number is given by &lt;br /&gt;
:&amp;lt;math&amp;gt;F_n=\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)=\frac{1}{\sqrt{5}}\left(\frac{1+\sqrt{5}}{2}\right)^n-\frac{1}{\sqrt{5}}\left(\frac{1-\sqrt{5}}{2}\right)^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Solving recurrences ===&lt;br /&gt;
In the above analysis of Fibonacci numbers, we apply the following general methodology of solving recurrences by generating functions.&lt;br /&gt;
:1. Give a recursion that computes &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt;; that is, an equation expressing &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; in terms of other elements of the sequence, such as&lt;br /&gt;
::&amp;lt;math&amp;gt;a_n=f(a_0,a_1,\ldots,a_{n-1})&amp;lt;/math&amp;gt;  for some function &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt;.&lt;br /&gt;
:2. Multiply both sides of the equation by &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; and sum over all &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. This gives the generating function&lt;br /&gt;
::&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}a_nx^n=\sum_{n\ge 0}f(a_0,a_1,\ldots,a_{n-1})x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
:: And manipulate the right hand side of the equation so that it becomes some other expression involving &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;.&lt;br /&gt;
:3. Solve the resulting equation to derive an explicit formula for &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;.&lt;br /&gt;
:4. Expand &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; into a power series and read off the coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt;, which is a closed form for &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Algebraic operations on generating functions ====&lt;br /&gt;
The second step in the above methodology is somehow tricky. It involves first applying the recurrence to the coefficients of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;, which is easy; and then manipulating the resulting formal power series to express it in terms of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;, which is more difficult (because it works backwards).&lt;br /&gt;
&lt;br /&gt;
We can apply several natural algebraic operations on the formal power series.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Generating function manipulation|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}g_nx^n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F(x)=\sum_{n\ge 0}f_nx^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
x^k G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge k}g_{n-k}x^n, &amp;amp;\qquad (\mbox{integer }k\ge 0)\\&lt;br /&gt;
\frac{G(x)-\sum_{i=0}^{k-1}g_iz^i}{x^k}&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}g_{n+k}x^n, &amp;amp;\qquad (\mbox{integer }k\ge 0)\\&lt;br /&gt;
\alpha F(x)+\beta G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0} (\alpha f_n+\beta g_n)x^n\\&lt;br /&gt;
F(x)G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0}\sum_{k=0}^nf_kg_{n-k}x^n\\&lt;br /&gt;
G(cx)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0} c^ng_n x^n\\&lt;br /&gt;
G&#039;(x)&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{n\ge 0}(n+1)g_{n+1}x^n\\&lt;br /&gt;
\frac{G(x)}{1-x}&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}\left(\sum_{k=0}^ng_k\right)x^n&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
When manipulating generating functions, these rules are applied backwards; that is, from the right-hand-side to the left-hand-side.&lt;br /&gt;
&lt;br /&gt;
==== Expanding generating functions ====&lt;br /&gt;
The last step of solving recurrences by generating function is expanding the closed form generating function &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; to evaluate its &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th coefficient. In principle, we can always use the [http://en.wikipedia.org/wiki/Taylor_series Taylor series]&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}\frac{G^{(n)}(0)}{n!}x^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;G^{(n)}(0)&amp;lt;/math&amp;gt; is the value of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th derivative of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; evaluated at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Some interesting special cases are very useful.&lt;br /&gt;
&lt;br /&gt;
;Geometric sequence&lt;br /&gt;
In the example of Fibonacci numbers, we use the well known geometric series:&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{1}{1-x}=\sum_{n\ge 0}x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
It is useful when we can express the generating function in the form of &amp;lt;math&amp;gt;G(x)=\frac{a_1}{1-b_1x}+\frac{a_2}{1-b_2x}+\cdots+\frac{a_k}{1-b_kx}&amp;lt;/math&amp;gt;. The coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; in such &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;a_1b_1^n+a_2b_2^n+\cdots+a_kb_k^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
;Binomial theorem&lt;br /&gt;
The &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th derivative of &amp;lt;math&amp;gt;(1+x)^\alpha&amp;lt;/math&amp;gt; for some real &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; is &lt;br /&gt;
:&amp;lt;math&amp;gt;\alpha(\alpha-1)(\alpha-2)\cdots(\alpha-n+1)(1+x)^{\alpha-n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
By Taylor series, we get a generalized version of the binomial theorem known as [http://en.wikipedia.org/wiki/Binomial_coefficient#Newton.27s_binomial_series &#039;&#039;&#039;Newton&#039;s formula&#039;&#039;&#039;]:&lt;br /&gt;
:&amp;lt;math&amp;gt;(1+x)^\alpha=\sum_{n\ge 0}{\alpha\choose n}x^{n}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;{\alpha\choose n}&amp;lt;/math&amp;gt; is the &#039;&#039;&#039;generalized binomial coefficient&#039;&#039;&#039; defined by &lt;br /&gt;
:&amp;lt;math&amp;gt;{\alpha\choose n}=\frac{\alpha(\alpha-1)(\alpha-2)\cdots(\alpha-n+1)}{n!}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the last lecture we gave a combinatorial proof of the number of &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-multisets on an &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-set. Now we give a generating function approach to the problem.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S=\{x_1,x_2,\ldots,x_n\}&amp;lt;/math&amp;gt; be an &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-element set. We have&lt;br /&gt;
:&amp;lt;math&amp;gt;(1+x_1+x_1^2+\cdots)(1+x_2+x_2^2+\cdots)\cdots(1+x_n+x_n^2+\cdots)=\sum_{m:S\rightarrow\mathbb{N}} \prod_{x_i\in S}x_i^{m(x_i)}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where each &amp;lt;math&amp;gt;m:S\rightarrow\mathbb{N}&amp;lt;/math&amp;gt; species a possible multiset on &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; with multiplicity function &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let all &amp;lt;math&amp;gt;x_i=x&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
(1+x+x^2+\cdots)^n&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{m:S\rightarrow\mathbb{N}}x^{m(x_1)+\cdots+m(x_n)}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{\text{multiset }M\text{ on }S}x^{|M|}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{k\ge 0}\left({n\choose k}\right)x^k.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The last equation is due to the the definition of &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt;. Our task is to evaluate &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Due to the geometric sequence and the Newton&#039;s formula&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(1+x+x^2+\cdots)^n=(1-x)^{-n}=\sum_{k\ge 0}{-n\choose k}(-x)^k.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
So&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\left({n\choose k}\right)=(-1)^k{-n\choose k}={n+k-1\choose k}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The last equation is due to the definition of the generalized binomial coefficient. We use an analytic (generating function) proof to get the same result of &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt; as the combinatorial proof.&lt;br /&gt;
&lt;br /&gt;
=== Linear recurrences ===&lt;br /&gt;
&lt;br /&gt;
== Catalan Number ==&lt;br /&gt;
&lt;br /&gt;
== Partitions ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Generating_functions&amp;diff=3111</id>
		<title>Combinatorics (Fall 2010)/Generating functions</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Generating_functions&amp;diff=3111"/>
		<updated>2010-07-14T03:11:42Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Expanding generating functions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Stirling&#039;s Approximation ==&lt;br /&gt;
As we have seen, answers to many counting problems are expressed in terms of factorials. It is important for us to know roughly how large &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt; is, i.e. the asymptotic order of &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt;. This is done by the famous [http://en.wikipedia.org/wiki/Stirling&#039;s_approximation &#039;&#039;&#039;Stirling&#039;s approximation&#039;&#039;&#039;], also called &#039;&#039;&#039;Stirling&#039;s formula&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Theorem (Stirling&#039;s approximation)|&lt;br /&gt;
:&amp;lt;math&amp;gt;n!\sim \sqrt{2\pi n}\left(\frac{n}{e}\right)^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
The symbol &amp;lt;math&amp;gt;\sim\,&amp;lt;/math&amp;gt; means that &amp;lt;math&amp;gt;\lim_{n\rightarrow\infty}\frac{n!}{\sqrt{2\pi n}\left(\frac{n}{e}\right)^n}=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The proof of the Stirling&#039;s approximation is complicated. We will prove the following easier proposition.&lt;br /&gt;
{{Theorem|Proposition|&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln (n!)=n\ln n-n+O(\ln n)\,&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|&lt;br /&gt;
The logarithm of &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\ln (n!)=\sum_{k=1}^n\ln k&amp;lt;/math&amp;gt;. &lt;br /&gt;
Since &amp;lt;math&amp;gt;f(x)=\ln x&amp;lt;/math&amp;gt; is an increasing function of &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; for all positive &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, we have &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\ln (n!)=\sum_{k=1}^n\ln k \le \int_2^{n+1}\ln x\, \mathrm{d}x  =(n+1)\ln(n+1)-(n+1)-2\ln 2+2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Note that&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln(n+1)-\ln n=\int_{n}^{n+1}\frac{1}{x}\,\mathrm{d}x&amp;lt;\frac{1}{n},&amp;lt;/math&amp;gt;&lt;br /&gt;
thus &amp;lt;math&amp;gt;n\ln (n+1)&amp;lt;n\ln n+1&amp;lt;/math&amp;gt;. Combining this with the above upper bound,&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln (n!)\le n\ln n-n+O(\ln n).&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The full proof of Stirling&#039;s approximation involves a more precise estimation of the constant factor in &amp;lt;math&amp;gt;O(\ln n)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Binomial coefficient ===&lt;br /&gt;
For binomial coefficient, we can approximate it by the Stirling&#039;s approximation of factorial, but we also have an easier (but loose) estimation.&lt;br /&gt;
{{Theorem|Proposition|&lt;br /&gt;
:&amp;lt;math&amp;gt;\left(\frac{n}{k}\right)^k\le {n\choose k} &amp;lt; \left(\frac{\mathrm{e}n}{k}\right)^k&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|&lt;br /&gt;
The lower bound is easy:&lt;br /&gt;
:&amp;lt;math&amp;gt;{n\choose k}=\frac{n}{k}\cdot\frac{n-1}{k-1}\cdots\frac{n-k+1}{1}\ge\frac{n}{k}\cdot\frac{n}{k}\cdots\frac{n}{k}=\left(\frac{n}{k}\right)^k&amp;lt;/math&amp;gt;.&lt;br /&gt;
For the upper bound, &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{e}^{nx}&amp;gt;(1+x)^n=\sum_{i=1}^n{n\choose i}x^i&amp;gt;{n\choose k}x^k,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
for any &amp;lt;math&amp;gt;0\le k\le n&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Setting &amp;lt;math&amp;gt;x=\frac{k}{n}&amp;lt;/math&amp;gt;, we have&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{e}^k&amp;gt;{n\choose k}\left(\frac{k}{n}\right)^k.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;{n\choose k} &amp;lt; \left(\frac{\mathrm{e}n}{k}\right)^k&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Generating Functions ==&lt;br /&gt;
In Stanley&#039;s magnificent book &#039;&#039;Enumerative Combinatorics&#039;&#039;, he comments the generating function as &amp;quot;the most useful but most difficult to understand method (for counting)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution to a counting problem is usually represented as some &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; depending a parameter &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. Sometimes this &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; is called a &#039;&#039;counting function&#039;&#039; as it is a function of the parameter &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.  &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; can also be treated as a infinite series:&lt;br /&gt;
:&amp;lt;math&amp;gt;a_0,a_1,a_2,\ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ordinary generating function (OGF)&#039;&#039;&#039; defined by &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
G(x)=\sum_{n\ge 0} a_nx^n.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;G(x)=a_0+a_1x+a_2x^2+\cdots&amp;lt;/math&amp;gt;. An expression in this form is called a [http://en.wikipedia.org/wiki/Formal_power_series &#039;&#039;&#039;formal power series&#039;&#039;&#039;], and &amp;lt;math&amp;gt;a_0,a_1,a_2,\ldots&amp;lt;/math&amp;gt; is the sequence of &#039;&#039;&#039;coefficients&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the generating function can be expanded as&lt;br /&gt;
:G(x)=&amp;lt;math&amp;gt;(\underbrace{1+\cdots+1}_{a_0})+(\underbrace{x+\cdots+x}_{a_1})+(\underbrace{x^2+\cdots+x^2}_{a_2})+\cdots+(\underbrace{x^n+\cdots+x^n}_{a_n})+\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
so it indeed &amp;quot;generates&amp;quot; all the possible instances of the objects we want to count.&lt;br /&gt;
&lt;br /&gt;
Usually, we do not evaluate the generating function &amp;lt;math&amp;gt;GF(x)&amp;lt;/math&amp;gt; on any particular value. &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; remains as a &#039;&#039;&#039;formal variable&#039;&#039;&#039; without assuming any value. The numbers that we want to count are the coefficients carried by the terms in the formal power series. So far the generating function is just another way to represent the sequence&lt;br /&gt;
:&amp;lt;math&amp;gt;(a_0,a_1,a_2,\ldots\ldots)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The true power of generating functions comes from the various algebraic operations that we can perform on these generating functions. We use an example to demonstrate this.&lt;br /&gt;
&lt;br /&gt;
=== Fibonacci numbers  ===&lt;br /&gt;
Consider the following counting problems.&lt;br /&gt;
* Count the number of ways that the nonnegative integer &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; can be written as a sum of ones and twos (in order).&lt;br /&gt;
: The problem asks for the number of compositions of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; with summands from &amp;lt;math&amp;gt;\{1,2\}&amp;lt;/math&amp;gt;. Formally, we are counting the number of tuples &amp;lt;math&amp;gt;(x_1,x_2,\ldots,x_k)&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;k\le n&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;x_i\in\{1,2\}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sum_{i=1}^k x_i=n&amp;lt;/math&amp;gt;.&lt;br /&gt;
: Let &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; be the solution. We observe that a composition either starts with a 1, in which case the rest is a composition of &amp;lt;math&amp;gt;n-1&amp;lt;/math&amp;gt;; or starts with a 2, in which case the rest is a composition of &amp;lt;math&amp;gt;n-2&amp;lt;/math&amp;gt;. So we have the recursion for &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; that&lt;br /&gt;
::&amp;lt;math&amp;gt;F_n=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Count the ways to completely cover a &amp;lt;math&amp;gt;2\times n&amp;lt;/math&amp;gt; rectangle with &amp;lt;math&amp;gt;2\times 1&amp;lt;/math&amp;gt; dominos without any overlaps.&lt;br /&gt;
: Dominos are identical &amp;lt;math&amp;gt;2\times 1&amp;lt;/math&amp;gt; rectangles, so that only their orientations --- vertical or horizontal matter.&lt;br /&gt;
: Let &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; be the solution. It also holds that &amp;lt;math&amp;gt;F_n=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt;. The proof is left as an exercise.&lt;br /&gt;
&lt;br /&gt;
In both problems, the solution is given by &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; which satisfies the following recursion.&lt;br /&gt;
:&amp;lt;math&amp;gt;F_n=\begin{cases}&lt;br /&gt;
0 &amp;amp; \mbox{if }n=0\\&lt;br /&gt;
1 &amp;amp; \mbox{if }n=1\\&lt;br /&gt;
F_{n-1}+F_{n-2} &amp;amp; \mbox{if}n\ge 2.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; is called the [http://en.wikipedia.org/wiki/Fibonacci_number Fibonacci number].&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Theorem|&lt;br /&gt;
::&amp;lt;math&amp;gt;F_n=\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)&amp;lt;/math&amp;gt;,&lt;br /&gt;
:where &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
The quantity &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; is the so-called [http://en.wikipedia.org/wiki/Golden_ratio golden ratio], a constant with some significance in mathematics and aesthetics.&lt;br /&gt;
&lt;br /&gt;
We now prove this theorem by using generating functions.&lt;br /&gt;
&lt;br /&gt;
The ordinary generating function for the Fibonacci number &amp;lt;math&amp;gt;F_{n}&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}F_n x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
We have that &amp;lt;math&amp;gt;F_{n}=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;n\ge 2&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
G(x) &lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{n\ge 0}F_n x^n&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
x+\sum_{n\ge 2}(F_{n-1}+F_{n-2})x^n.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
For generating functions, there are general ways to generate &amp;lt;math&amp;gt;F_{n-1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F_{n-2}&amp;lt;/math&amp;gt;, or the coefficients with any smaller indices.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
xG(x)&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}F_n x^{n+1}=\sum_{n\ge 1}F_{n-1} x^n=\sum_{n\ge 2}F_{n-1} x^n\\&lt;br /&gt;
x^2G(x)&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}F_n x^{n+2}=\sum_{n\ge 2}F_{n-2} x^n.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
So we have&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=x+(x+x^2)G(x)\,&amp;lt;/math&amp;gt;,&lt;br /&gt;
hence&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\frac{x}{1-x-x^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
The value of &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; is the coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; in the Taylor series for this formular, which is &amp;lt;math&amp;gt;\frac{G^{(n)}(0)}{n!}=\frac{1}{\sqrt{5}}\left(\frac{1+\sqrt{5}}{2}\right)^n-\frac{1}{\sqrt{5}}\left(\frac{1-\sqrt{5}}{2}\right)^n&amp;lt;/math&amp;gt;. Although this expansion works in principle, the detailed calculus is rather painful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
There is an easier way to get this coefficient than directly expanding the Taylor series. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1-x-x^2&amp;lt;/math&amp;gt; has two roots &amp;lt;math&amp;gt;\frac{-1\pm\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Denote that &amp;lt;math&amp;gt;\phi=\frac{2}{-1+\sqrt{5}}=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{2}{-1-\sqrt{5}}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;. Then &amp;lt;math&amp;gt;(1-x-x^2)=(1-\phi x)(1-\hat{\phi}x)&amp;lt;/math&amp;gt;, so we can write &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{x}{1-x-x^2}&lt;br /&gt;
&amp;amp;=\frac{x}{(1-\phi x)(1-\hat{\phi} x)}\\&lt;br /&gt;
&amp;amp;=\frac{\alpha}{(1-\phi x)}+\frac{\beta}{(1-\hat{\phi} x)},&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; satisfying that&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{cases}&lt;br /&gt;
\alpha+\beta=0\\&lt;br /&gt;
\alpha\phi+\beta\hat{\phi}= -1.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
Solving this we have that &amp;lt;math&amp;gt;\alpha=\frac{1}{\sqrt{5}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta=-\frac{1}{\sqrt{5}}&amp;lt;/math&amp;gt;. And&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\frac{x}{1-x-x^2}=\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\phi x}-\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\hat{\phi} x}&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the expression &amp;lt;math&amp;gt;\frac{1}{1-z}&amp;lt;/math&amp;gt; has a well known expansion:&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{1}{1-z}=\sum_{n\ge 0}z^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; can be expanded as&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
G(x)&lt;br /&gt;
&amp;amp;=\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\phi x}-\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\hat{\phi} x}\\&lt;br /&gt;
&amp;amp;=\frac{1}{\sqrt{5}}\sum_{n\ge 0}(\phi x)^n-\frac{1}{\sqrt{5}}\sum_{n\ge 0}(\hat{\phi} x)^n\\&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)x^n.&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
So the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;th Fibonacci number is given by &lt;br /&gt;
:&amp;lt;math&amp;gt;F_n=\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)=\frac{1}{\sqrt{5}}\left(\frac{1+\sqrt{5}}{2}\right)^n-\frac{1}{\sqrt{5}}\left(\frac{1-\sqrt{5}}{2}\right)^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Solving recurrences ===&lt;br /&gt;
In the above analysis of Fibonacci numbers, we apply the following general methodology of solving recurrences by generating functions.&lt;br /&gt;
:1. Give a recursion that computes &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt;; that is, an equation expressing &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; in terms of other elements of the sequence, such as&lt;br /&gt;
::&amp;lt;math&amp;gt;a_n=f(a_0,a_1,\ldots,a_{n-1})&amp;lt;/math&amp;gt;  for some function &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt;.&lt;br /&gt;
:2. Multiply both sides of the equation by &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; and sum over all &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. This gives the generating function&lt;br /&gt;
::&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}a_nx^n=\sum_{n\ge 0}f(a_0,a_1,\ldots,a_{n-1})x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
:: And manipulate the right hand side of the equation so that it becomes some other expression involving &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;.&lt;br /&gt;
:3. Solve the resulting equation to derive an explicit formula for &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;.&lt;br /&gt;
:4. Expand &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; into a power series and read off the coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt;, which is a closed form for &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Algebraic operations on generating functions ====&lt;br /&gt;
The second step in the above methodology is somehow tricky. It involves first applying the recurrence to the coefficients of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;, which is easy; and then manipulating the resulting formal power series to express it in terms of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;, which is more difficult (because it works backwards).&lt;br /&gt;
&lt;br /&gt;
We can apply several natural algebraic operations on the formal power series.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Generating function manipulation|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}g_nx^n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F(x)=\sum_{n\ge 0}f_nx^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
x^k G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge k}g_{n-k}x^n, &amp;amp;\qquad (\mbox{integer }k\ge 0)\\&lt;br /&gt;
\frac{G(x)-\sum_{i=0}^{k-1}g_iz^i}{x^k}&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}g_{n+k}x^n, &amp;amp;\qquad (\mbox{integer }k\ge 0)\\&lt;br /&gt;
\alpha F(x)+\beta G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0} (\alpha f_n+\beta g_n)x^n\\&lt;br /&gt;
F(x)G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0}\sum_{k=0}^nf_kg_{n-k}x^n\\&lt;br /&gt;
G(cx)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0} c^ng_n x^n\\&lt;br /&gt;
G&#039;(x)&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{n\ge 0}(n+1)g_{n+1}x^n\\&lt;br /&gt;
\frac{G(x)}{1-x}&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}\left(\sum_{k=0}^ng_k\right)x^n&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
When manipulating generating functions, these rules are applied backwards; that is, from the right-hand-side to the left-hand-side.&lt;br /&gt;
&lt;br /&gt;
==== Expanding generating functions ====&lt;br /&gt;
The last step of solving recurrences by generating function is expanding the closed form generating function &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; to evaluate its &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th coefficient. In principle, we can always use the [http://en.wikipedia.org/wiki/Taylor_series Taylor series]&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}\frac{G^{(n)}(0)}{n!}x^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;G^{(n)}(0)&amp;lt;/math&amp;gt; is the value of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th derivative of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; evaluated at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Some interesting special cases are very useful.&lt;br /&gt;
&lt;br /&gt;
;Geometric sequence&lt;br /&gt;
In the example of Fibonacci numbers, we use the well known geometric series:&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{1}{1-x}=\sum_{n\ge 0}x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
It is useful when we can express the generating function in the form of &amp;lt;math&amp;gt;G(x)=\frac{a_1}{1-b_1x}+\frac{a_2}{1-b_2x}+\cdots+\frac{a_k}{1-b_kx}&amp;lt;/math&amp;gt;. The coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; in such &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;a_1b_1^n+a_2b_2^n+\cdots+a_kb_k^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
;Binomial theorem&lt;br /&gt;
The &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th derivative of &amp;lt;math&amp;gt;(1+x)^\alpha&amp;lt;/math&amp;gt; for some real &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; is &lt;br /&gt;
:&amp;lt;math&amp;gt;\alpha(\alpha-1)(\alpha-2)\cdots(\alpha-n+1)(1+x)^{\alpha-n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
By Taylor series, we get a generalized version of the binomial theorem known as [http://en.wikipedia.org/wiki/Binomial_coefficient#Newton.27s_binomial_series &#039;&#039;&#039;Newton&#039;s formula&#039;&#039;&#039;]:&lt;br /&gt;
:&amp;lt;math&amp;gt;(1+x)^\alpha=\sum_{n\ge 0}{\alpha\choose n}x^{n}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;{\alpha\choose n}&amp;lt;/math&amp;gt; is the &#039;&#039;&#039;generalized binomial coefficient&#039;&#039;&#039; defined by &lt;br /&gt;
:&amp;lt;math&amp;gt;{\alpha\choose n}=\frac{\alpha(\alpha-1)(\alpha-2)\cdots(\alpha-n+1)}{n!}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the last lecture we gave a combinatorial proof of the number of &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-multisets on an &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-set. Now we give a generating function approach to the problem.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S=\{x_1,x_2,\ldots,x_n\}&amp;lt;/math&amp;gt; be an &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-element set. We have&lt;br /&gt;
:&amp;lt;math&amp;gt;(1+x_1+x_1^2+\cdots)(1+x_2+x_2^2+\cdots)\cdots(1+x_n+x_n^2+\cdots)=\sum_{m:S\rightarrow\mathbb{N}} \prod_{x_i\in S}x_i^{m(x_i)}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where each &amp;lt;math&amp;gt;m:S\rightarrow\mathbb{N}&amp;lt;/math&amp;gt; species a possible multiset on &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; with multiplicity function &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let all &amp;lt;math&amp;gt;x_i=x&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
(1+x+x^2+\cdots)^n&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{m:S\rightarrow\mathbb{N}}x^{m(x_1)+\cdots+m(x_n)}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{\text{multiset }M\text{ on }S}x^{|M|}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{k\ge 0}\left({n\choose k}\right)x^k.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The last equation is due to the the definition of &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt;. Our task is to evaluate &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Due to the geometric sequence and the Newton&#039;s formula&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(1+x+x^2+\cdots)^n=(1-x)^{-n}=\sum_{k\ge 0}{-n\choose k}(-x)^k.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
So&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\left({n\choose k}\right)=(-1)^k{-n\choose k}={n+k-1\choose k}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The last equation is due to the definition of the generalized binomial coefficient. We use an analytic (generating function) proof to get the same result of &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt; as the combinatorial proof.&lt;br /&gt;
&lt;br /&gt;
== Catalan Number ==&lt;br /&gt;
&lt;br /&gt;
== Partitions ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Generating_functions&amp;diff=3110</id>
		<title>Combinatorics (Fall 2010)/Generating functions</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Generating_functions&amp;diff=3110"/>
		<updated>2010-07-14T02:34:49Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Binomial coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Stirling&#039;s Approximation ==&lt;br /&gt;
As we have seen, answers to many counting problems are expressed in terms of factorials. It is important for us to know roughly how large &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt; is, i.e. the asymptotic order of &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt;. This is done by the famous [http://en.wikipedia.org/wiki/Stirling&#039;s_approximation &#039;&#039;&#039;Stirling&#039;s approximation&#039;&#039;&#039;], also called &#039;&#039;&#039;Stirling&#039;s formula&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Theorem (Stirling&#039;s approximation)|&lt;br /&gt;
:&amp;lt;math&amp;gt;n!\sim \sqrt{2\pi n}\left(\frac{n}{e}\right)^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
The symbol &amp;lt;math&amp;gt;\sim\,&amp;lt;/math&amp;gt; means that &amp;lt;math&amp;gt;\lim_{n\rightarrow\infty}\frac{n!}{\sqrt{2\pi n}\left(\frac{n}{e}\right)^n}=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The proof of the Stirling&#039;s approximation is complicated. We will prove the following easier proposition.&lt;br /&gt;
{{Theorem|Proposition|&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln (n!)=n\ln n-n+O(\ln n)\,&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|&lt;br /&gt;
The logarithm of &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\ln (n!)=\sum_{k=1}^n\ln k&amp;lt;/math&amp;gt;. &lt;br /&gt;
Since &amp;lt;math&amp;gt;f(x)=\ln x&amp;lt;/math&amp;gt; is an increasing function of &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; for all positive &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, we have &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\ln (n!)=\sum_{k=1}^n\ln k \le \int_2^{n+1}\ln x\, \mathrm{d}x  =(n+1)\ln(n+1)-(n+1)-2\ln 2+2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Note that&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln(n+1)-\ln n=\int_{n}^{n+1}\frac{1}{x}\,\mathrm{d}x&amp;lt;\frac{1}{n},&amp;lt;/math&amp;gt;&lt;br /&gt;
thus &amp;lt;math&amp;gt;n\ln (n+1)&amp;lt;n\ln n+1&amp;lt;/math&amp;gt;. Combining this with the above upper bound,&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln (n!)\le n\ln n-n+O(\ln n).&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The full proof of Stirling&#039;s approximation involves a more precise estimation of the constant factor in &amp;lt;math&amp;gt;O(\ln n)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Binomial coefficient ===&lt;br /&gt;
For binomial coefficient, we can approximate it by the Stirling&#039;s approximation of factorial, but we also have an easier (but loose) estimation.&lt;br /&gt;
{{Theorem|Proposition|&lt;br /&gt;
:&amp;lt;math&amp;gt;\left(\frac{n}{k}\right)^k\le {n\choose k} &amp;lt; \left(\frac{\mathrm{e}n}{k}\right)^k&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|&lt;br /&gt;
The lower bound is easy:&lt;br /&gt;
:&amp;lt;math&amp;gt;{n\choose k}=\frac{n}{k}\cdot\frac{n-1}{k-1}\cdots\frac{n-k+1}{1}\ge\frac{n}{k}\cdot\frac{n}{k}\cdots\frac{n}{k}=\left(\frac{n}{k}\right)^k&amp;lt;/math&amp;gt;.&lt;br /&gt;
For the upper bound, &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{e}^{nx}&amp;gt;(1+x)^n=\sum_{i=1}^n{n\choose i}x^i&amp;gt;{n\choose k}x^k,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
for any &amp;lt;math&amp;gt;0\le k\le n&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Setting &amp;lt;math&amp;gt;x=\frac{k}{n}&amp;lt;/math&amp;gt;, we have&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{e}^k&amp;gt;{n\choose k}\left(\frac{k}{n}\right)^k.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;{n\choose k} &amp;lt; \left(\frac{\mathrm{e}n}{k}\right)^k&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Generating Functions ==&lt;br /&gt;
In Stanley&#039;s magnificent book &#039;&#039;Enumerative Combinatorics&#039;&#039;, he comments the generating function as &amp;quot;the most useful but most difficult to understand method (for counting)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution to a counting problem is usually represented as some &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; depending a parameter &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. Sometimes this &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; is called a &#039;&#039;counting function&#039;&#039; as it is a function of the parameter &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.  &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; can also be treated as a infinite series:&lt;br /&gt;
:&amp;lt;math&amp;gt;a_0,a_1,a_2,\ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ordinary generating function (OGF)&#039;&#039;&#039; defined by &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
G(x)=\sum_{n\ge 0} a_nx^n.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;G(x)=a_0+a_1x+a_2x^2+\cdots&amp;lt;/math&amp;gt;. An expression in this form is called a [http://en.wikipedia.org/wiki/Formal_power_series &#039;&#039;&#039;formal power series&#039;&#039;&#039;], and &amp;lt;math&amp;gt;a_0,a_1,a_2,\ldots&amp;lt;/math&amp;gt; is the sequence of &#039;&#039;&#039;coefficients&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the generating function can be expanded as&lt;br /&gt;
:G(x)=&amp;lt;math&amp;gt;(\underbrace{1+\cdots+1}_{a_0})+(\underbrace{x+\cdots+x}_{a_1})+(\underbrace{x^2+\cdots+x^2}_{a_2})+\cdots+(\underbrace{x^n+\cdots+x^n}_{a_n})+\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
so it indeed &amp;quot;generates&amp;quot; all the possible instances of the objects we want to count.&lt;br /&gt;
&lt;br /&gt;
Usually, we do not evaluate the generating function &amp;lt;math&amp;gt;GF(x)&amp;lt;/math&amp;gt; on any particular value. &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; remains as a &#039;&#039;&#039;formal variable&#039;&#039;&#039; without assuming any value. The numbers that we want to count are the coefficients carried by the terms in the formal power series. So far the generating function is just another way to represent the sequence&lt;br /&gt;
:&amp;lt;math&amp;gt;(a_0,a_1,a_2,\ldots\ldots)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The true power of generating functions comes from the various algebraic operations that we can perform on these generating functions. We use an example to demonstrate this.&lt;br /&gt;
&lt;br /&gt;
=== Fibonacci numbers  ===&lt;br /&gt;
Consider the following counting problems.&lt;br /&gt;
* Count the number of ways that the nonnegative integer &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; can be written as a sum of ones and twos (in order).&lt;br /&gt;
: The problem asks for the number of compositions of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; with summands from &amp;lt;math&amp;gt;\{1,2\}&amp;lt;/math&amp;gt;. Formally, we are counting the number of tuples &amp;lt;math&amp;gt;(x_1,x_2,\ldots,x_k)&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;k\le n&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;x_i\in\{1,2\}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sum_{i=1}^k x_i=n&amp;lt;/math&amp;gt;.&lt;br /&gt;
: Let &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; be the solution. We observe that a composition either starts with a 1, in which case the rest is a composition of &amp;lt;math&amp;gt;n-1&amp;lt;/math&amp;gt;; or starts with a 2, in which case the rest is a composition of &amp;lt;math&amp;gt;n-2&amp;lt;/math&amp;gt;. So we have the recursion for &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; that&lt;br /&gt;
::&amp;lt;math&amp;gt;F_n=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Count the ways to completely cover a &amp;lt;math&amp;gt;2\times n&amp;lt;/math&amp;gt; rectangle with &amp;lt;math&amp;gt;2\times 1&amp;lt;/math&amp;gt; dominos without any overlaps.&lt;br /&gt;
: Dominos are identical &amp;lt;math&amp;gt;2\times 1&amp;lt;/math&amp;gt; rectangles, so that only their orientations --- vertical or horizontal matter.&lt;br /&gt;
: Let &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; be the solution. It also holds that &amp;lt;math&amp;gt;F_n=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt;. The proof is left as an exercise.&lt;br /&gt;
&lt;br /&gt;
In both problems, the solution is given by &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; which satisfies the following recursion.&lt;br /&gt;
:&amp;lt;math&amp;gt;F_n=\begin{cases}&lt;br /&gt;
0 &amp;amp; \mbox{if }n=0\\&lt;br /&gt;
1 &amp;amp; \mbox{if }n=1\\&lt;br /&gt;
F_{n-1}+F_{n-2} &amp;amp; \mbox{if}n\ge 2.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; is called the [http://en.wikipedia.org/wiki/Fibonacci_number Fibonacci number].&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Theorem|&lt;br /&gt;
::&amp;lt;math&amp;gt;F_n=\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)&amp;lt;/math&amp;gt;,&lt;br /&gt;
:where &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
The quantity &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; is the so-called [http://en.wikipedia.org/wiki/Golden_ratio golden ratio], a constant with some significance in mathematics and aesthetics.&lt;br /&gt;
&lt;br /&gt;
We now prove this theorem by using generating functions.&lt;br /&gt;
&lt;br /&gt;
The ordinary generating function for the Fibonacci number &amp;lt;math&amp;gt;F_{n}&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}F_n x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
We have that &amp;lt;math&amp;gt;F_{n}=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;n\ge 2&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
G(x) &lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{n\ge 0}F_n x^n&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
x+\sum_{n\ge 2}(F_{n-1}+F_{n-2})x^n.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
For generating functions, there are general ways to generate &amp;lt;math&amp;gt;F_{n-1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F_{n-2}&amp;lt;/math&amp;gt;, or the coefficients with any smaller indices.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
xG(x)&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}F_n x^{n+1}=\sum_{n\ge 1}F_{n-1} x^n=\sum_{n\ge 2}F_{n-1} x^n\\&lt;br /&gt;
x^2G(x)&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}F_n x^{n+2}=\sum_{n\ge 2}F_{n-2} x^n.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
So we have&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=x+(x+x^2)G(x)\,&amp;lt;/math&amp;gt;,&lt;br /&gt;
hence&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\frac{x}{1-x-x^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
The value of &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; is the coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; in the Taylor series for this formular, which is &amp;lt;math&amp;gt;\frac{G^{(n)}(0)}{n!}=\frac{1}{\sqrt{5}}\left(\frac{1+\sqrt{5}}{2}\right)^n-\frac{1}{\sqrt{5}}\left(\frac{1-\sqrt{5}}{2}\right)^n&amp;lt;/math&amp;gt;. Although this expansion works in principle, the detailed calculus is rather painful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
There is an easier way to get this coefficient than directly expanding the Taylor series. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1-x-x^2&amp;lt;/math&amp;gt; has two roots &amp;lt;math&amp;gt;\frac{-1\pm\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Denote that &amp;lt;math&amp;gt;\phi=\frac{2}{-1+\sqrt{5}}=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{2}{-1-\sqrt{5}}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;. Then &amp;lt;math&amp;gt;(1-x-x^2)=(1-\phi x)(1-\hat{\phi}x)&amp;lt;/math&amp;gt;, so we can write &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{x}{1-x-x^2}&lt;br /&gt;
&amp;amp;=\frac{x}{(1-\phi x)(1-\hat{\phi} x)}\\&lt;br /&gt;
&amp;amp;=\frac{\alpha}{(1-\phi x)}+\frac{\beta}{(1-\hat{\phi} x)},&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; satisfying that&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{cases}&lt;br /&gt;
\alpha+\beta=0\\&lt;br /&gt;
\alpha\phi+\beta\hat{\phi}= -1.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
Solving this we have that &amp;lt;math&amp;gt;\alpha=\frac{1}{\sqrt{5}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta=-\frac{1}{\sqrt{5}}&amp;lt;/math&amp;gt;. And&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\frac{x}{1-x-x^2}=\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\phi x}-\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\hat{\phi} x}&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the expression &amp;lt;math&amp;gt;\frac{1}{1-z}&amp;lt;/math&amp;gt; has a well known expansion:&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{1}{1-z}=\sum_{n\ge 0}z^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; can be expanded as&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
G(x)&lt;br /&gt;
&amp;amp;=\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\phi x}-\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\hat{\phi} x}\\&lt;br /&gt;
&amp;amp;=\frac{1}{\sqrt{5}}\sum_{n\ge 0}(\phi x)^n-\frac{1}{\sqrt{5}}\sum_{n\ge 0}(\hat{\phi} x)^n\\&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)x^n.&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
So the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;th Fibonacci number is given by &lt;br /&gt;
:&amp;lt;math&amp;gt;F_n=\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)=\frac{1}{\sqrt{5}}\left(\frac{1+\sqrt{5}}{2}\right)^n-\frac{1}{\sqrt{5}}\left(\frac{1-\sqrt{5}}{2}\right)^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Solving recurrences ===&lt;br /&gt;
In the above analysis of Fibonacci numbers, we apply the following general methodology of solving recurrences by generating functions.&lt;br /&gt;
:1. Give a recursion that computes &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt;; that is, an equation expressing &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; in terms of other elements of the sequence, such as&lt;br /&gt;
::&amp;lt;math&amp;gt;a_n=f(a_0,a_1,\ldots,a_{n-1})&amp;lt;/math&amp;gt;  for some function &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt;.&lt;br /&gt;
:2. Multiply both sides of the equation by &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; and sum over all &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. This gives the generating function&lt;br /&gt;
::&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}a_nx^n=\sum_{n\ge 0}f(a_0,a_1,\ldots,a_{n-1})x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
:: And manipulate the right hand side of the equation so that it becomes some other expression involving &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;.&lt;br /&gt;
:3. Solve the resulting equation to derive an explicit formula for &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;.&lt;br /&gt;
:4. Expand &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; into a power series and read off the coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt;, which is a closed form for &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Algebraic operations on generating functions ====&lt;br /&gt;
The second step in the above methodology is somehow tricky. It involves first applying the recurrence to the coefficients of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;, which is easy; and then manipulating the resulting formal power series to express it in terms of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;, which is more difficult (because it works backwards).&lt;br /&gt;
&lt;br /&gt;
We can apply several natural algebraic operations on the formal power series.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Generating function manipulation|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}g_nx^n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F(x)=\sum_{n\ge 0}f_nx^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
x^k G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge k}g_{n-k}x^n, &amp;amp;\qquad (\mbox{integer }k\ge 0)\\&lt;br /&gt;
\frac{G(x)-\sum_{i=0}^{k-1}g_iz^i}{x^k}&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}g_{n+k}x^n, &amp;amp;\qquad (\mbox{integer }k\ge 0)\\&lt;br /&gt;
\alpha F(x)+\beta G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0} (\alpha f_n+\beta g_n)x^n\\&lt;br /&gt;
F(x)G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0}\sum_{k=0}^nf_kg_{n-k}x^n\\&lt;br /&gt;
G(cx)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0} c^ng_n x^n\\&lt;br /&gt;
G&#039;(x)&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{n\ge 0}(n+1)g_{n+1}x^n\\&lt;br /&gt;
\frac{G(x)}{1-x}&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}\left(\sum_{k=0}^ng_k\right)x^n&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
When manipulating generating functions, these rules are applied backwards; that is, from the right-hand-side to the left-hand-side.&lt;br /&gt;
&lt;br /&gt;
==== Expanding generating functions ====&lt;br /&gt;
The last step of solving recurrences by generating function is expanding the closed form generating function &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; to evaluate its &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th coefficient. In principle, we can always use the [http://en.wikipedia.org/wiki/Taylor_series Taylor series]&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}\frac{G^{(n)}(0)}{n!}x^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;G^{(n)}(0)&amp;lt;/math&amp;gt; is the value of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th derivative of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; evaluated at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Some interesting special cases are very useful.&lt;br /&gt;
&lt;br /&gt;
;Geometric sequence&lt;br /&gt;
In the example of Fibonacci numbers, we use the well known geometric series:&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{1}{1-x}=\sum_{n\ge 0}x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
It is useful when we can express the generating function in the form of &amp;lt;math&amp;gt;G(x)=\frac{a_1}{1-b_1x}+\frac{a_2}{1-b_2x}+\cdots+\frac{a_k}{1-b_kx}&amp;lt;/math&amp;gt;. The coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; in such &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;a_1b_1^n+a_2b_2^n+\cdots+a_kb_k^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
;Binomial theorem&lt;br /&gt;
The &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th derivative of &amp;lt;math&amp;gt;(1+x)^\alpha&amp;lt;/math&amp;gt; for some real &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; is &lt;br /&gt;
:&amp;lt;math&amp;gt;\alpha(\alpha-1)(\alpha-2)\cdots(\alpha-n+1)(1+x)^{\alpha-n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
By Taylor series, we get a generalized version of the binomial theorem known as [http://en.wikipedia.org/wiki/Binomial_coefficient#Newton.27s_binomial_series &#039;&#039;&#039;Newton&#039;s formula&#039;&#039;&#039;]:&lt;br /&gt;
:&amp;lt;math&amp;gt;(1+x)^\alpha=\sum_{n\ge 0}{\alpha\choose n}x^{n}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;{\alpha\choose n}&amp;lt;/math&amp;gt; is the &#039;&#039;&#039;generalized binomial coefficient&#039;&#039;&#039; defined by &lt;br /&gt;
:&amp;lt;math&amp;gt;{\alpha\choose n}=\frac{\alpha(\alpha-1)(\alpha-2)\cdots(\alpha-n+1)}{n!}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the last lecture we gave a combinatorial proof of the number of &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-multisets on an &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-set. Now we give a generating function approach to the problem.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S=\{x_1,x_2,\ldots,x_n\}&amp;lt;/math&amp;gt; be an &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-element set. We have&lt;br /&gt;
:&amp;lt;math&amp;gt;(1+x_1+x_1^2+\cdots)(1+x_2+x_2^2+\cdots)\cdots(1+x_n+x_n^2+\cdots)=\sum_{m:S\rightarrow\mathbb{N}} \prod_{x_i\in S}x_i^{m(x_i)}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where each &amp;lt;math&amp;gt;m:S\rightarrow\mathbb{N}&amp;lt;/math&amp;gt; species a possible multiset on &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; with multiplicity function &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let all &amp;lt;math&amp;gt;x_i=x&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
(1+x+x^2+\cdots)^n&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{m:S\rightarrow\mathbb{N}}x^{m(x_1)+\cdots+m(x_n)}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{\text{multiset }M\text{ on }S}x^{|M|}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{k\ge 0}\left({n\choose k}\right)x^k.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The last equation is due to the the definition of &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt;. Our task is to evaluate &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Due to the geometric sequence and the Newton&#039;s formula&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(1+x+x^2+\cdots)^n=(1-x)^{-n}=\sum_{k\ge 0}{-n\choose k}(-x)^k.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
So&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\left({n\choose k}\right)=(-1)^k{-n\choose k}={n+k-1\choose k}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The last equation is due to the definition of the generalized binomial coefficient. We use an analytic (generating function) proof to get the same result of &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt; as the combinatorial proof.&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Generating_functions&amp;diff=3109</id>
		<title>Combinatorics (Fall 2010)/Generating functions</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Combinatorics_(Fall_2010)/Generating_functions&amp;diff=3109"/>
		<updated>2010-07-14T02:27:43Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Binomial coefficient */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Stirling&#039;s Approximation ==&lt;br /&gt;
As we have seen, answers to many counting problems are expressed in terms of factorials. It is important for us to know roughly how large &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt; is, i.e. the asymptotic order of &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt;. This is done by the famous [http://en.wikipedia.org/wiki/Stirling&#039;s_approximation &#039;&#039;&#039;Stirling&#039;s approximation&#039;&#039;&#039;], also called &#039;&#039;&#039;Stirling&#039;s formula&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Theorem (Stirling&#039;s approximation)|&lt;br /&gt;
:&amp;lt;math&amp;gt;n!\sim \sqrt{2\pi n}\left(\frac{n}{e}\right)^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
The symbol &amp;lt;math&amp;gt;\sim\,&amp;lt;/math&amp;gt; means that &amp;lt;math&amp;gt;\lim_{n\rightarrow\infty}\frac{n!}{\sqrt{2\pi n}\left(\frac{n}{e}\right)^n}=1&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The proof of the Stirling&#039;s approximation is complicated. We will prove the following easier proposition.&lt;br /&gt;
{{Theorem|Proposition|&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln (n!)=n\ln n-n+O(\ln n)\,&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|&lt;br /&gt;
The logarithm of &amp;lt;math&amp;gt;n!&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;\ln (n!)=\sum_{k=1}^n\ln k&amp;lt;/math&amp;gt;. &lt;br /&gt;
Since &amp;lt;math&amp;gt;f(x)=\ln x&amp;lt;/math&amp;gt; is an increasing function of &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; for all positive &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;, we have &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\ln (n!)=\sum_{k=1}^n\ln k \le \int_2^{n+1}\ln x\, \mathrm{d}x  =(n+1)\ln(n+1)-(n+1)-2\ln 2+2.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Note that&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln(n+1)-\ln n=\int_{n}^{n+1}\frac{1}{x}\,\mathrm{d}x&amp;lt;\frac{1}{n},&amp;lt;/math&amp;gt;&lt;br /&gt;
thus &amp;lt;math&amp;gt;n\ln (n+1)&amp;lt;n\ln n+1&amp;lt;/math&amp;gt;. Combining this with the above upper bound,&lt;br /&gt;
:&amp;lt;math&amp;gt;\ln (n!)\le n\ln n-n+O(\ln n).&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
The full proof of Stirling&#039;s approximation involves a more precise estimation of the constant factor in &amp;lt;math&amp;gt;O(\ln n)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Binomial coefficient ===&lt;br /&gt;
{{Theorem|Proposition|&lt;br /&gt;
:&amp;lt;math&amp;gt;\left(\frac{n}{k}\right)^k\le {n\choose k} &amp;lt; \left(\frac{\mathrm{e}n}{k}\right)^k&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
{{Proof|&lt;br /&gt;
The lower bound is easy:&lt;br /&gt;
:&amp;lt;math&amp;gt;{n\choose k}=\frac{n}{k}\cdot\frac{n-1}{k-1}\cdots\frac{n-k+1}{1}\ge\frac{n}{k}\cdot\frac{n}{k}\cdots\frac{n}{k}=\left(\frac{n}{k}\right)^k&amp;lt;/math&amp;gt;.&lt;br /&gt;
For the upper bound, &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{e}^{nx}&amp;gt;(1+x)^n=\sum_{i=1}^n{n\choose i}x^i&amp;gt;{n\choose k}x^k,&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
for any &amp;lt;math&amp;gt;0\le k\le n&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Setting &amp;lt;math&amp;gt;x=\frac{k}{n}&amp;lt;/math&amp;gt;, we have&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{e}^k&amp;gt;{n\choose k}\left(\frac{k}{n}\right)^k.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
Therefore,&lt;br /&gt;
:&amp;lt;math&amp;gt;{n\choose k} &amp;lt; \left(\frac{\mathrm{e}n}{k}\right)^k&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Generating Functions ==&lt;br /&gt;
In Stanley&#039;s magnificent book &#039;&#039;Enumerative Combinatorics&#039;&#039;, he comments the generating function as &amp;quot;the most useful but most difficult to understand method (for counting)&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The solution to a counting problem is usually represented as some &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; depending a parameter &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. Sometimes this &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; is called a &#039;&#039;counting function&#039;&#039; as it is a function of the parameter &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;.  &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; can also be treated as a infinite series:&lt;br /&gt;
:&amp;lt;math&amp;gt;a_0,a_1,a_2,\ldots&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;ordinary generating function (OGF)&#039;&#039;&#039; defined by &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
G(x)=\sum_{n\ge 0} a_nx^n.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
So &amp;lt;math&amp;gt;G(x)=a_0+a_1x+a_2x^2+\cdots&amp;lt;/math&amp;gt;. An expression in this form is called a [http://en.wikipedia.org/wiki/Formal_power_series &#039;&#039;&#039;formal power series&#039;&#039;&#039;], and &amp;lt;math&amp;gt;a_0,a_1,a_2,\ldots&amp;lt;/math&amp;gt; is the sequence of &#039;&#039;&#039;coefficients&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
Furthermore, the generating function can be expanded as&lt;br /&gt;
:G(x)=&amp;lt;math&amp;gt;(\underbrace{1+\cdots+1}_{a_0})+(\underbrace{x+\cdots+x}_{a_1})+(\underbrace{x^2+\cdots+x^2}_{a_2})+\cdots+(\underbrace{x^n+\cdots+x^n}_{a_n})+\cdots&amp;lt;/math&amp;gt;&lt;br /&gt;
so it indeed &amp;quot;generates&amp;quot; all the possible instances of the objects we want to count.&lt;br /&gt;
&lt;br /&gt;
Usually, we do not evaluate the generating function &amp;lt;math&amp;gt;GF(x)&amp;lt;/math&amp;gt; on any particular value. &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; remains as a &#039;&#039;&#039;formal variable&#039;&#039;&#039; without assuming any value. The numbers that we want to count are the coefficients carried by the terms in the formal power series. So far the generating function is just another way to represent the sequence&lt;br /&gt;
:&amp;lt;math&amp;gt;(a_0,a_1,a_2,\ldots\ldots)&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The true power of generating functions comes from the various algebraic operations that we can perform on these generating functions. We use an example to demonstrate this.&lt;br /&gt;
&lt;br /&gt;
=== Fibonacci numbers  ===&lt;br /&gt;
Consider the following counting problems.&lt;br /&gt;
* Count the number of ways that the nonnegative integer &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; can be written as a sum of ones and twos (in order).&lt;br /&gt;
: The problem asks for the number of compositions of &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; with summands from &amp;lt;math&amp;gt;\{1,2\}&amp;lt;/math&amp;gt;. Formally, we are counting the number of tuples &amp;lt;math&amp;gt;(x_1,x_2,\ldots,x_k)&amp;lt;/math&amp;gt; for some &amp;lt;math&amp;gt;k\le n&amp;lt;/math&amp;gt; such that &amp;lt;math&amp;gt;x_i\in\{1,2\}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\sum_{i=1}^k x_i=n&amp;lt;/math&amp;gt;.&lt;br /&gt;
: Let &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; be the solution. We observe that a composition either starts with a 1, in which case the rest is a composition of &amp;lt;math&amp;gt;n-1&amp;lt;/math&amp;gt;; or starts with a 2, in which case the rest is a composition of &amp;lt;math&amp;gt;n-2&amp;lt;/math&amp;gt;. So we have the recursion for &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; that&lt;br /&gt;
::&amp;lt;math&amp;gt;F_n=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
* Count the ways to completely cover a &amp;lt;math&amp;gt;2\times n&amp;lt;/math&amp;gt; rectangle with &amp;lt;math&amp;gt;2\times 1&amp;lt;/math&amp;gt; dominos without any overlaps.&lt;br /&gt;
: Dominos are identical &amp;lt;math&amp;gt;2\times 1&amp;lt;/math&amp;gt; rectangles, so that only their orientations --- vertical or horizontal matter.&lt;br /&gt;
: Let &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; be the solution. It also holds that &amp;lt;math&amp;gt;F_n=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt;. The proof is left as an exercise.&lt;br /&gt;
&lt;br /&gt;
In both problems, the solution is given by &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; which satisfies the following recursion.&lt;br /&gt;
:&amp;lt;math&amp;gt;F_n=\begin{cases}&lt;br /&gt;
0 &amp;amp; \mbox{if }n=0\\&lt;br /&gt;
1 &amp;amp; \mbox{if }n=1\\&lt;br /&gt;
F_{n-1}+F_{n-2} &amp;amp; \mbox{if}n\ge 2.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; is called the [http://en.wikipedia.org/wiki/Fibonacci_number Fibonacci number].&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Theorem|&lt;br /&gt;
::&amp;lt;math&amp;gt;F_n=\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)&amp;lt;/math&amp;gt;,&lt;br /&gt;
:where &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
}}&lt;br /&gt;
The quantity &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; is the so-called [http://en.wikipedia.org/wiki/Golden_ratio golden ratio], a constant with some significance in mathematics and aesthetics.&lt;br /&gt;
&lt;br /&gt;
We now prove this theorem by using generating functions.&lt;br /&gt;
&lt;br /&gt;
The ordinary generating function for the Fibonacci number &amp;lt;math&amp;gt;F_{n}&amp;lt;/math&amp;gt; is&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}F_n x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
We have that &amp;lt;math&amp;gt;F_{n}=F_{n-1}+F_{n-2}&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;n\ge 2&amp;lt;/math&amp;gt;, thus&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{align}&lt;br /&gt;
G(x) &lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{n\ge 0}F_n x^n&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
x+\sum_{n\ge 2}(F_{n-1}+F_{n-2})x^n.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
For generating functions, there are general ways to generate &amp;lt;math&amp;gt;F_{n-1}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F_{n-2}&amp;lt;/math&amp;gt;, or the coefficients with any smaller indices.&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
xG(x)&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}F_n x^{n+1}=\sum_{n\ge 1}F_{n-1} x^n=\sum_{n\ge 2}F_{n-1} x^n\\&lt;br /&gt;
x^2G(x)&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}F_n x^{n+2}=\sum_{n\ge 2}F_{n-2} x^n.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
So we have&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=x+(x+x^2)G(x)\,&amp;lt;/math&amp;gt;,&lt;br /&gt;
hence&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\frac{x}{1-x-x^2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
The value of &amp;lt;math&amp;gt;F_n&amp;lt;/math&amp;gt; is the coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; in the Taylor series for this formular, which is &amp;lt;math&amp;gt;\frac{G^{(n)}(0)}{n!}=\frac{1}{\sqrt{5}}\left(\frac{1+\sqrt{5}}{2}\right)^n-\frac{1}{\sqrt{5}}\left(\frac{1-\sqrt{5}}{2}\right)^n&amp;lt;/math&amp;gt;. Although this expansion works in principle, the detailed calculus is rather painful.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
There is an easier way to get this coefficient than directly expanding the Taylor series. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;math&amp;gt;1-x-x^2&amp;lt;/math&amp;gt; has two roots &amp;lt;math&amp;gt;\frac{-1\pm\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Denote that &amp;lt;math&amp;gt;\phi=\frac{2}{-1+\sqrt{5}}=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{2}{-1-\sqrt{5}}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;. Then &amp;lt;math&amp;gt;(1-x-x^2)=(1-\phi x)(1-\hat{\phi}x)&amp;lt;/math&amp;gt;, so we can write &lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
\frac{x}{1-x-x^2}&lt;br /&gt;
&amp;amp;=\frac{x}{(1-\phi x)(1-\hat{\phi} x)}\\&lt;br /&gt;
&amp;amp;=\frac{\alpha}{(1-\phi x)}+\frac{\beta}{(1-\hat{\phi} x)},&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta&amp;lt;/math&amp;gt; satisfying that&lt;br /&gt;
:&amp;lt;math&amp;gt;\begin{cases}&lt;br /&gt;
\alpha+\beta=0\\&lt;br /&gt;
\alpha\phi+\beta\hat{\phi}= -1.&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
Solving this we have that &amp;lt;math&amp;gt;\alpha=\frac{1}{\sqrt{5}}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\beta=-\frac{1}{\sqrt{5}}&amp;lt;/math&amp;gt;. And&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\frac{x}{1-x-x^2}=\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\phi x}-\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\hat{\phi} x}&amp;lt;/math&amp;gt;&lt;br /&gt;
where &amp;lt;math&amp;gt;\phi=\frac{1+\sqrt{5}}{2}&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\hat{\phi}=\frac{1-\sqrt{5}}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Note that the expression &amp;lt;math&amp;gt;\frac{1}{1-z}&amp;lt;/math&amp;gt; has a well known expansion:&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{1}{1-z}=\sum_{n\ge 0}z^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Therefore, &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; can be expanded as&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
G(x)&lt;br /&gt;
&amp;amp;=\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\phi x}-\frac{1}{\sqrt{5}}\cdot\frac{1}{1-\hat{\phi} x}\\&lt;br /&gt;
&amp;amp;=\frac{1}{\sqrt{5}}\sum_{n\ge 0}(\phi x)^n-\frac{1}{\sqrt{5}}\sum_{n\ge 0}(\hat{\phi} x)^n\\&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)x^n.&lt;br /&gt;
\end{align}&amp;lt;/math&amp;gt;&lt;br /&gt;
So the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;th Fibonacci number is given by &lt;br /&gt;
:&amp;lt;math&amp;gt;F_n=\frac{1}{\sqrt{5}}\left(\phi^n-\hat{\phi}^n\right)=\frac{1}{\sqrt{5}}\left(\frac{1+\sqrt{5}}{2}\right)^n-\frac{1}{\sqrt{5}}\left(\frac{1-\sqrt{5}}{2}\right)^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Solving recurrences ===&lt;br /&gt;
In the above analysis of Fibonacci numbers, we apply the following general methodology of solving recurrences by generating functions.&lt;br /&gt;
:1. Give a recursion that computes &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt;; that is, an equation expressing &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt; in terms of other elements of the sequence, such as&lt;br /&gt;
::&amp;lt;math&amp;gt;a_n=f(a_0,a_1,\ldots,a_{n-1})&amp;lt;/math&amp;gt;  for some function &amp;lt;math&amp;gt;f&amp;lt;/math&amp;gt;.&lt;br /&gt;
:2. Multiply both sides of the equation by &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; and sum over all &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;. This gives the generating function&lt;br /&gt;
::&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}a_nx^n=\sum_{n\ge 0}f(a_0,a_1,\ldots,a_{n-1})x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
:: And manipulate the right hand side of the equation so that it becomes some other expression involving &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;.&lt;br /&gt;
:3. Solve the resulting equation to derive an explicit formula for &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;.&lt;br /&gt;
:4. Expand &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; into a power series and read off the coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt;, which is a closed form for &amp;lt;math&amp;gt;a_n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Algebraic operations on generating functions ====&lt;br /&gt;
The second step in the above methodology is somehow tricky. It involves first applying the recurrence to the coefficients of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;, which is easy; and then manipulating the resulting formal power series to express it in terms of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt;, which is more difficult (because it works backwards).&lt;br /&gt;
&lt;br /&gt;
We can apply several natural algebraic operations on the formal power series.&lt;br /&gt;
&lt;br /&gt;
{{Theorem|Generating function manipulation|&lt;br /&gt;
:Let &amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}g_nx^n&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;F(x)=\sum_{n\ge 0}f_nx^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
x^k G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge k}g_{n-k}x^n, &amp;amp;\qquad (\mbox{integer }k\ge 0)\\&lt;br /&gt;
\frac{G(x)-\sum_{i=0}^{k-1}g_iz^i}{x^k}&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}g_{n+k}x^n, &amp;amp;\qquad (\mbox{integer }k\ge 0)\\&lt;br /&gt;
\alpha F(x)+\beta G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0} (\alpha f_n+\beta g_n)x^n\\&lt;br /&gt;
F(x)G(x)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0}\sum_{k=0}^nf_kg_{n-k}x^n\\&lt;br /&gt;
G(cx)&lt;br /&gt;
&amp;amp;= \sum_{n\ge 0} c^ng_n x^n\\&lt;br /&gt;
G&#039;(x)&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{n\ge 0}(n+1)g_{n+1}x^n\\&lt;br /&gt;
\frac{G(x)}{1-x}&lt;br /&gt;
&amp;amp;=\sum_{n\ge 0}\left(\sum_{k=0}^ng_k\right)x^n&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
When manipulating generating functions, these rules are applied backwards; that is, from the right-hand-side to the left-hand-side.&lt;br /&gt;
&lt;br /&gt;
==== Expanding generating functions ====&lt;br /&gt;
The last step of solving recurrences by generating function is expanding the closed form generating function &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; to evaluate its &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th coefficient. In principle, we can always use the [http://en.wikipedia.org/wiki/Taylor_series Taylor series]&lt;br /&gt;
:&amp;lt;math&amp;gt;G(x)=\sum_{n\ge 0}\frac{G^{(n)}(0)}{n!}x^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;G^{(n)}(0)&amp;lt;/math&amp;gt; is the value of the &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th derivative of &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; evaluated at &amp;lt;math&amp;gt;x=0&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Some interesting special cases are very useful.&lt;br /&gt;
&lt;br /&gt;
;Geometric sequence&lt;br /&gt;
In the example of Fibonacci numbers, we use the well known geometric series:&lt;br /&gt;
:&amp;lt;math&amp;gt;\frac{1}{1-x}=\sum_{n\ge 0}x^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
It is useful when we can express the generating function in the form of &amp;lt;math&amp;gt;G(x)=\frac{a_1}{1-b_1x}+\frac{a_2}{1-b_2x}+\cdots+\frac{a_k}{1-b_kx}&amp;lt;/math&amp;gt;. The coefficient of &amp;lt;math&amp;gt;x^n&amp;lt;/math&amp;gt; in such &amp;lt;math&amp;gt;G(x)&amp;lt;/math&amp;gt; is &amp;lt;math&amp;gt;a_1b_1^n+a_2b_2^n+\cdots+a_kb_k^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
;Binomial theorem&lt;br /&gt;
The &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-th derivative of &amp;lt;math&amp;gt;(1+x)^\alpha&amp;lt;/math&amp;gt; for some real &amp;lt;math&amp;gt;\alpha&amp;lt;/math&amp;gt; is &lt;br /&gt;
:&amp;lt;math&amp;gt;\alpha(\alpha-1)(\alpha-2)\cdots(\alpha-n+1)(1+x)^{\alpha-n}&amp;lt;/math&amp;gt;.&lt;br /&gt;
By Taylor series, we get a generalized version of the binomial theorem known as [http://en.wikipedia.org/wiki/Binomial_coefficient#Newton.27s_binomial_series &#039;&#039;&#039;Newton&#039;s formula&#039;&#039;&#039;]:&lt;br /&gt;
:&amp;lt;math&amp;gt;(1+x)^\alpha=\sum_{n\ge 0}{\alpha\choose n}x^{n}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where &amp;lt;math&amp;gt;{\alpha\choose n}&amp;lt;/math&amp;gt; is the &#039;&#039;&#039;generalized binomial coefficient&#039;&#039;&#039; defined by &lt;br /&gt;
:&amp;lt;math&amp;gt;{\alpha\choose n}=\frac{\alpha(\alpha-1)(\alpha-2)\cdots(\alpha-n+1)}{n!}&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In the last lecture we gave a combinatorial proof of the number of &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt;-multisets on an &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-set. Now we give a generating function approach to the problem.&lt;br /&gt;
&lt;br /&gt;
Let &amp;lt;math&amp;gt;S=\{x_1,x_2,\ldots,x_n\}&amp;lt;/math&amp;gt; be an &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt;-element set. We have&lt;br /&gt;
:&amp;lt;math&amp;gt;(1+x_1+x_1^2+\cdots)(1+x_2+x_2^2+\cdots)\cdots(1+x_n+x_n^2+\cdots)=\sum_{m:S\rightarrow\mathbb{N}} \prod_{x_i\in S}x_i^{m(x_i)}&amp;lt;/math&amp;gt;,&lt;br /&gt;
where each &amp;lt;math&amp;gt;m:S\rightarrow\mathbb{N}&amp;lt;/math&amp;gt; species a possible multiset on &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt; with multiplicity function &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Let all &amp;lt;math&amp;gt;x_i=x&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\begin{align}&lt;br /&gt;
(1+x+x^2+\cdots)^n&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{m:S\rightarrow\mathbb{N}}x^{m(x_1)+\cdots+m(x_n)}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{\text{multiset }M\text{ on }S}x^{|M|}\\&lt;br /&gt;
&amp;amp;=&lt;br /&gt;
\sum_{k\ge 0}\left({n\choose k}\right)x^k.&lt;br /&gt;
\end{align}&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The last equation is due to the the definition of &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt;. Our task is to evaluate &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
Due to the geometric sequence and the Newton&#039;s formula&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
(1+x+x^2+\cdots)^n=(1-x)^{-n}=\sum_{k\ge 0}{-n\choose k}(-x)^k.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
So&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\left({n\choose k}\right)=(-1)^k{-n\choose k}={n+k-1\choose k}.&lt;br /&gt;
&amp;lt;/math&amp;gt;&lt;br /&gt;
The last equation is due to the definition of the generalized binomial coefficient. We use an analytic (generating function) proof to get the same result of &amp;lt;math&amp;gt;\left({n\choose k}\right)&amp;lt;/math&amp;gt; as the combinatorial proof.&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2797</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2797"/>
		<updated>2010-06-05T10:13:28Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Communication complexity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Checking identities ===&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Fingerprinting ====&lt;br /&gt;
Suppose we want to compare two items &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt;. Instead of comparing them directly, we compute random &#039;&#039;&#039;fingerprints&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathrm{FING}(Z_1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathrm{FING}(Z_2)&amp;lt;/math&amp;gt; and compare these. The fingerprints has the following properties:&lt;br /&gt;
* If &amp;lt;math&amp;gt;Z_1\neq Z_2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;\Pr[\mathrm{FING}(Z_1)=\mathrm{FING}(Z_2)]&amp;lt;/math&amp;gt; is small.&lt;br /&gt;
* It is much more to compute and compare the fingerprints than to compare &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt; directly.&lt;br /&gt;
&lt;br /&gt;
For Freivald&#039;s algorithm, the items to compare are two &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;, and given an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(M)=Mr&amp;lt;/math&amp;gt; for a uniformly random &amp;lt;math&amp;gt;r\in\{0,1\}^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For the Schwartz-Zippel algorithm, the items to compare are two polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, and given a polynomial &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(Q)=Q(r_1,\ldots,r_n)&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;r_i&amp;lt;/math&amp;gt; chosen independently and uniformly at random from some fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Communication complexity ===&lt;br /&gt;
Alice and Bob are two entities. Alice has a private input &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and Bob has a private input &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;. Together they want to compute a function &amp;lt;math&amp;gt;f(x,y)&amp;lt;/math&amp;gt; by communicating with each other. This is the model of &#039;&#039;&#039;communication complexity&#039;&#039;&#039; due to Yao.&lt;br /&gt;
&lt;br /&gt;
In the communication complexity model, the local computational costs are ignored. The complexity of algorithms (also called communication protocols here) are measured by the number of bits communicated between Alice and Bob.&lt;br /&gt;
&lt;br /&gt;
One of the basic function is IDENTITY, defined as&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{IDENTITY}(x,y)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
1&amp;amp; \mbox{if } x=y,\\&lt;br /&gt;
0&amp;amp; \mbox{otherwise.}&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A trivial way to solve IDENTITY is to let Bob send &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; to Alice. Supposed that &amp;lt;math&amp;gt;x,y\in\{0,1\}^n&amp;lt;/math&amp;gt;, this costs &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; bits of communications.&lt;br /&gt;
&lt;br /&gt;
=== Randomized pattern matching ===&lt;br /&gt;
&lt;br /&gt;
=== Checking distinctness ===&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2796</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2796"/>
		<updated>2010-06-04T13:44:26Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Universal hashing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Checking identities ===&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Fingerprinting ====&lt;br /&gt;
Suppose we want to compare two items &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt;. Instead of comparing them directly, we compute random &#039;&#039;&#039;fingerprints&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathrm{FING}(Z_1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathrm{FING}(Z_2)&amp;lt;/math&amp;gt; and compare these. The fingerprints has the following properties:&lt;br /&gt;
* If &amp;lt;math&amp;gt;Z_1\neq Z_2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;\Pr[\mathrm{FING}(Z_1)=\mathrm{FING}(Z_2)]&amp;lt;/math&amp;gt; is small.&lt;br /&gt;
* It is much more to compute and compare the fingerprints than to compare &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt; directly.&lt;br /&gt;
&lt;br /&gt;
For Freivald&#039;s algorithm, the items to compare are two &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;, and given an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(M)=Mr&amp;lt;/math&amp;gt; for a uniformly random &amp;lt;math&amp;gt;r\in\{0,1\}^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For the Schwartz-Zippel algorithm, the items to compare are two polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, and given a polynomial &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(Q)=Q(r_1,\ldots,r_n)&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;r_i&amp;lt;/math&amp;gt; chosen independently and uniformly at random from some fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Communication complexity ===&lt;br /&gt;
Alice and Bob are two entities. Alice has a private input &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and Bob has a private input &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;. Together they want to compute a function &amp;lt;math&amp;gt;f(x,y)&amp;lt;/math&amp;gt; by communicating with each other. This is the model of &#039;&#039;&#039;communication complexity&#039;&#039;&#039; due to Andrew Chi-Chih Yao.&lt;br /&gt;
&lt;br /&gt;
In the communication complexity model, the local computational costs are ignored. The complexity of algorithms (also called communication protocols here) are measured by the number of bits communicated between Alice and Bob.&lt;br /&gt;
&lt;br /&gt;
One of the basic function is IDENTITY, defined as&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{IDENTITY}(x,y)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
1&amp;amp; \mbox{if } x=y,\\&lt;br /&gt;
0&amp;amp; \mbox{otherwise.}&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A trivial way to solve IDENTITY is to let Bob send &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; to Alice. Supposed that &amp;lt;math&amp;gt;x,y\in\{0,1\}^n&amp;lt;/math&amp;gt;, this costs &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; bits of communications.&lt;br /&gt;
&lt;br /&gt;
=== Randomized pattern matching ===&lt;br /&gt;
&lt;br /&gt;
=== Checking distinctness ===&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2795</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2795"/>
		<updated>2010-06-04T13:43:56Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Communication complexity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Checking identities ===&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Fingerprinting ====&lt;br /&gt;
Suppose we want to compare two items &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt;. Instead of comparing them directly, we compute random &#039;&#039;&#039;fingerprints&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathrm{FING}(Z_1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathrm{FING}(Z_2)&amp;lt;/math&amp;gt; and compare these. The fingerprints has the following properties:&lt;br /&gt;
* If &amp;lt;math&amp;gt;Z_1\neq Z_2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;\Pr[\mathrm{FING}(Z_1)=\mathrm{FING}(Z_2)]&amp;lt;/math&amp;gt; is small.&lt;br /&gt;
* It is much more to compute and compare the fingerprints than to compare &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt; directly.&lt;br /&gt;
&lt;br /&gt;
For Freivald&#039;s algorithm, the items to compare are two &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;, and given an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(M)=Mr&amp;lt;/math&amp;gt; for a uniformly random &amp;lt;math&amp;gt;r\in\{0,1\}^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For the Schwartz-Zippel algorithm, the items to compare are two polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, and given a polynomial &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(Q)=Q(r_1,\ldots,r_n)&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;r_i&amp;lt;/math&amp;gt; chosen independently and uniformly at random from some fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Communication complexity ===&lt;br /&gt;
Alice and Bob are two entities. Alice has a private input &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; and Bob has a private input &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt;. Together they want to compute a function &amp;lt;math&amp;gt;f(x,y)&amp;lt;/math&amp;gt; by communicating with each other. This is the model of &#039;&#039;&#039;communication complexity&#039;&#039;&#039; due to Andrew Chi-Chih Yao.&lt;br /&gt;
&lt;br /&gt;
In the communication complexity model, the local computational costs are ignored. The complexity of algorithms (also called communication protocols here) are measured by the number of bits communicated between Alice and Bob.&lt;br /&gt;
&lt;br /&gt;
One of the basic function is IDENTITY, defined as&lt;br /&gt;
:&amp;lt;math&amp;gt;&lt;br /&gt;
\mathrm{IDENTITY}(x,y)=&lt;br /&gt;
\begin{cases}&lt;br /&gt;
1&amp;amp; \mbox{if } x=y,\\&lt;br /&gt;
0&amp;amp; \mbox{otherwise.}&lt;br /&gt;
\end{cases}&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A trivial way to solve IDENTITY is to let Bob send &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; to Alice. Supposed that &amp;lt;math&amp;gt;x,y\in\{0,1\}^n&amp;lt;/math&amp;gt;, this costs &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; bits of communications.&lt;br /&gt;
&lt;br /&gt;
=== Randomized pattern matching ===&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2794</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2794"/>
		<updated>2010-06-04T11:45:43Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Communication complexity */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Checking identities ===&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Fingerprinting ====&lt;br /&gt;
Suppose we want to compare two items &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt;. Instead of comparing them directly, we compute random &#039;&#039;&#039;fingerprints&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathrm{FING}(Z_1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathrm{FING}(Z_2)&amp;lt;/math&amp;gt; and compare these. The fingerprints has the following properties:&lt;br /&gt;
* If &amp;lt;math&amp;gt;Z_1\neq Z_2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;\Pr[\mathrm{FING}(Z_1)=\mathrm{FING}(Z_2)]&amp;lt;/math&amp;gt; is small.&lt;br /&gt;
* It is much more to compute and compare the fingerprints than to compare &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt; directly.&lt;br /&gt;
&lt;br /&gt;
For Freivald&#039;s algorithm, the items to compare are two &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;, and given an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(M)=Mr&amp;lt;/math&amp;gt; for a uniformly random &amp;lt;math&amp;gt;r\in\{0,1\}^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For the Schwartz-Zippel algorithm, the items to compare are two polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, and given a polynomial &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(Q)=Q(r_1,\ldots,r_n)&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;r_i&amp;lt;/math&amp;gt; chosen independently and uniformly at random from some fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Communication complexity ===&lt;br /&gt;
&lt;br /&gt;
=== Randomized pattern matching ===&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2793</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2793"/>
		<updated>2010-06-04T11:45:30Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Example: Randomized pattern matching */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Checking identities ===&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Fingerprinting ====&lt;br /&gt;
Suppose we want to compare two items &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt;. Instead of comparing them directly, we compute random &#039;&#039;&#039;fingerprints&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathrm{FING}(Z_1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathrm{FING}(Z_2)&amp;lt;/math&amp;gt; and compare these. The fingerprints has the following properties:&lt;br /&gt;
* If &amp;lt;math&amp;gt;Z_1\neq Z_2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;\Pr[\mathrm{FING}(Z_1)=\mathrm{FING}(Z_2)]&amp;lt;/math&amp;gt; is small.&lt;br /&gt;
* It is much more to compute and compare the fingerprints than to compare &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt; directly.&lt;br /&gt;
&lt;br /&gt;
For Freivald&#039;s algorithm, the items to compare are two &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;, and given an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(M)=Mr&amp;lt;/math&amp;gt; for a uniformly random &amp;lt;math&amp;gt;r\in\{0,1\}^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For the Schwartz-Zippel algorithm, the items to compare are two polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, and given a polynomial &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(Q)=Q(r_1,\ldots,r_n)&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;r_i&amp;lt;/math&amp;gt; chosen independently and uniformly at random from some fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Communication complexity ====&lt;br /&gt;
&lt;br /&gt;
=== Randomized pattern matching ===&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2792</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2792"/>
		<updated>2010-06-04T11:45:15Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Example: Identity checking */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Checking identities ===&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Fingerprinting ====&lt;br /&gt;
Suppose we want to compare two items &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt;. Instead of comparing them directly, we compute random &#039;&#039;&#039;fingerprints&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathrm{FING}(Z_1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathrm{FING}(Z_2)&amp;lt;/math&amp;gt; and compare these. The fingerprints has the following properties:&lt;br /&gt;
* If &amp;lt;math&amp;gt;Z_1\neq Z_2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;\Pr[\mathrm{FING}(Z_1)=\mathrm{FING}(Z_2)]&amp;lt;/math&amp;gt; is small.&lt;br /&gt;
* It is much more to compute and compare the fingerprints than to compare &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt; directly.&lt;br /&gt;
&lt;br /&gt;
For Freivald&#039;s algorithm, the items to compare are two &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;, and given an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(M)=Mr&amp;lt;/math&amp;gt; for a uniformly random &amp;lt;math&amp;gt;r\in\{0,1\}^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For the Schwartz-Zippel algorithm, the items to compare are two polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, and given a polynomial &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(Q)=Q(r_1,\ldots,r_n)&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;r_i&amp;lt;/math&amp;gt; chosen independently and uniformly at random from some fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Communication complexity ====&lt;br /&gt;
&lt;br /&gt;
==== Example: Randomized pattern matching ====&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2791</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2791"/>
		<updated>2010-06-04T11:42:53Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Fingerprinting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Checking identities ===&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Fingerprinting ====&lt;br /&gt;
Suppose we want to compare two items &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt;. Instead of comparing them directly, we compute random &#039;&#039;&#039;fingerprints&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathrm{FING}(Z_1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathrm{FING}(Z_2)&amp;lt;/math&amp;gt; and compare these. The fingerprints has the following properties:&lt;br /&gt;
* If &amp;lt;math&amp;gt;Z_1\neq Z_2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;\Pr[\mathrm{FING}(Z_1)=\mathrm{FING}(Z_2)]&amp;lt;/math&amp;gt; is small.&lt;br /&gt;
* It is much more to compute and compare the fingerprints than to compare &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt; directly.&lt;br /&gt;
&lt;br /&gt;
For Freivald&#039;s algorithm, the items to compare are two &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;, and given an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(M)=Mr&amp;lt;/math&amp;gt; for a uniformly random &amp;lt;math&amp;gt;r\in\{0,1\}^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For the Schwartz-Zippel algorithm, the items to compare are two polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, and given a polynomial &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;, its random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(Q)=Q(r_1,\ldots,r_n)&amp;lt;/math&amp;gt; for &amp;lt;math&amp;gt;r_i&amp;lt;/math&amp;gt; chosen independently and uniformly at random from some fixed set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Example: Identity checking ====&lt;br /&gt;
&lt;br /&gt;
==== Example: Randomized pattern matching ====&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2790</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2790"/>
		<updated>2010-06-04T11:39:28Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Fingerprinting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Checking identities ===&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Fingerprinting ====&lt;br /&gt;
Suppose we want to compare two items &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt;. Instead of comparing them directly, we compute random &#039;&#039;&#039;fingerprints&#039;&#039;&#039; &amp;lt;math&amp;gt;\mathrm{FING}(Z_1)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;\mathrm{FING}(Z_2)&amp;lt;/math&amp;gt; and compare these. The fingerprints has the following properties:&lt;br /&gt;
* If &amp;lt;math&amp;gt;Z_1\neq Z_2&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;\Pr[\mathrm{FING}(Z_1)=\mathrm{FING}(Z_2)]&amp;lt;/math&amp;gt; is small.&lt;br /&gt;
* It is much more to compute and compare the fingerprints than to compare &amp;lt;math&amp;gt;Z_1&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;Z_2&amp;lt;/math&amp;gt; directly.&lt;br /&gt;
&lt;br /&gt;
For Freivald&#039;s algorithm, the item to compare are two &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;AB&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;, and given an &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrix &amp;lt;math&amp;gt;M&amp;lt;/math&amp;gt;, the random fingerprint is computed as &amp;lt;math&amp;gt;\mathrm{FING}(M)=Mr&amp;lt;/math&amp;gt; for a uniformly random &amp;lt;math&amp;gt;r\in\{0,1\}^n&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Example: Identity checking ====&lt;br /&gt;
&lt;br /&gt;
==== Example: Randomized pattern matching ====&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2789</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2789"/>
		<updated>2010-06-04T11:29:46Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Fingerprinting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Checking identities ===&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Fingerprinting ====&lt;br /&gt;
&lt;br /&gt;
==== Example: Identity checking ====&lt;br /&gt;
&lt;br /&gt;
==== Example: Randomized pattern matching ====&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2788</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2788"/>
		<updated>2010-06-04T11:29:34Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Fingerprinting */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Checking identities ===&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Fingerprinting === &lt;br /&gt;
&lt;br /&gt;
==== Example: Identity checking ====&lt;br /&gt;
&lt;br /&gt;
==== Example: Randomized pattern matching ====&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2787</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2787"/>
		<updated>2010-06-04T11:28:44Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Two examples */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Fingerprinting === &lt;br /&gt;
&lt;br /&gt;
==== Example: Identity checking ====&lt;br /&gt;
&lt;br /&gt;
==== Example: Randomized pattern matching ====&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2786</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2786"/>
		<updated>2010-06-04T11:28:10Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Evaluating over a random field */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Two examples ===&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Fingerprinting === &lt;br /&gt;
&lt;br /&gt;
==== Example: Identity checking ====&lt;br /&gt;
&lt;br /&gt;
==== Example: Randomized pattern matching ====&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2785</id>
		<title>Randomized Algorithms (Spring 2010)/Fingerprinting</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Fingerprinting&amp;diff=2785"/>
		<updated>2010-06-04T11:27:22Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: /* Evaluating at random points */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Fingerprinting ==&lt;br /&gt;
&lt;br /&gt;
=== Two examples ===&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking matrix multiplication ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input three &amp;lt;math&amp;gt;n\times n&amp;lt;/math&amp;gt; matrices &amp;lt;math&amp;gt;A,B&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;C&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;C=AB&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Freivalds)&#039;&#039;&#039;&lt;br /&gt;
*pick a vector &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt; uniformly at random;&lt;br /&gt;
*if &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; then return &amp;quot;yes&amp;quot; else return &amp;quot;no&amp;quot;;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If &amp;lt;math&amp;gt;AB=C&amp;lt;/math&amp;gt; then &amp;lt;math&amp;gt;A(Br) = Cr&amp;lt;/math&amp;gt; for any &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;, thus the algorithm always returns &amp;quot;yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Lemma&#039;&#039;&#039;&lt;br /&gt;
:If &amp;lt;math&amp;gt;AB\neq C&amp;lt;/math&amp;gt; then for a uniformly random &amp;lt;math&amp;gt;r \in\{0, 1\}^n&amp;lt;/math&amp;gt;,&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[A(Br) = Cr]\le \frac{1}{2}&amp;lt;/math&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Example: Checking polynomial identities ====&lt;br /&gt;
Consider the following problem:&lt;br /&gt;
* Given as the input two multivariate polynomials &amp;lt;math&amp;gt;P_1(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; and &amp;lt;math&amp;gt;P_2(x_1,\ldots,x_n)&amp;lt;/math&amp;gt;,&lt;br /&gt;
* check whether &amp;lt;math&amp;gt;P_1\equiv P_2&amp;lt;/math&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Algorithm (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
*pick &amp;lt;math&amp;gt;r_1, \ldots , r_n&amp;lt;/math&amp;gt; independently and uniformly at random from a set &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;;&lt;br /&gt;
*if &amp;lt;math&amp;gt;P_1(r_1, \ldots , r_n) = P_2(r_1, \ldots , r_n)&amp;lt;/math&amp;gt; then return “yes” else return “no”;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{|border=&amp;quot;1&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Theorem (Schwartz-Zippel)&#039;&#039;&#039;&lt;br /&gt;
: Let &amp;lt;math&amp;gt;Q(x_1,\ldots,x_n)&amp;lt;/math&amp;gt; be a multivariate polynomial of degree &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; defined over a field &amp;lt;math&amp;gt;\mathbb{F}&amp;lt;/math&amp;gt;. Fix any finite set &amp;lt;math&amp;gt;S\subset\mathbb{F}&amp;lt;/math&amp;gt;, and let &amp;lt;math&amp;gt;r_1,\ldots,r_n&amp;lt;/math&amp;gt; be chosen independently and uniformly at random from &amp;lt;math&amp;gt;S&amp;lt;/math&amp;gt;. Then&lt;br /&gt;
::&amp;lt;math&amp;gt;\Pr[Q(r_1,\ldots,r_n)=0\mid Q\not\equiv 0]\le\frac{d}{|S|}.&amp;lt;/math&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Evaluating over a random field === &lt;br /&gt;
&lt;br /&gt;
==== Example: Identity checking ====&lt;br /&gt;
&lt;br /&gt;
==== Example: Randomized pattern matching ====&lt;br /&gt;
&lt;br /&gt;
=== Universal hashing ===&lt;br /&gt;
&lt;br /&gt;
;Example&amp;lt;nowiki&amp;gt;:&amp;lt;/nowiki&amp;gt; checking distinctness&lt;br /&gt;
&lt;br /&gt;
== Probabilistic Checkable Proofs (PCPs) ==&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)&amp;diff=265</id>
		<title>Randomized Algorithms (Spring 2010)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)&amp;diff=265"/>
		<updated>2009-12-27T16:44:54Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = 随机算法 &lt;br /&gt;
Randomized Algorithms&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = [[File:MR-randomized-algorithms.png|100px]]&lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &#039;&#039;Randomized Algorithms&#039;&#039; by Motwani and Raghavan&lt;br /&gt;
|captionstyle = &lt;br /&gt;
|headerstyle  = background:#ccf;&lt;br /&gt;
|labelstyle   = background:#ddf;&lt;br /&gt;
|datastyle    = &lt;br /&gt;
&lt;br /&gt;
|header1 =Instructor&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = 尹一通&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = Email&lt;br /&gt;
|data3   = yitong.yin@gmail.com  yinyt@nju.edu.cn  yinyt@lamda.nju.edu.cn&lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= office&lt;br /&gt;
|data4= 蒙民伟楼 406&lt;br /&gt;
|header5 = Class&lt;br /&gt;
|label5  = &lt;br /&gt;
|data5   = &lt;br /&gt;
|header6 =&lt;br /&gt;
|label6  = Class meetings&lt;br /&gt;
|data6   = 8 am-10 am, Wednesday&lt;br /&gt;
|header7 =&lt;br /&gt;
|label7  = Place&lt;br /&gt;
|data7   = &lt;br /&gt;
|header8 =&lt;br /&gt;
|label8  = Office hours&lt;br /&gt;
|data8   = 2pm-5pm, Saturday, MMW 406 &lt;br /&gt;
|header9 = Textbook&lt;br /&gt;
|label9  = &lt;br /&gt;
|data9   = &lt;br /&gt;
|header10 =&lt;br /&gt;
|label10  = &lt;br /&gt;
|data10   = Motwani and Raghavan, &#039;&#039;Randomized Algorithms&#039;&#039;. Cambridge Univ Press, 1995.&lt;br /&gt;
&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the page for the class &#039;&#039;Randomized Algorithms&#039;&#039; for the Spring 2010 semester. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= Announcement =&lt;br /&gt;
There is no announcement yet.&lt;br /&gt;
&lt;br /&gt;
= Syllabus =&lt;br /&gt;
随机化（randomization）是现代计算机科学最重要的方法之一，近二十年来被广泛的应用于计算机科学的各个领域。在这些应用的背后，有一些共通的随机化原理。在随机算法这门课程中，我们将用数学的语言描述这些原理，将会讲授以下内容：&lt;br /&gt;
* 一些重要的随机算法的设计与分析；&lt;br /&gt;
* 概率论工具，其中包括概率分析的工具，也包括数学证明的概率方法 (the probabilistic method);&lt;br /&gt;
* 随机算法的概率模型，既包括一些算法模型，例如随机漫游 (random walks)，也包括复杂度模型——概率图灵机。&lt;br /&gt;
作为一门理论课程，这门课的内容偏重数学上的分析和证明。这么做的目的不仅仅是为了结果的严格性，而是因为用更聪明的方法去解决问题往往需要对问题本身的数学结构有深刻的认识。&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 Prerequisites ===&lt;br /&gt;
必须：离散数学，概率论。&lt;br /&gt;
推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== [[Randomized Algorithms (Spring 2010)/Course materials|教材和参考书 Course materials]] ===&lt;br /&gt;
&lt;br /&gt;
=== [[Randomized Algorithms (Spring 2010)/Policies|规则 Policies]] ===&lt;br /&gt;
&lt;br /&gt;
= Assignments =&lt;br /&gt;
There is no assignment yet.&lt;br /&gt;
&lt;br /&gt;
= Lecture Notes =&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)&amp;diff=264</id>
		<title>Randomized Algorithms (Spring 2010)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)&amp;diff=264"/>
		<updated>2009-12-27T16:44:04Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = 随机算法 &lt;br /&gt;
Randomized Algorithms&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = [[File:MR-randomized-algorithms.png|100px]]&lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &#039;&#039;Randomized Algorithms&#039;&#039; by Motwani and Raghavan&lt;br /&gt;
|captionstyle = &lt;br /&gt;
|headerstyle  = background:#ccf;&lt;br /&gt;
|labelstyle   = background:#ddf;&lt;br /&gt;
|datastyle    = &lt;br /&gt;
&lt;br /&gt;
|header1 =Instructor&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = 尹一通&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = Email&lt;br /&gt;
|data3   = yitong.yin@gmail.com  yinyt@nju.edu.cn  yinyt@lamda.nju.edu.cn&lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= office&lt;br /&gt;
|data4= 蒙民伟楼 406&lt;br /&gt;
|header5 = Class&lt;br /&gt;
|label5  = &lt;br /&gt;
|data5   = &lt;br /&gt;
|header6 =&lt;br /&gt;
|label6  = Class meetings&lt;br /&gt;
|data6   = 8 am-10 am, Wednesday&lt;br /&gt;
|header7 =&lt;br /&gt;
|label7  = Place&lt;br /&gt;
|data7   = &lt;br /&gt;
|header8 =&lt;br /&gt;
|label8  = Office hours&lt;br /&gt;
|data8   = 2pm-5pm, Saturday, MMW 406 &lt;br /&gt;
|header9 = Textbook&lt;br /&gt;
|label9  = &lt;br /&gt;
|data9   = &lt;br /&gt;
|header10 =&lt;br /&gt;
|label10  = &lt;br /&gt;
|data10   = Motwani and Raghavan, &#039;&#039;Randomized Algorithms&#039;&#039;. Cambridge Univ Press, 1995.&lt;br /&gt;
&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the page for the class &#039;&#039;Randomized Algorithms&#039;&#039; for the Spring 2010 semester. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= Announcement =&lt;br /&gt;
There is no announcement yet.&lt;br /&gt;
&lt;br /&gt;
= Syllabus =&lt;br /&gt;
随机化（randomization）是现代计算机科学最重要的方法之一，近二十年来被广泛的应用于计算机科学的各个领域。在这些应用的背后，有一些共通的随机化原理。在随机算法这门课程中，我们将用数学的语言描述这些原理，将会讲授以下内容：&lt;br /&gt;
* 一些重要的随机算法的设计与分析；&lt;br /&gt;
* 概率论工具，其中包括概率分析的工具，也包括数学证明的概率方法 (the probabilistic method);&lt;br /&gt;
* 随机算法的概率模型，既包括一些算法模型，例如随机漫游 (random walks)，也包括复杂度模型——概率图灵机。&lt;br /&gt;
作为一门理论课程，这门课的内容偏重数学上的分析和证明。这么做的目的不仅仅是为了结果的严格性，而是因为设计一个聪明的算法通常都需要对问题本身的数学结构有深刻的认识。&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 Prerequisites ===&lt;br /&gt;
必须：离散数学，概率论。&lt;br /&gt;
推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== [[Randomized Algorithms (Spring 2010)/Course materials|教材和参考书 Course materials]] ===&lt;br /&gt;
&lt;br /&gt;
=== [[Randomized Algorithms (Spring 2010)/Policies|规则 Policies]] ===&lt;br /&gt;
&lt;br /&gt;
= Assignments =&lt;br /&gt;
There is no assignment yet.&lt;br /&gt;
&lt;br /&gt;
= Lecture Notes =&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)&amp;diff=263</id>
		<title>Randomized Algorithms (Spring 2010)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)&amp;diff=263"/>
		<updated>2009-12-27T16:43:13Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = 随机算法 &lt;br /&gt;
Randomized Algorithms&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = [[File:MR-randomized-algorithms.png|100px]]&lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &#039;&#039;Randomized Algorithms&#039;&#039; by Motwani and Raghavan&lt;br /&gt;
|captionstyle = &lt;br /&gt;
|headerstyle  = background:#ccf;&lt;br /&gt;
|labelstyle   = background:#ddf;&lt;br /&gt;
|datastyle    = &lt;br /&gt;
&lt;br /&gt;
|header1 =Instructor&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = 尹一通&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = Email&lt;br /&gt;
|data3   = yitong.yin@gmail.com  yinyt@nju.edu.cn  yinyt@lamda.nju.edu.cn&lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= office&lt;br /&gt;
|data4= 蒙民伟楼 406&lt;br /&gt;
|header5 = Class&lt;br /&gt;
|label5  = &lt;br /&gt;
|data5   = &lt;br /&gt;
|header6 =&lt;br /&gt;
|label6  = Class meetings&lt;br /&gt;
|data6   = 8 am-10 am, Wednesday&lt;br /&gt;
|header7 =&lt;br /&gt;
|label7  = Place&lt;br /&gt;
|data7   = &lt;br /&gt;
|header8 =&lt;br /&gt;
|label8  = Office hours&lt;br /&gt;
|data8   = 2pm-5pm, Saturday, MMW 406 &lt;br /&gt;
|header9 = Textbook&lt;br /&gt;
|label9  = &lt;br /&gt;
|data9   = &lt;br /&gt;
|header10 =&lt;br /&gt;
|label10  = &lt;br /&gt;
|data10   = Motwani and Raghavan, &#039;&#039;Randomized Algorithms&#039;&#039;. Cambridge Univ Press, 1995.&lt;br /&gt;
&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the page for the class &#039;&#039;Randomized Algorithms&#039;&#039; for the Spring 2010 semester. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= Announcement =&lt;br /&gt;
There is no announcement yet.&lt;br /&gt;
&lt;br /&gt;
= Syllabus =&lt;br /&gt;
随机化（randomization）是现代计算机科学最重要的方法之一，近二十年来被广泛的应用于计算机科学的各个领域。在这些应用的背后，有一些共通的随机化原理。在随机算法这门课程中，我们将用数学的语言描述这些原理，将会讲授以下内容：&lt;br /&gt;
* 一些重要的随机算法的设计与分析；&lt;br /&gt;
* 概率论工具，其中包括概率分析的工具，也包括数学证明的概率方法 (the probabilistic method);&lt;br /&gt;
* 随机算法的概率模型，既包括一些算法模型，例如随机漫游 (random walks)，也包括复杂度模型——概率图灵机。&lt;br /&gt;
作为一门理论课程，这门课的内容将着重于数学上的分析和证明。这么做的目的不仅仅是为了结果的严格性，而是因为设计一个聪明的算法通常都需要对问题本身的数学结构有深刻的认识。&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 Prerequisites ===&lt;br /&gt;
必须：离散数学，概率论。&lt;br /&gt;
推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== [[Randomized Algorithms (Spring 2010)/Course materials|教材和参考书 Course materials]] ===&lt;br /&gt;
&lt;br /&gt;
=== [[Randomized Algorithms (Spring 2010)/Policies|规则 Policies]] ===&lt;br /&gt;
&lt;br /&gt;
= Assignments =&lt;br /&gt;
There is no assignment yet.&lt;br /&gt;
&lt;br /&gt;
= Lecture Notes =&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)&amp;diff=262</id>
		<title>Randomized Algorithms (Spring 2010)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)&amp;diff=262"/>
		<updated>2009-12-27T16:41:53Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = 随机算法 &lt;br /&gt;
Randomized Algorithms&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = [[File:MR-randomized-algorithms.png|100px]]&lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &#039;&#039;Randomized Algorithms&#039;&#039; by Motwani and Raghavan&lt;br /&gt;
|captionstyle = &lt;br /&gt;
|headerstyle  = background:#ccf;&lt;br /&gt;
|labelstyle   = background:#ddf;&lt;br /&gt;
|datastyle    = &lt;br /&gt;
&lt;br /&gt;
|header1 =Instructor&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = 尹一通&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = Email&lt;br /&gt;
|data3   = yitong.yin@gmail.com  yinyt@nju.edu.cn  yinyt@lamda.nju.edu.cn&lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= office&lt;br /&gt;
|data4= 蒙民伟楼 406&lt;br /&gt;
|header5 = Class&lt;br /&gt;
|label5  = &lt;br /&gt;
|data5   = &lt;br /&gt;
|header6 =&lt;br /&gt;
|label6  = Class meetings&lt;br /&gt;
|data6   = 8 am-10 am, Wednesday&lt;br /&gt;
|header7 =&lt;br /&gt;
|label7  = Place&lt;br /&gt;
|data7   = &lt;br /&gt;
|header8 =&lt;br /&gt;
|label8  = Office hours&lt;br /&gt;
|data8   = 2pm-5pm, Saturday, MMW 406 &lt;br /&gt;
|header9 = Textbook&lt;br /&gt;
|label9  = &lt;br /&gt;
|data9   = &lt;br /&gt;
|header10 =&lt;br /&gt;
|label10  = &lt;br /&gt;
|data10   = Motwani and Raghavan, &#039;&#039;Randomized Algorithms&#039;&#039;. Cambridge Univ Press, 1995.&lt;br /&gt;
&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the page for the class &#039;&#039;Randomized Algorithms&#039;&#039; for the Spring 2010 semester. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= Announcement =&lt;br /&gt;
There is no announcement yet.&lt;br /&gt;
&lt;br /&gt;
= Syllabus =&lt;br /&gt;
随机化（randomization）是现代计算机科学最重要的方法之一，近二十年来被广泛的应用于计算机科学的各个领域。在这些应用的背后，有一些共通的随机化原理。在随机算法这门课程中，我们将用数学的语言描述这些原理，将会讲授以下内容：&lt;br /&gt;
* 一些重要的随机算法的设计与分析；&lt;br /&gt;
* 概率论工具，其中包括概率分析的工具，也包括数学证明的概率方法 (the probabilistic method);&lt;br /&gt;
* 随机算法的概率模型，既包括一些算法模型，例如随机漫游 (random walks)，也包括复杂度模型——概率图灵机。&lt;br /&gt;
作为一门理论课程，这门课的内容将更加侧重数学上的分析和证明。这么做的目的不仅仅是为了结果的严格性，而是因为设计一个聪明的算法通常都需要对问题本身的数学结构有深刻的认识。&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 Prerequisites ===&lt;br /&gt;
必须：离散数学，概率论。&lt;br /&gt;
推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== [[Randomized Algorithms (Spring 2010)/Course materials|教材和参考书 Course materials]] ===&lt;br /&gt;
&lt;br /&gt;
=== [[Randomized Algorithms (Spring 2010)/Policies|规则 Policies]] ===&lt;br /&gt;
&lt;br /&gt;
= Assignments =&lt;br /&gt;
There is no assignment yet.&lt;br /&gt;
&lt;br /&gt;
= Lecture Notes =&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Policies&amp;diff=535</id>
		<title>Randomized Algorithms (Spring 2010)/Policies</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Policies&amp;diff=535"/>
		<updated>2009-12-27T16:37:20Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 作业与考试 ==&lt;br /&gt;
本课程将会有六次作业和一次期末考试。最终成绩将由平时作业成绩和期末考试成绩综合得出。&lt;br /&gt;
&lt;br /&gt;
== 辅助材料的使用 ==&lt;br /&gt;
除了教材和讲义之外，学生也可以从其它学术出版物以及互联网获得有用的信息。在完成作业的过程中，允许参考各种书籍、论文、以及互联网页面来获得帮助，这种行为是被鼓励的，因为在解决实际问题的过程中，寻找有用的参考信息也是解决问题的一部分。但是，&#039;&#039;&#039;剽窃&#039;&#039;&#039;是不可容忍的。一旦发现剽窃行为，课程成绩将被取消。关于剽窃的定义，参见 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]。&lt;br /&gt;
&lt;br /&gt;
== 讨论 ==&lt;br /&gt;
学生可以通过各种方式——例如当面讨论，email，bbs等——讨论课程内容和作业中不懂的地方。但是署着你名字的工作（你的作业）必须是由你个人完成的，这既包括文本的书写，也包括关键难点的解决。任何形式的抄袭：文本抄袭以及关键思想的抄袭，将不被允许。一旦发现抄袭行为，&#039;&#039;&#039;抄袭和被抄袭双方的成绩都将被取消&#039;&#039;&#039;。如果你在完成作业的过程中，得到任何形式的帮助（讨论、建议、反馈等等），则需在提交文本中明确的致谢（acknowledge），指出受到何人何种形式的帮助。符合规则的致谢将不会影响你作业的分数。&lt;br /&gt;
&lt;br /&gt;
== 迟交 ==&lt;br /&gt;
如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Policies&amp;diff=534</id>
		<title>Randomized Algorithms (Spring 2010)/Policies</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Policies&amp;diff=534"/>
		<updated>2009-12-27T16:36:27Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 作业与考试 ==&lt;br /&gt;
本课程将会有六次作业和一次期末考试。最终成绩将由平时作业成绩和期末考试成绩综合得出。&lt;br /&gt;
&lt;br /&gt;
== 辅助材料的使用 ==&lt;br /&gt;
除了教材和讲义之外，学生也可以从其它学术出版物以及互联网获得有用的信息。在完成作业的过程中，允许参考各种书籍、论文、以及互联网页面来获得帮助，这种行为是被鼓励的，因为在解决实际问题的过程中，寻找有用的参考信息也是解决问题的一部分。但是，&#039;&#039;&#039;剽窃&#039;&#039;&#039;是不可容忍的。一旦发现剽窃行为，课程成绩将被取消。关于剽窃的定义，参见 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]。&lt;br /&gt;
&lt;br /&gt;
== 讨论 ==&lt;br /&gt;
学生可以通过各种方式——例如当面讨论，email，bbs等——讨论课程内容和作业中不懂的地方。但是署着你名字的工作（你的作业）必须是由你个人完成的，这既包括文本的书写，也包括关键难点的解决。任何形式的抄袭：文本抄袭以及关键思想的抄袭，将不被允许。一旦发现抄袭行为，&#039;&#039;&#039;抄袭和被抄袭双方的成绩都将被取消&#039;&#039;&#039;。如果你在完成作业的过程中，得到任何形式的帮助（讨论、建议、反馈等等），则需在提交文本中明确的致谢（acknowledge），指出受到何人何种形式的帮助。合适的致谢将不会影响你作业的分数。&lt;br /&gt;
&lt;br /&gt;
== 迟交 ==&lt;br /&gt;
如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Policies&amp;diff=533</id>
		<title>Randomized Algorithms (Spring 2010)/Policies</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)/Policies&amp;diff=533"/>
		<updated>2009-12-27T16:36:00Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: Created page with &amp;#039;== 作业与考试 == 本课程将会有六次作业和一次期末考试。最终成绩将由平时作业成绩和期末考试成绩综合得出。只参加期末考试的人将…&amp;#039;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 作业与考试 ==&lt;br /&gt;
本课程将会有六次作业和一次期末考试。最终成绩将由平时作业成绩和期末考试成绩综合得出。只参加期末考试的人将不会及格。&lt;br /&gt;
&lt;br /&gt;
== 辅助材料的使用 ==&lt;br /&gt;
除了教材和讲义之外，学生也可以从其它学术出版物以及互联网获得有用的信息。在完成作业的过程中，允许参考各种书籍、论文、以及互联网页面来获得帮助，这种行为是被鼓励的，因为在解决实际问题的过程中，寻找有用的参考信息也是解决问题的一部分。但是，&#039;&#039;&#039;剽窃&#039;&#039;&#039;是不可容忍的。一旦发现剽窃行为，课程成绩将被取消。关于剽窃的定义，参见 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]。&lt;br /&gt;
&lt;br /&gt;
== 讨论 ==&lt;br /&gt;
学生可以通过各种方式——例如当面讨论，email，bbs等——讨论课程内容和作业中不懂的地方。但是署着你名字的工作（你的作业）必须是由你个人完成的，这既包括文本的书写，也包括关键难点的解决。任何形式的抄袭：文本抄袭以及关键思想的抄袭，将不被允许。一旦发现抄袭行为，&#039;&#039;&#039;抄袭和被抄袭双方的成绩都将被取消&#039;&#039;&#039;。如果你在完成作业的过程中，得到任何形式的帮助（讨论、建议、反馈等等），则需在提交文本中明确的致谢（acknowledge），指出受到何人何种形式的帮助。合适的致谢将不会影响你作业的分数。&lt;br /&gt;
&lt;br /&gt;
== 迟交 ==&lt;br /&gt;
如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)&amp;diff=261</id>
		<title>Randomized Algorithms (Spring 2010)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Randomized_Algorithms_(Spring_2010)&amp;diff=261"/>
		<updated>2009-12-27T15:30:20Z</updated>

		<summary type="html">&lt;p&gt;210.28.131.14: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = 随机算法 &lt;br /&gt;
Randomized Algorithms&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = [[File:MR-randomized-algorithms.png|100px]]&lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &#039;&#039;Randomized Algorithms&#039;&#039; by Motwani and Raghavan&lt;br /&gt;
|captionstyle = &lt;br /&gt;
|headerstyle  = background:#ccf;&lt;br /&gt;
|labelstyle   = background:#ddf;&lt;br /&gt;
|datastyle    = &lt;br /&gt;
&lt;br /&gt;
|header1 =Instructor&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = 尹一通&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = Email&lt;br /&gt;
|data3   = yitong.yin@gmail.com  yinyt@nju.edu.cn  yinyt@lamda.nju.edu.cn&lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= office&lt;br /&gt;
|data4= 蒙民伟楼 406&lt;br /&gt;
|header5 = Class&lt;br /&gt;
|label5  = &lt;br /&gt;
|data5   = &lt;br /&gt;
|header6 =&lt;br /&gt;
|label6  = Class meetings&lt;br /&gt;
|data6   = 8 am-10 am, Wednesday&lt;br /&gt;
|header7 =&lt;br /&gt;
|label7  = Place&lt;br /&gt;
|data7   = &lt;br /&gt;
|header8 =&lt;br /&gt;
|label8  = Office hours&lt;br /&gt;
|data8   = 2pm-5pm, Saturday, MMW 406 &lt;br /&gt;
|header9 = Textbook&lt;br /&gt;
|label9  = &lt;br /&gt;
|data9   = &lt;br /&gt;
|header10 =&lt;br /&gt;
|label10  = &lt;br /&gt;
|data10   = Motwani and Raghavan, &#039;&#039;Randomized Algorithms&#039;&#039;. Cambridge Univ Press, 1995.&lt;br /&gt;
&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the page for the class &#039;&#039;Randomized Algorithms&#039;&#039; for the Spring 2010 semester. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= Announcement =&lt;br /&gt;
There is no announcement yet.&lt;br /&gt;
&lt;br /&gt;
= Syllabus =&lt;br /&gt;
随机化（randomization）是现代计算机科学最重要的方法之一，近二十年来被广泛的应用于计算机科学的各个领域。在这些重要应用的背后，有着彼此相通的随机化的原理。在随机算法这门课程中，我们将用数学的语言描述这些原理，将会讲授以下内容：&lt;br /&gt;
* 一些重要的随机算法的设计与分析；&lt;br /&gt;
* 概率论工具，其中包括概率分析的工具，也包括数学证明的概率方法 (the probabilistic method);&lt;br /&gt;
* 随机算法的概率模型，既包括一些算法模型，例如随机漫游 (random walks)，也包括复杂度模型——概率图灵机。&lt;br /&gt;
作为一门理论课程，这门课的内容将更加侧重数学上的分析和证明。这么做的目的不仅仅是为了结果的严格性，而是因为设计一个聪明的算法通常都需要对问题本身的数学结构有深刻的认识。&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 Prerequisites ===&lt;br /&gt;
必须：离散数学，概率论。&lt;br /&gt;
推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== [[Randomized Algorithms (Spring 2010)/Course materials|教材和参考书 Course materials]] ===&lt;br /&gt;
&lt;br /&gt;
=== [[Randomized Algorithms (Spring 2010)/Policies|规则 Policies]] ===&lt;br /&gt;
&lt;br /&gt;
= Assignments =&lt;br /&gt;
There is no assignment yet.&lt;br /&gt;
&lt;br /&gt;
= Lecture Notes =&lt;/div&gt;</summary>
		<author><name>210.28.131.14</name></author>
	</entry>
</feed>