<?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=Liumingmou</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=Liumingmou"/>
	<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Special:Contributions/Liumingmou"/>
	<updated>2026-06-18T09:55:12Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13830</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13830"/>
		<updated>2026-06-15T10:26:56Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;小题均为提示性质，小题越多越简单。&lt;br /&gt;
&lt;br /&gt;
== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
#证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
#解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x-\Pi y\|_2^2-\|x-y\|_2^2\right|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x\|_2^2-1\right|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(\|\Pi x\|_2\|\Pi y\|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
#解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
#讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E\|\Pi x\|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
#现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
#总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=\Omega(d^2)&amp;lt;/math&amp;gt; 下界==&lt;br /&gt;
&lt;br /&gt;
假设 &amp;lt;math&amp;gt;n\gg d&amp;lt;/math&amp;gt;（不妨假设 &amp;lt;math&amp;gt;n&amp;gt;2^d&amp;lt;/math&amp;gt;）。考虑使用一个 column sparsity 只有 &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; （即，每一列只有一个非零元素） 的矩阵 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 进行 Oblivious Subspace Embedding (OSE)。考虑这样的&#039;&#039;&#039;随机&#039;&#039;&#039;矩阵 &amp;lt;math&amp;gt;A\in \{0,1\}^{n\times d}&amp;lt;/math&amp;gt;： &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; 的每一列随机选择一个位置为 &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。尝试证明，任意&#039;&#039;&#039;确定&#039;&#039;&#039;的 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 为&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;的列空间进行子空间嵌入都至少需要 &amp;lt;math&amp;gt;m=\Omega(d^2)&amp;lt;/math&amp;gt; ，即它作为 OSE 不可能降维到 &amp;lt;math&amp;gt;o(d^2)&amp;lt;/math&amp;gt;。提示：尝试观察 &amp;lt;math&amp;gt;\Pi Ae_i, \Pi A(e_i+e_j)&amp;lt;/math&amp;gt; 的 &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;-norm，以及你可能需要应用 birthday paradox（随机地把 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 个球丢入 &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; 个桶中，那么要满足 &amp;lt;math&amp;gt;m=\Omega(d^2)&amp;lt;/math&amp;gt; 才能使得有 &amp;lt;math&amp;gt;\Omega(1)&amp;lt;/math&amp;gt;的概率，这 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 个球中不会有两个球被丢进了同一个桶中）。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2/\epsilon^2\delta)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
#推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j:h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明在计算 &amp;lt;math&amp;gt;\mathbb E[\|U^\top\Pi^\top\Pi U-I_d\|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E[\|U^\top\Pi^\top\Pi U-I_d\|_F^2]\le \frac{1}{m}\sum_{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
#使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;\|U^\top\Pi^\top\Pi U-I_d\|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;\|U^\top\Pi^\top\Pi U-I_d\|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|Ux\|_2^2\le \|\Pi Ux\|_2^2\le (1+\epsilon)\|Ux\|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
#总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13829</id>
		<title>计算理论之美 (Summer 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13829"/>
		<updated>2026-06-15T10:25:50Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox &lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|headerstyle  = background:#4D72BE;&lt;br /&gt;
|labelstyle   = background:#DAE1F0;&lt;br /&gt;
&lt;br /&gt;
|header1 = &amp;lt;font size=3, color=white&amp;gt;计算理论之美&amp;lt;/font&amp;gt;&lt;br /&gt;
|label2  = {{Nowrap|负责人}} &lt;br /&gt;
|data2   = 黄棱潇 ([mailto:huanglingxiao@nju.edu.cn huanglingxiao@nju.edu.cn]) &lt;br /&gt;
|label4 = 时间&lt;br /&gt;
|data4  = 2026.7.24 — 2026.7.27&lt;br /&gt;
|label5 = 地点&lt;br /&gt;
|data5  = {{Nowrap|南京大学苏州校区 TBA}}&lt;br /&gt;
|belowstyle = background:#DAE1F0;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
由南京大学计算机学院和智能软件学院支持的第5届“计算理论之美”暑期讲习班将于2026年7月24日至7月27日在江苏省苏州市南京大学苏州校区开班。本次讲习班将围绕算法设计主题开展系列报告，包括组合最优化、哈希表、差分隐私、量子计算、数据结构复杂性、图计算等板块，主要面向对理论计算机科学以及计算机科学中的数学感兴趣的国内外本科生，安排4天的高级课程。内容深入浅出，由国内外一线的优秀学者讲授，使学员初步了解理论计算机科学的一些研究前沿、初步掌握一些新理论与新方法，为有志于从事理论计算机科学研究的学者打下一定的基础，也让从事其他相关方向研究的学生与教师们领略计算理论的魅力。&lt;br /&gt;
&lt;br /&gt;
联系邮箱：nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
联系人：&lt;br /&gt;
* 黄棱潇：	huanglingxiao@nju.edu.cn&lt;br /&gt;
* 刘明谋：	lmm@nju.edu.cn&lt;br /&gt;
* 班吟：		175227530@qq.com&lt;br /&gt;
&lt;br /&gt;
注册报名流程：由于前几届报名人数过多，本届将会采用问卷初筛形式进行报名。请同学们先填写以下调查问卷:&lt;br /&gt;
&lt;br /&gt;
https://table.nju.edu.cn/external-apps/9ea2fbd7-8ac8-45dd-b5bf-fbdb887989be/?page_id=9UIB&lt;br /&gt;
&lt;br /&gt;
问卷报名截止日期： 2026.6.20&lt;br /&gt;
&lt;br /&gt;
通过初筛的同学将于讲习班开始前两周收到包含报名链接的邮件。由于今年讲习班将在苏州校区举办，南京校区的南大同学如需统一安排住宿，也请填写问卷；无需安排住宿的南大同学，&#039;&#039;&#039;无需填写问卷或报名，可在讲习班期间直接前往会场听取报告。&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
费用：本科生包住宿，非本科生不包含住宿。餐费自理。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tentative Schedule ==&lt;br /&gt;
&lt;br /&gt;
Venue (地点)：南京大学苏州校区TBA&lt;br /&gt;
&lt;br /&gt;
Group photo: 7月24日上午茶歇环节中安排参会者合影留念&lt;br /&gt;
&lt;br /&gt;
Speakers (in lexicographic order): 陈林（浙江大学）、刘明谋（南京大学）、Pasin Manurangsi（Google Research）、任瀚林（IAS）、王启圣（上海交通大学）、俞华程（普林斯顿大学）、张天翼（南京大学）、TBD&lt;br /&gt;
&lt;br /&gt;
== Take-home Exams ==&lt;br /&gt;
成绩优秀的同学可推荐参加南京大学计算机学院预推免保研面试，并在录取后可凭借此次暑期讲习班申请两个研究生学分。&lt;br /&gt;
&lt;br /&gt;
作业提交方式：发送电子版到邮箱nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
== Links to Past Summer Schools ==&lt;br /&gt;
* [[计算理论之美 (Summer 2025)|计算理论之美暑期学校 (Summer 2025)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2024)|计算理论之美暑期学校 (Summer 2024)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2023)|计算理论之美暑期学校 (Summer 2023)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2021)|计算理论之美暑期学校 (Summer 2021)]]&lt;br /&gt;
&lt;br /&gt;
== About Our Summer School ==&lt;br /&gt;
Our summer school is supported by the School of Computer Science and the School of Intelligent Software and Engineering at Nanjing University and will be held from July 24th to July 27th, 2026, at the Suzhou Campus of Nanjing University in Suzhou, Jiangsu Province, China. The theme of this year&#039;s summer school will be the design and analysis of algorithms, with topics ranging from combinatorial optimization, hash table design, differential privacy, quantum computing, data structure compelxity, and graph algorithms etc. &lt;br /&gt;
Target audience will include aspiring undergraduate and graduate students from China and overseas, and the program will feature 4 days of advanced courses. The courses will be presented by leading young scholars both from within China and overseas, covering both cutting-edge research and modern toolkits in theoretical computer science. &lt;br /&gt;
The summer school will help connect aspiring young students with young scholars to engage research in theoretical computer science, and embark on a journey to appreciate the charm of computational theory.&lt;br /&gt;
&lt;br /&gt;
Accommodation (shared room) will be provided to undergraduates only.&lt;br /&gt;
&lt;br /&gt;
Due to capacity, we prioritize undergraduates seeking to join NJU TCS group for PhD or for a research intern. To register, please fill out the following form: https://table.nju.edu.cn/external-apps/9ea2fbd7-8ac8-45dd-b5bf-fbdb887989be/?page_id=9UIB&lt;br /&gt;
&lt;br /&gt;
If you are selected into our summer school, you will receive a confirmation email.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13828</id>
		<title>计算理论之美 (Summer 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13828"/>
		<updated>2026-06-15T10:25:41Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox &lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|headerstyle  = background:#4D72BE;&lt;br /&gt;
|labelstyle   = background:#DAE1F0;&lt;br /&gt;
&lt;br /&gt;
|header1 = &amp;lt;font size=3, color=white&amp;gt;计算理论之美&amp;lt;/font&amp;gt;&lt;br /&gt;
|label2  = {{Nowrap|负责人}} &lt;br /&gt;
|data2   = 黄棱潇 ([mailto:huanglingxiao@nju.edu.cn huanglingxiao@nju.edu.cn]) &lt;br /&gt;
|label4 = 时间&lt;br /&gt;
|data4  = 2026.7.24 — 2026.7.27&lt;br /&gt;
|label5 = 地点&lt;br /&gt;
|data5  = {{Nowrap|南京大学苏州校区 TBA}}&lt;br /&gt;
|belowstyle = background:#DAE1F0;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
由南京大学计算机学院和智能软件学院支持的第5届“计算理论之美”暑期讲习班将于2026年7月24日至7月27日在江苏省苏州市南京大学苏州校区开班。本次讲习班将围绕算法设计主题开展系列报告，包括组合最优化、哈希表、差分隐私、量子计算、数据结构复杂性、图计算等板块，主要面向对理论计算机科学以及计算机科学中的数学感兴趣的国内外本科生，安排4天的高级课程。内容深入浅出，由国内外一线的优秀学者讲授，使学员初步了解理论计算机科学的一些研究前沿、初步掌握一些新理论与新方法，为有志于从事理论计算机科学研究的学者打下一定的基础，也让从事其他相关方向研究的学生与教师们领略计算理论的魅力。&lt;br /&gt;
&lt;br /&gt;
联系邮箱：nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
联系人：&lt;br /&gt;
* 黄棱潇：	huanglingxiao@nju.edu.cn&lt;br /&gt;
* 刘明谋：	lmm@nju.edu.cn&lt;br /&gt;
* 班吟：		175227530@qq.com&lt;br /&gt;
&lt;br /&gt;
注册报名流程：由于前几届报名人数过多，本届将会采用问卷初筛形式进行报名。请同学们先填写以下调查问卷:&lt;br /&gt;
&lt;br /&gt;
https://table.nju.edu.cn/external-apps/9ea2fbd7-8ac8-45dd-b5bf-fbdb887989be/?page_id=9UIB&lt;br /&gt;
&lt;br /&gt;
问卷报名截止日期： 2026.6.20&lt;br /&gt;
&lt;br /&gt;
通过初筛的同学将于讲习班开始前两周收到包含报名链接的邮件。由于今年讲习班将在苏州校区举办，南京校区的南大同学如需统一安排住宿，也请填写问卷；无需安排住宿的南大同学，&#039;&#039;&#039;无需填写问卷或报名，可在讲习班期间直接前往会场听取报告。&#039;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
费用：本科生包住宿，非本科生不包含住宿。餐费自理。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tentative Schedule ==&lt;br /&gt;
&lt;br /&gt;
Venue (地点)：南京大学苏州校区TBA&lt;br /&gt;
&lt;br /&gt;
Group photo: 7月24日上午茶歇环节中安排参会者合影留念&lt;br /&gt;
&lt;br /&gt;
Speakers (in lexicographic order): 陈林（浙江大学）、刘明谋（南京大学）、Pasin Manurangsi（Google Research）、任瀚林（IAS）、王启圣（上海交通大学）、俞华程（普林斯顿大学）、张天翼（南京大学）、TBD&lt;br /&gt;
&lt;br /&gt;
== Take-home Exams ==&lt;br /&gt;
成绩优秀的同学可推荐参加南京大学计算机学院预推免保研面试，并在录取后可凭借此次暑期讲习班申请两个研究生学分。&lt;br /&gt;
&lt;br /&gt;
作业提交方式：发送电子版到邮箱nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
== Links to Past Summer Schools ==&lt;br /&gt;
* [[计算理论之美 (Summer 2025)|计算理论之美暑期学校 (Summer 2025)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2024)|计算理论之美暑期学校 (Summer 2024)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2023)|计算理论之美暑期学校 (Summer 2023)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2021)|计算理论之美暑期学校 (Summer 2021)]]&lt;br /&gt;
&lt;br /&gt;
== About Our Summer School ==&lt;br /&gt;
Our summer school is supported by the School of Computer Science and the School of Intelligent Software and Engineering at Nanjing University and will be held from July 24th to July 27th, 2026, at the Suzhou Campus of Nanjing University in Suzhou, Jiangsu Province, China. The theme of this year&#039;s summer school will be the design and analysis of algorithms, with topics ranging from combinatorial optimization, hash table design, differential privacy, quantum computing, data structure compelxity, and graph algorithms etc. &lt;br /&gt;
Target audience will include aspiring undergraduate and graduate students from China and overseas, and the program will feature 4 days of advanced courses. The courses will be presented by leading young scholars both from within China and overseas, covering both cutting-edge research and modern toolkits in theoretical computer science. &lt;br /&gt;
The summer school will help connect aspiring young students with young scholars to engage research in theoretical computer science, and embark on a journey to appreciate the charm of computational theory.&lt;br /&gt;
&lt;br /&gt;
Accommodation (shared room) will be provided to undergraduates only.&lt;br /&gt;
&lt;br /&gt;
Due to capacity, we prioritize undergraduates seeking to join NJU TCS group for PhD or for a research intern. To register, please fill out the following form: https://table.nju.edu.cn/external-apps/9ea2fbd7-8ac8-45dd-b5bf-fbdb887989be/?page_id=9UIB&lt;br /&gt;
&lt;br /&gt;
If you are selected into our summer school, you will receive a confirmation email.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13826</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13826"/>
		<updated>2026-06-14T14:56:59Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* CountSketch OSE 的 m=\Omega(d^2) 上界 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
#证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
#解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x-\Pi y\|_2^2-\|x-y\|_2^2\right|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x\|_2^2-1\right|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(\|\Pi x\|_2\|\Pi y\|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
#解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
#讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E\|\Pi x\|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
#现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
#总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=\Omega(d^2)&amp;lt;/math&amp;gt; 下界==&lt;br /&gt;
&lt;br /&gt;
假设 &amp;lt;math&amp;gt;n\gg d&amp;lt;/math&amp;gt;（不妨假设 &amp;lt;math&amp;gt;n&amp;gt;2^d&amp;lt;/math&amp;gt;）。考虑使用一个 column sparsity 只有 &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; （即，每一列只有一个非零元素） 的矩阵 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 进行 Oblivious Subspace Embedding (OSE)。考虑这样的&#039;&#039;&#039;随机&#039;&#039;&#039;矩阵 &amp;lt;math&amp;gt;A\in \{0,1\}^{n\times d}&amp;lt;/math&amp;gt;： &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; 的每一列随机选择一个位置为 &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。尝试证明，任意&#039;&#039;&#039;确定&#039;&#039;&#039;的 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 为&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;的列空间进行子空间嵌入都至少需要 &amp;lt;math&amp;gt;m=\Omega(d^2)&amp;lt;/math&amp;gt; ，即它作为 OSE 不可能降维到 &amp;lt;math&amp;gt;o(d^2)&amp;lt;/math&amp;gt;。提示：尝试观察 &amp;lt;math&amp;gt;\Pi Ae_i, \Pi A(e_i+e_j)&amp;lt;/math&amp;gt; 的 &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;-norm，以及你可能需要应用 birthday paradox（随机地把 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 个球丢入 &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; 个桶中，那么要满足 &amp;lt;math&amp;gt;m=\Omega(d^2)&amp;lt;/math&amp;gt; 才能使得有 &amp;lt;math&amp;gt;\Omega(1)&amp;lt;/math&amp;gt;的概率，这 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 个球中不会有两个球被丢进了同一个桶中）。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2/\epsilon^2\delta)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
#推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j:h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明在计算 &amp;lt;math&amp;gt;\mathbb E[\|U^\top\Pi^\top\Pi U-I_d\|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E[\|U^\top\Pi^\top\Pi U-I_d\|_F^2]\le \frac{1}{m}\sum_{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
#使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;\|U^\top\Pi^\top\Pi U-I_d\|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;\|U^\top\Pi^\top\Pi U-I_d\|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|Ux\|_2^2\le \|\Pi Ux\|_2^2\le (1+\epsilon)\|Ux\|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
#总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13825</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13825"/>
		<updated>2026-06-14T14:56:31Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
#证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
#解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x-\Pi y\|_2^2-\|x-y\|_2^2\right|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x\|_2^2-1\right|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(\|\Pi x\|_2\|\Pi y\|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
#解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
#讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E\|\Pi x\|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
#现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
#总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=\Omega(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
假设 &amp;lt;math&amp;gt;n\gg d&amp;lt;/math&amp;gt;（不妨假设 &amp;lt;math&amp;gt;n&amp;gt;2^d&amp;lt;/math&amp;gt;）。考虑使用一个 column sparsity 只有 &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt; （即，每一列只有一个非零元素） 的矩阵 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 进行 Oblivious Subspace Embedding (OSE)。考虑这样的&#039;&#039;&#039;随机&#039;&#039;&#039;矩阵 &amp;lt;math&amp;gt;A\in \{0,1\}^{n\times d}&amp;lt;/math&amp;gt;： &amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt; 的每一列随机选择一个位置为 &amp;lt;math&amp;gt;1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。尝试证明，任意&#039;&#039;&#039;确定&#039;&#039;&#039;的 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 为&amp;lt;math&amp;gt;A&amp;lt;/math&amp;gt;的列空间进行子空间嵌入都至少需要 &amp;lt;math&amp;gt;m=\Omega(d^2)&amp;lt;/math&amp;gt; ，即它作为 OSE 不可能降维到 &amp;lt;math&amp;gt;o(d^2)&amp;lt;/math&amp;gt;。提示：尝试观察 &amp;lt;math&amp;gt;\Pi Ae_i, \Pi A(e_i+e_j)&amp;lt;/math&amp;gt; 的 &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt;-norm，以及你可能需要应用 birthday paradox（随机地把 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 个球丢入 &amp;lt;math&amp;gt;m&amp;lt;/math&amp;gt; 个桶中，那么要满足 &amp;lt;math&amp;gt;m=\Omega(d^2)&amp;lt;/math&amp;gt; 才能使得有 &amp;lt;math&amp;gt;\Omega(1)&amp;lt;/math&amp;gt;的概率，这 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 个球中不会有两个球被丢进了同一个桶中）。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2/\epsilon^2\delta)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
#推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j:h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明在计算 &amp;lt;math&amp;gt;\mathbb E[\|U^\top\Pi^\top\Pi U-I_d\|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E[\|U^\top\Pi^\top\Pi U-I_d\|_F^2]\le \frac{1}{m}\sum_{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
#使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;\|U^\top\Pi^\top\Pi U-I_d\|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;\|U^\top\Pi^\top\Pi U-I_d\|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|Ux\|_2^2\le \|\Pi Ux\|_2^2\le (1+\epsilon)\|Ux\|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
#总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13824</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13824"/>
		<updated>2026-06-14T14:55:21Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* CountSketch OSE 的 m=O(d^2) 上界 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
#证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
#解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x-\Pi y\|_2^2-\|x-y\|_2^2\right|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x\|_2^2-1\right|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(\|\Pi x\|_2\|\Pi y\|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
#解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
#讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E\|\Pi x\|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
#现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
#总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
#推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j:h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明在计算 &amp;lt;math&amp;gt;\mathbb E[\|U^\top\Pi^\top\Pi U-I_d\|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E[\|U^\top\Pi^\top\Pi U-I_d\|_F^2]\le \frac{1}{m}\sum_{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
#使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;\|U^\top\Pi^\top\Pi U-I_d\|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;\|U^\top\Pi^\top\Pi U-I_d\|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|Ux\|_2^2\le \|\Pi Ux\|_2^2\le (1+\epsilon)\|Ux\|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
#总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13823</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13823"/>
		<updated>2026-06-14T14:54:08Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* CountSketch OSE 的 m=O(d^2) 上界 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
#证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
#解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x-\Pi y\|_2^2-\|x-y\|_2^2\right|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x\|_2^2-1\right|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(\|\Pi x\|_2\|\Pi y\|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
#解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
#讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E\|\Pi x\|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
#现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
#总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
#推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明在计算 &amp;lt;math&amp;gt;\mathbb E[\|U^\top\Pi^\top\Pi U-I_d\|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E[\|U^\top\Pi^\top\Pi U-I_d\|_F^2]\le \frac{1}{m}\sum_{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
#使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;\|U^\top\Pi^\top\Pi U-I_d\|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;\|U^\top\Pi^\top\Pi U-I_d\|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|Ux\|_2^2\le \|\Pi Ux\|_2^2\le (1+\epsilon)\|Ux\|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
#总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13822</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13822"/>
		<updated>2026-06-14T14:51:32Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 为什么 CountSketch 需要随机符号 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
#证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
#解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x-\Pi y\|_2^2-\|x-y\|_2^2\right|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x\|_2^2-1\right|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(\|\Pi x\|_2\|\Pi y\|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
#解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
#讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\mathbb E\|\Pi x\|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
#说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
#现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in\{-1,1\}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
#总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13821</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13821"/>
		<updated>2026-06-14T14:50:17Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 先用 JL 降维，再做随机超平面 LSH */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
#证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
#解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x-\Pi y\|_2^2-\|x-y\|_2^2\right|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;\left|\|\Pi x\|_2^2-1\right|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(\|\Pi x\|_2\|\Pi y\|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
#解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
#讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13820</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13820"/>
		<updated>2026-06-14T14:48:53Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* torus 上随机网格 LSH 的维数影响 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
#证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
#解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13819</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13819"/>
		<updated>2026-06-14T14:48:44Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* torus 上的随机网格 LSH */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
#证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
#解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==torus 上随机网格 LSH 的维数影响==&lt;br /&gt;
&lt;br /&gt;
继续考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。使用前述题目中的随机平移网格 hash function &amp;lt;math&amp;gt;h_s&amp;lt;/math&amp;gt;，其中网格宽度为 &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13818</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13818"/>
		<updated>2026-06-14T14:48:06Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
#证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
#解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
#如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==torus 上随机网格 LSH 的维数影响==&lt;br /&gt;
&lt;br /&gt;
继续考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。使用前述题目中的随机平移网格 hash function &amp;lt;math&amp;gt;h_s&amp;lt;/math&amp;gt;，其中网格宽度为 &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13817</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13817"/>
		<updated>2026-06-14T14:47:49Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* torus 上随机网格 LSH 的维数影响 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
(1) 证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==torus 上随机网格 LSH 的维数影响==&lt;br /&gt;
&lt;br /&gt;
继续考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。使用前述题目中的随机平移网格 hash function &amp;lt;math&amp;gt;h_s&amp;lt;/math&amp;gt;，其中网格宽度为 &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
#设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
#比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
#解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13816</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13816"/>
		<updated>2026-06-14T14:43:58Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 球面上的随机超平面 LSH */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
#现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
#给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
(1) 证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==torus 上随机网格 LSH 的维数影响==&lt;br /&gt;
&lt;br /&gt;
继续考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。使用题目 4 中的随机平移网格 hash function &amp;lt;math&amp;gt;h_s&amp;lt;/math&amp;gt;，其中网格宽度为 &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
&lt;br /&gt;
(3) 比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
&lt;br /&gt;
(4) 解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13815</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13815"/>
		<updated>2026-06-14T14:43:46Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* torus 上的随机网格 LSH */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
#对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
#解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
#讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
&lt;br /&gt;
(3) 现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
(1) 证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==torus 上随机网格 LSH 的维数影响==&lt;br /&gt;
&lt;br /&gt;
继续考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。使用题目 4 中的随机平移网格 hash function &amp;lt;math&amp;gt;h_s&amp;lt;/math&amp;gt;，其中网格宽度为 &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
&lt;br /&gt;
(3) 比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
&lt;br /&gt;
(4) 解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13814</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13814"/>
		<updated>2026-06-14T14:43:33Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 低 \ell_\infty-norm 对高斯 JL 变换没有帮助 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
#证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
#解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
#对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
(1) 对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
&lt;br /&gt;
(3) 现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
(1) 证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==torus 上随机网格 LSH 的维数影响==&lt;br /&gt;
&lt;br /&gt;
继续考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。使用题目 4 中的随机平移网格 hash function &amp;lt;math&amp;gt;h_s&amp;lt;/math&amp;gt;，其中网格宽度为 &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
&lt;br /&gt;
(3) 比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
&lt;br /&gt;
(4) 解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13813</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13813"/>
		<updated>2026-06-14T14:43:17Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 由范数保持推出内积保持 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
(1) 对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
&lt;br /&gt;
(3) 现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)\|v\|_2^2\le \|\Pi v\|_2^2\le (1+\epsilon)\|v\|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
#使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(\|x+y\|_2^2-\|x-y\|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(\|x\|_2^2+\|y\|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 在 &amp;lt;math&amp;gt;\|x\|_2=\|y\|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
# 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
# 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
(1) 证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==torus 上随机网格 LSH 的维数影响==&lt;br /&gt;
&lt;br /&gt;
继续考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。使用题目 4 中的随机平移网格 hash function &amp;lt;math&amp;gt;h_s&amp;lt;/math&amp;gt;，其中网格宽度为 &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
&lt;br /&gt;
(3) 比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
&lt;br /&gt;
(4) 解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13812</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13812"/>
		<updated>2026-06-14T14:41:45Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* torus 上的随机网格 LSH */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
(1) 对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min\{|x_i-y_i|,n-|x_i-y_i|\}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
&lt;br /&gt;
(3) 现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|v|_2^2\le |\Pi v|_2^2\le (1+\epsilon)|v|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(|x+y|_2^2-|x-y|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(|x|_2^2+|y|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 在 &amp;lt;math&amp;gt;|x|_2=|y|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
&lt;br /&gt;
(4) 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
(1) 证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==torus 上随机网格 LSH 的维数影响==&lt;br /&gt;
&lt;br /&gt;
继续考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。使用题目 4 中的随机平移网格 hash function &amp;lt;math&amp;gt;h_s&amp;lt;/math&amp;gt;，其中网格宽度为 &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
&lt;br /&gt;
(3) 比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
&lt;br /&gt;
(4) 解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13811</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13811"/>
		<updated>2026-06-14T14:38:07Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 低 \ell_\infty-norm 对高斯 JL 变换没有帮助 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 证明 &amp;lt;math&amp;gt;\|\Pi x\|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;\|\Pi x\|_2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;\|x\|_\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;\|x\|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[\|\Pi x\|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 对比坐标采样型（即 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt;直接随机输出 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt;的某几个维度）降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
(1) 对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min{|x_i-y_i|,n-|x_i-y_i|}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
&lt;br /&gt;
(3) 现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|v|_2^2\le |\Pi v|_2^2\le (1+\epsilon)|v|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(|x+y|_2^2-|x-y|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(|x|_2^2+|y|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 在 &amp;lt;math&amp;gt;|x|_2=|y|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
&lt;br /&gt;
(4) 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
(1) 证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==torus 上随机网格 LSH 的维数影响==&lt;br /&gt;
&lt;br /&gt;
继续考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。使用题目 4 中的随机平移网格 hash function &amp;lt;math&amp;gt;h_s&amp;lt;/math&amp;gt;，其中网格宽度为 &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
&lt;br /&gt;
(3) 比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
&lt;br /&gt;
(4) 解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13810</id>
		<title>高级算法 (Spring 2026)/作业3</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E4%BD%9C%E4%B8%9A3&amp;diff=13810"/>
		<updated>2026-06-14T14:35:47Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: Created page with &amp;quot;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==  令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。  (1) 证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。  (2) 证明 &amp;lt;math&amp;gt;|\Pi x|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;|...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== 低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对高斯 JL 变换没有帮助==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;\Pi \in \mathbb R^{m\times d}&amp;lt;/math&amp;gt; 是一个高斯 Johnson-Lindenstrauss 变换，其中每个元素独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。给定任意固定单位向量 &amp;lt;math&amp;gt;x\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi x&amp;lt;/math&amp;gt; 的每个坐标都独立服从 &amp;lt;math&amp;gt;N(0,1/m)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 证明 &amp;lt;math&amp;gt;|\Pi x|_2^2&amp;lt;/math&amp;gt; 与 &amp;lt;math&amp;gt;\frac{1}{m}\chi_m^2&amp;lt;/math&amp;gt; 同分布。因此 &amp;lt;math&amp;gt;|\Pi x|*2^2&amp;lt;/math&amp;gt; 的分布与 &amp;lt;math&amp;gt;|x|*\infty&amp;lt;/math&amp;gt; 无关。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么如果使用高斯 JL 变换，即使 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 满足很强的平坦性条件，例如 &amp;lt;math&amp;gt;|x|_\infty \le O(1/\sqrt d)&amp;lt;/math&amp;gt;，为了保证 &amp;lt;math&amp;gt;\mathbb P[||\Pi x|_2^2-1|&amp;gt;\epsilon]\le \delta&amp;lt;/math&amp;gt;，所需的目标维数仍然是 &amp;lt;math&amp;gt;m=\Theta(\epsilon^{-2}\log(1/\delta))&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 对比坐标采样型降维，简要解释为什么低 &amp;lt;math&amp;gt;\ell_\infty&amp;lt;/math&amp;gt;-norm 对坐标采样有帮助，但对高斯 JL 变换没有帮助。&lt;br /&gt;
&lt;br /&gt;
==torus 上的随机网格 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。给定网格宽度 &amp;lt;math&amp;gt;w&amp;gt;0&amp;lt;/math&amp;gt;。随机选择平移向量 &amp;lt;math&amp;gt;s\in[0,w)^d&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_s(x)=(\lfloor (x_1+s_1)/w\rfloor,\dots,\lfloor (x_d+s_d)/w\rfloor)&amp;lt;/math&amp;gt;，其中每个坐标都按照 torus 的方式取模。&lt;br /&gt;
&lt;br /&gt;
(1) 对于两个点 &amp;lt;math&amp;gt;x,y\in[0,n]^d&amp;lt;/math&amp;gt;，记 &amp;lt;math&amp;gt;\Delta_i=\min{|x_i-y_i|,n-|x_i-y_i|}&amp;lt;/math&amp;gt;。证明如果对所有 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;\Delta_i&amp;lt;w&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]=\prod_{i=1}^d (1-\Delta_i/w)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 证明如果 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)\le r&amp;lt;/math&amp;gt;，那么 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]\ge 1-\sqrt d,r/w&amp;lt;/math&amp;gt;。提示：可以使用 &amp;lt;math&amp;gt;\sum_i\Delta_i\le \sqrt d\sqrt{\sum_i\Delta_i^2}&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么这个 LSH family 的随机桶可以看成随机平移后的 axis-aligned cube。请从“近点容易落在同一个随机集合中，远点不容易落在同一个随机集合中”的角度解释这个构造的直觉。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论这个构造在高维空间中的局限性。特别地，当距离 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)&amp;lt;/math&amp;gt; 分散在很多个坐标上时，为什么随机网格更容易把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 切开？&lt;br /&gt;
&lt;br /&gt;
==球面上的随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
考虑球面空间 &amp;lt;math&amp;gt;(\mathbb S^{d-1},d)&amp;lt;/math&amp;gt;，其中距离定义为 &amp;lt;math&amp;gt;d(x,y)=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。随机选择 &amp;lt;math&amp;gt;g\sim N(0,I_d)&amp;lt;/math&amp;gt;，并定义 hash function &amp;lt;math&amp;gt;h_g(x)=\operatorname{sign}\langle g,x\rangle&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 对任意 &amp;lt;math&amp;gt;x,y\in\mathbb S^{d-1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[h_g(x)=h_g(y)]=1-\theta/\pi&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 解释上述公式的几何直觉：随机超平面什么时候会把 &amp;lt;math&amp;gt;x&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;y&amp;lt;/math&amp;gt; 分到两侧？&lt;br /&gt;
&lt;br /&gt;
(3) 现在使用 &amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; 个独立随机超平面 &amp;lt;math&amp;gt;g_1,\dots,g_k&amp;lt;/math&amp;gt;，并定义组合 hash key 为 &amp;lt;math&amp;gt;H(x)=(h_{g_1}(x),\dots,h_{g_k}(x))&amp;lt;/math&amp;gt;。证明 &amp;lt;math&amp;gt;\mathbb P[H(x)=H(y)]=(1-\theta/\pi)^k&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 给定两个角度阈值 &amp;lt;math&amp;gt;0&amp;lt;\theta_1&amp;lt;\theta_2&amp;lt;\pi&amp;lt;/math&amp;gt;。令近点满足 &amp;lt;math&amp;gt;d(x,y)\le \theta_1&amp;lt;/math&amp;gt;，远点满足 &amp;lt;math&amp;gt;d(x,y)\ge \theta_2&amp;lt;/math&amp;gt;。写出这个 LSH family 的参数 &amp;lt;math&amp;gt;p_1&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;p_2&amp;lt;/math&amp;gt;，并推导标准 LSH exponent &amp;lt;math&amp;gt;\rho=\log(1/p_1)/\log(1/p_2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
==由范数保持推出内积保持==&lt;br /&gt;
&lt;br /&gt;
设线性映射 &amp;lt;math&amp;gt;\Pi&amp;lt;/math&amp;gt; 对向量集合 &amp;lt;math&amp;gt;{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都保持平方范数，即对所有 &amp;lt;math&amp;gt;v\in{x,y,x+y,x-y}&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|v|_2^2\le |\Pi v|_2^2\le (1+\epsilon)|v|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 使用恒等式 &amp;lt;math&amp;gt;\langle x,y\rangle=(|x+y|_2^2-|x-y|_2^2)/4&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)(|x|_2^2+|y|_2^2)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 在 &amp;lt;math&amp;gt;|x|_2=|y|_2=1&amp;lt;/math&amp;gt; 的情况下，将上式化简为 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么如果 JL 变换对 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个点的所有两两距离都近似保持，那么这些点的两两内积也近似保持。&lt;br /&gt;
&lt;br /&gt;
(4) 进一步讨论：如果这些点都在单位球面上，那么 JL 降维之后，球面角度 &amp;lt;math&amp;gt;\arccos\langle x,y\rangle&amp;lt;/math&amp;gt; 在什么意义下也被近似保持？&lt;br /&gt;
&lt;br /&gt;
==从阈值版 Approximate Near Neighbor 到 Approximate Nearest Neighbor==&lt;br /&gt;
&lt;br /&gt;
假设你有一个阈值版 Approximate Near Neighbor 黑盒。给定半径 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt; 和查询点 &amp;lt;math&amp;gt;q&amp;lt;/math&amp;gt;，如果数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 中存在点 &amp;lt;math&amp;gt;p&amp;lt;/math&amp;gt; 满足 &amp;lt;math&amp;gt;|p-q|\le r&amp;lt;/math&amp;gt;，那么黑盒会返回某个点 &amp;lt;math&amp;gt;p&#039;&amp;lt;/math&amp;gt;，并保证 &amp;lt;math&amp;gt;|p&#039;-q|\le a r&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
现在希望用这个黑盒解决普通 Approximate Nearest Neighbor 问题。设真正最近邻距离为 &amp;lt;math&amp;gt;d^\star=\min_{p\in P}|p-q|&amp;lt;/math&amp;gt;。我们建立一组半径 &amp;lt;math&amp;gt;r_0,r_1,r_2,\dots&amp;lt;/math&amp;gt;，满足 &amp;lt;math&amp;gt;r_{i+1}=b r_i&amp;lt;/math&amp;gt;。查询时，从小到大尝试这些半径，并返回第一个成功的黑盒查询结果。&lt;br /&gt;
&lt;br /&gt;
(1) 证明最终得到的近似比至多为 &amp;lt;math&amp;gt;ab&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 如果希望最终得到 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt;-approximate nearest neighbor，应该如何选择 &amp;lt;math&amp;gt;a&amp;lt;/math&amp;gt; 和 &amp;lt;math&amp;gt;b&amp;lt;/math&amp;gt;？&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么常见做法中，会把阈值版 ANN 黑盒的 approximate ratio 从 &amp;lt;math&amp;gt;c&amp;lt;/math&amp;gt; 设置为 &amp;lt;math&amp;gt;\sqrt c&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(4) 如果最近邻距离的可能范围被限制在 &amp;lt;math&amp;gt;[1,\Delta]&amp;lt;/math&amp;gt; 中，分析需要建立多少个半径层级。&lt;br /&gt;
&lt;br /&gt;
==torus 上随机网格 LSH 的维数影响==&lt;br /&gt;
&lt;br /&gt;
继续考虑 metric space &amp;lt;math&amp;gt;( [0,n]^d,d_{\mathrm{torus}} )&amp;lt;/math&amp;gt;，其中 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=\sqrt{\sum_{i=1}^d \min{|x_i-y_i|,n-|x_i-y_i|}^2}&amp;lt;/math&amp;gt;。使用题目 4 中的随机平移网格 hash function &amp;lt;math&amp;gt;h_s&amp;lt;/math&amp;gt;，其中网格宽度为 &amp;lt;math&amp;gt;w&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 只在一个坐标上相差 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，其他坐标完全相同。计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 设 &amp;lt;math&amp;gt;x,y&amp;lt;/math&amp;gt; 在每个坐标上都相差 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;/math&amp;gt;，因此 &amp;lt;math&amp;gt;d_{\mathrm{torus}}(x,y)=r&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;r/\sqrt d&amp;lt;w&amp;lt;/math&amp;gt; 的条件下，计算 &amp;lt;math&amp;gt;\mathbb P[h_s(x)=h_s(y)]&amp;lt;/math&amp;gt;，并将其写成 &amp;lt;math&amp;gt;(1-r/(w\sqrt d))^d&amp;lt;/math&amp;gt; 的形式。&lt;br /&gt;
&lt;br /&gt;
(3) 比较上述两种情况。说明即使两对点的 torus 距离都等于 &amp;lt;math&amp;gt;r&amp;lt;/math&amp;gt;，随机网格 LSH 的碰撞概率仍然可能不同。&lt;br /&gt;
&lt;br /&gt;
(4) 解释这说明了什么：axis-aligned grid LSH 并不是只依赖于欧氏距离的完美 LSH family，而是会受到坐标方向和维数的影响。&lt;br /&gt;
&lt;br /&gt;
==先用 JL 降维，再做随机超平面 LSH==&lt;br /&gt;
&lt;br /&gt;
设 &amp;lt;math&amp;gt;P\subseteq\mathbb S^{d-1}&amp;lt;/math&amp;gt; 是 &amp;lt;math&amp;gt;n&amp;lt;/math&amp;gt; 个单位向量。令 &amp;lt;math&amp;gt;\Pi:\mathbb R^d\to\mathbb R^m&amp;lt;/math&amp;gt; 是一个 JL transform，并假设对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x-\Pi y|_2^2-|x-y|_2^2|\le \epsilon&amp;lt;/math&amp;gt;。同时假设对所有 &amp;lt;math&amp;gt;x\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;||\Pi x|_2^2-1|\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明对所有 &amp;lt;math&amp;gt;x,y\in P&amp;lt;/math&amp;gt;，都有 &amp;lt;math&amp;gt;|\langle \Pi x,\Pi y\rangle-\langle x,y\rangle|\le O(\epsilon)&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 令 &amp;lt;math&amp;gt;\theta=\arccos\langle x,y\rangle&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\widetilde\theta=\arccos(\langle \Pi x,\Pi y\rangle/(|\Pi x|_2|\Pi y|_2))&amp;lt;/math&amp;gt;。在 &amp;lt;math&amp;gt;\theta&amp;lt;/math&amp;gt; 不太接近 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt; 或 &amp;lt;math&amp;gt;\pi&amp;lt;/math&amp;gt; 的情况下，给出 &amp;lt;math&amp;gt;|\theta-\widetilde\theta|&amp;lt;/math&amp;gt; 的上界。&lt;br /&gt;
&lt;br /&gt;
(3) 解释为什么可以先对数据集 &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt; 做 JL 降维，再在低维空间中使用随机超平面 LSH。&lt;br /&gt;
&lt;br /&gt;
(4) 讨论当两个点的夹角非常小时，为什么需要更小的 JL 误差才能保证角度的相对误差较好。&lt;br /&gt;
&lt;br /&gt;
==为什么 CountSketch 需要随机符号==&lt;br /&gt;
&lt;br /&gt;
考虑一个没有随机符号的 CountSketch。对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=1&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
取向量 &amp;lt;math&amp;gt;x=(1,1,\dots,1)/\sqrt n&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\mathbb E|\Pi x|_2^2=1+(n-1)/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 说明如果 &amp;lt;math&amp;gt;m=o(n)&amp;lt;/math&amp;gt;，那么这个没有随机符号的 sketch 对该向量的范数估计会有严重偏差。&lt;br /&gt;
&lt;br /&gt;
(3) 现在考虑标准 CountSketch：对每个 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;，令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。解释随机符号 &amp;lt;math&amp;gt;\sigma_i&amp;lt;/math&amp;gt; 如何使不同坐标碰撞产生的交叉项在期望中相互抵消。&lt;br /&gt;
&lt;br /&gt;
(4) 总结随机符号在 CountSketch 中的作用：它并不能避免碰撞，但可以让碰撞带来的误差成为均值为零的随机噪声。&lt;br /&gt;
&lt;br /&gt;
==CountSketch OSE 的 &amp;lt;math&amp;gt;m=O(d^2)&amp;lt;/math&amp;gt; 上界==&lt;br /&gt;
&lt;br /&gt;
令 &amp;lt;math&amp;gt;U\in\mathbb R^{n\times d}&amp;lt;/math&amp;gt; 是一个列正交矩阵，即 &amp;lt;math&amp;gt;U^\top U=I_d&amp;lt;/math&amp;gt;。令 &amp;lt;math&amp;gt;\Pi\in\mathbb R^{m\times n}&amp;lt;/math&amp;gt; 是 CountSketch 矩阵：对每个原始坐标 &amp;lt;math&amp;gt;i\in[n]&amp;lt;/math&amp;gt;，随机选择桶 &amp;lt;math&amp;gt;h(i)\in[m]&amp;lt;/math&amp;gt;，并随机选择符号 &amp;lt;math&amp;gt;\sigma_i\in{-1,1}&amp;lt;/math&amp;gt;；然后令 &amp;lt;math&amp;gt;\Pi_{h(i),i}=\sigma_i&amp;lt;/math&amp;gt;，其他位置为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。记 &amp;lt;math&amp;gt;u_i&amp;lt;/math&amp;gt; 为 &amp;lt;math&amp;gt;U&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;i&amp;lt;/math&amp;gt; 行，视为 &amp;lt;math&amp;gt;\mathbb R^d&amp;lt;/math&amp;gt; 中的列向量。&lt;br /&gt;
&lt;br /&gt;
(1) 证明 &amp;lt;math&amp;gt;\Pi^\top\Pi-I_n&amp;lt;/math&amp;gt; 的第 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 个元素在 &amp;lt;math&amp;gt;i\ne j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j&amp;lt;/math&amp;gt;，在 &amp;lt;math&amp;gt;i=j&amp;lt;/math&amp;gt; 时等于 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(2) 推出 &amp;lt;math&amp;gt;U^\top\Pi^\top\Pi U-I_d=\sum_{i\ne j}\mathbf 1_{h(i)=h(j)}\sigma_i\sigma_j u_i u_j^\top&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(3) 证明在计算 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]&amp;lt;/math&amp;gt; 时，随机符号会使所有交叉项的期望为 &amp;lt;math&amp;gt;0&amp;lt;/math&amp;gt;。也就是说，只有同一对 &amp;lt;math&amp;gt;(i,j)&amp;lt;/math&amp;gt; 与自身相乘的项会保留下来。&lt;br /&gt;
&lt;br /&gt;
(4) 证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|*F^2]\le \frac{1}{m}\sum*{i\ne j}|u_i|_2^2|u_j|_2^2&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(5) 使用 &amp;lt;math&amp;gt;\sum_i|u_i|_2^2=|U|_F^2=d&amp;lt;/math&amp;gt;，证明 &amp;lt;math&amp;gt;\mathbb E[|U^\top\Pi^\top\Pi U-I_d|_F^2]\le d^2/m&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(6) 用 Markov 不等式证明，如果 &amp;lt;math&amp;gt;m\ge d^2/(\epsilon^2\delta)&amp;lt;/math&amp;gt;，那么以概率至少 &amp;lt;math&amp;gt;1-\delta&amp;lt;/math&amp;gt;，有 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_F\le \epsilon&amp;lt;/math&amp;gt;。&lt;br /&gt;
&lt;br /&gt;
(7) 证明如果 &amp;lt;math&amp;gt;|U^\top\Pi^\top\Pi U-I_d|_2\le \epsilon&amp;lt;/math&amp;gt;，那么对所有 &amp;lt;math&amp;gt;x\in\mathbb R^d&amp;lt;/math&amp;gt; 都有 &amp;lt;math&amp;gt;(1-\epsilon)|Ux|_2^2\le |\Pi Ux|_2^2\le (1+\epsilon)|Ux|_2^2&amp;lt;/math&amp;gt;。并解释为什么第 (6) 问中的 Frobenius norm bound 足以推出 spectral norm bound。&lt;br /&gt;
&lt;br /&gt;
(8) 总结：说明 CountSketch 虽然每一列只有一个非零元素，但当 &amp;lt;math&amp;gt;m=O(d^2/(\epsilon^2\delta))&amp;lt;/math&amp;gt; 时，仍然可以作为一个 &amp;lt;math&amp;gt;d&amp;lt;/math&amp;gt; 维子空间的 Oblivious Subspace Embedding。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13809</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13809"/>
		<updated>2026-06-13T01:45:26Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 通知 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039; Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/11)&#039;&#039;&#039; 第一节课（9am-10am）期中考试&lt;br /&gt;
* &#039;&#039;&#039;(2026/6/1)&#039;&#039;&#039; 老师出差，停课一次&lt;br /&gt;
* &#039;&#039;&#039;(2026/6/13)&#039;&#039;&#039; 18：30-21:30补上一次停的课&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
*[[高级算法_(Spring_2026)/大作业|大作业]]。 暂定7月30日截止，将本作业的在线访问链接填写到表格中供老师和助教检查和验收。&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
# [https://box.nju.edu.cn/f/c44c13910eff43ffaf7f/ Dimensionality reduction]&lt;br /&gt;
#* Johnson-Lindenstrauss Transformation:&lt;br /&gt;
#** Intuition: In high-dimensional spaces, a uniformly random vector is almost certainly nearly orthogonal to any fixed vector&lt;br /&gt;
#** Constructions: independent Gaussian entries, projection onto uniform random subspace, i.i.d. -1/+1 entries&lt;br /&gt;
#** Modern applications: TurboQuant versus RaBitQ versus Quantized  JL&lt;br /&gt;
#** Fast Johnson-Lindenstrauss Transformation&lt;br /&gt;
#* Approximate Nearest Neighbor Search: by dimensionality reduction, by Locality Sensitive Hashing (LSH)&lt;br /&gt;
#* Oblivious Subspace Embedding (OSE): net argument&lt;br /&gt;
#** Application: linear regression by sketch-and-solve via OSE, linear regression by fast iteration with OSE&lt;br /&gt;
#** Sparse Oblivious Subspace Embedding: count sketch&lt;br /&gt;
# [https://box.nju.edu.cn/f/06de800f2ab04d58bbda/ Network flow &amp;amp; Linear programming]&lt;br /&gt;
#* Maximum flow: max-flow min-cut theorem, Ford-Fulkerson algorithm, scaling algorithm, Edmonds–Karp algorithm, Dinitz&#039;s algorithm&lt;br /&gt;
#** Application &amp;amp; Extension: multi-source multi-sink, maximum bipartite matching, counting disjoint paths, global min cut, &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;-completeness, minimum-cost flow problem&lt;br /&gt;
#* Linear programming: Simplex, Interior Point Method, Elipsoid Method, &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;-completeness&lt;br /&gt;
#** Duality and primal-dual methods&lt;br /&gt;
#** Integer programming: randomized rounding for approximate algorithms&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13808</id>
		<title>高级算法 (Spring 2026)/大作业</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13808"/>
		<updated>2026-06-10T17:19:19Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* 至多四人一组，从以下论文中选择一篇，撰写一篇 review，中英文不限。&lt;br /&gt;
**你需要尽可能详细地解释：该论文解决了什么问题，该问题为什么重要（或者提出了什么技术，该技术为什么重要），该问题有什么相关研究（包括该论文提到的，和没提到的，以及在该论文发表之后的新的相关研究），为了解决该问题该论文提出了什么技术，该技术背后的直觉是什么，该技术有什么非凡之处厉害之处。&lt;br /&gt;
**最后尽可能详细地（以一个挑剔严谨的、没有读过该论文的同学可以通过阅读你的 review 来轻松地弄明白、来轻松地验证为标准）解释该技术是如何实现的，如何证明该技术的正确性和优越性。&lt;br /&gt;
* 结果分数30%，过程分数70%. 必须使用 Notion / Overleaf / Google Docs / Word Online / Github 等在线的有版本历史的工具。(如需使用 overleaf student plan 这样的付费服务可以向老师申请，老师予以报销。 notion education plus 是免费的。）&lt;br /&gt;
**教师和助教应能够看到论文从资料收集、逐渐理解、观点形成、草稿撰写到反复修改的过程。如果记录不完整会扣除过程分。没有记录视为作弊。不接受截止日前一次性上传完整论文作为有效过程记录。&lt;br /&gt;
**必须开放可以随时在线访问的版本历史供教师或助教检查，老师会在你们撰写的过程中偶尔查看你们的进展。&lt;br /&gt;
**小组成员尽量保留阅读笔记、草稿和修改记录，需在版本历史记录中设法留下各自贡献的痕迹。&lt;br /&gt;
**有不懂的地方允许咨询AI帮助理解，或者求助AI帮助查询信息，但是&#039;&#039;&#039;不接受AI代写&#039;&#039;&#039;。需将AI使用记录放入版本历史中一并以可追溯的方式提交。&#039;&#039;&#039;你有责任验证AI告诉你的事情的真伪&#039;&#039;&#039;，不接受“AI是这么说的”作为借口。&lt;br /&gt;
** 教师或助教可能在提交后随机抽取小组进行口头检查。每位成员都需要解释自己负责的内容、论文的核心论点、主要参考文献、修改过程以及 AI 工具的使用情况。若学生无法解释提交内容，或过程记录与最终文本严重不符，将被视为学术诚信风险，并影响成绩。&lt;br /&gt;
&lt;br /&gt;
# Succinct dynamic dictionaries and trees &lt;br /&gt;
# On Data Structures and Asymmetric Communication Complexity &lt;br /&gt;
# A Hash Table Without Hash Functions, and How to Get the Most Out of Your Random Bits &lt;br /&gt;
# Lower bounds on Locality Sensitive Hashing （很短，但是你需要解释其中的傅里叶分析） &lt;br /&gt;
# Data structures meet cryptography: 3SUM with preprocessing &lt;br /&gt;
# Optimal resizable arrays &lt;br /&gt;
# Tiny Pointers &lt;br /&gt;
# How to Approximate A Set Without Knowing Its Size In Advance &lt;br /&gt;
# Succinct Filters for Sets of Unknown Sizes &lt;br /&gt;
# Succincter. M Patrascu. 2008 &lt;br /&gt;
# Changing base without losing space&lt;br /&gt;
# Unifying the Landscape of Cell-Probe Lower Bounds &lt;br /&gt;
# Optimal Space Lower Bounds for all Frequency Moments &lt;br /&gt;
# Tight Lower Bounds for the Distinct Elements Problem &lt;br /&gt;
# On the Cell Probe Complexity of Dynamic Membership &lt;br /&gt;
# External Memory Priority Queues with Decrease-Key and Applications to Graph Algorithms &lt;br /&gt;
# An Improved Distributed Algorithm for Maximal Independent Set &lt;br /&gt;
# Breaking the &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt; bit barrier: Scalable byzantine agreement with an adaptive adversary &lt;br /&gt;
# Simple Contention Resolution via Multiplicative Weight Updates &lt;br /&gt;
# Universal Optimality of Dijkstra via Beyond-Worst-Case Heaps &lt;br /&gt;
# What Cannot Be Computed Locally! &lt;br /&gt;
# Impossibility of Distributed Consensus with One Faulty Process &lt;br /&gt;
&lt;br /&gt;
*获取论文原文也是作业的一部分。&lt;br /&gt;
*需要在review中注明参与完成 review 的每个同学的贡献。&lt;br /&gt;
*到[https://table.nju.edu.cn/dtable/links/1c631cfdfeab4c7093d1 南大表格]填写表格来认领论文。&lt;br /&gt;
*有问题可以问老师或者助教。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13805</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13805"/>
		<updated>2026-06-08T00:50:15Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 课件及相关阅读资料 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039; Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/11)&#039;&#039;&#039; 第一节课（9am-10am）期中考试&lt;br /&gt;
* &#039;&#039;&#039;(2026/6/1)&#039;&#039;&#039; 老师出差，停课一次&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
*[[高级算法_(Spring_2026)/大作业|大作业]]。 暂定7月30日截止，将本作业的在线访问链接填写到表格中供老师和助教检查和验收。&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
# [https://box.nju.edu.cn/f/c44c13910eff43ffaf7f/ Dimensionality reduction]&lt;br /&gt;
#* Johnson-Lindenstrauss Transformation:&lt;br /&gt;
#** Intuition: In high-dimensional spaces, a uniformly random vector is almost certainly nearly orthogonal to any fixed vector&lt;br /&gt;
#** Constructions: independent Gaussian entries, projection onto uniform random subspace, i.i.d. -1/+1 entries&lt;br /&gt;
#** Modern applications: TurboQuant versus RaBitQ versus Quantized  JL&lt;br /&gt;
#** Fast Johnson-Lindenstrauss Transformation&lt;br /&gt;
#* Approximate Nearest Neighbor Search: by dimensionality reduction, by Locality Sensitive Hashing (LSH)&lt;br /&gt;
#* Oblivious Subspace Embedding (OSE): net argument&lt;br /&gt;
#** Application: linear regression by sketch-and-solve via OSE, linear regression by fast iteration with OSE&lt;br /&gt;
#** Sparse Oblivious Subspace Embedding: count sketch&lt;br /&gt;
# [https://box.nju.edu.cn/f/06de800f2ab04d58bbda/ Network flow &amp;amp; Linear programming]&lt;br /&gt;
#* Maximum flow: max-flow min-cut theorem, Ford-Fulkerson algorithm, scaling algorithm, Edmonds–Karp algorithm, Dinitz&#039;s algorithm&lt;br /&gt;
#** Application &amp;amp; Extension: multi-source multi-sink, maximum bipartite matching, counting disjoint paths, global min cut, &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;-completeness, minimum-cost flow problem&lt;br /&gt;
#* Linear programming: Simplex, Interior Point Method, Elipsoid Method, &amp;lt;math&amp;gt;P&amp;lt;/math&amp;gt;-completeness&lt;br /&gt;
#** Duality and primal-dual methods&lt;br /&gt;
#** Integer programming: randomized rounding for approximate algorithms&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13804</id>
		<title>计算理论之美 (Summer 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13804"/>
		<updated>2026-06-06T01:45:35Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* Tentative Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox &lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|headerstyle  = background:#4D72BE;&lt;br /&gt;
|labelstyle   = background:#DAE1F0;&lt;br /&gt;
&lt;br /&gt;
|header1 = &amp;lt;font size=3, color=white&amp;gt;计算理论之美&amp;lt;/font&amp;gt;&lt;br /&gt;
|label2  = {{Nowrap|负责人}} &lt;br /&gt;
|data2   = 黄棱潇 ([mailto:huanglingxiao@nju.edu.cn huanglingxiao@nju.edu.cn]) &lt;br /&gt;
|label4 = 时间&lt;br /&gt;
|data4  = 2026.7.24 — 2026.7.27&lt;br /&gt;
|label5 = 地点&lt;br /&gt;
|data5  = {{Nowrap|南京大学苏州校区 TBA}}&lt;br /&gt;
|belowstyle = background:#DAE1F0;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
由南京大学计算机学院和智能软件学院支持的第5届“计算理论之美”暑期讲习班将于2026年7月24日至7月27日在江苏省苏州市南京大学苏州校区开班。本次讲习班将围绕算法设计主题开展系列报告，包括组合最优化、哈希表、差分隐私、量子计算、数据结构复杂性、图计算等板块，主要面向对理论计算机科学以及计算机科学中的数学感兴趣的国内外本科生，安排4天的高级课程。内容深入浅出，由国内外一线的优秀学者讲授，使学员初步了解理论计算机科学的一些研究前沿、初步掌握一些新理论与新方法，为有志于从事理论计算机科学研究的学者打下一定的基础，也让从事其他相关方向研究的学生与教师们领略计算理论的魅力。&lt;br /&gt;
&lt;br /&gt;
联系邮箱：nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
联系人：&lt;br /&gt;
* 黄棱潇：	huanglingxiao@nju.edu.cn&lt;br /&gt;
* 刘明谋：	lmm@nju.edu.cn&lt;br /&gt;
* 班吟：		175227530@qq.com&lt;br /&gt;
&lt;br /&gt;
注册报名流程：由于前几届报名人数过多，本届将会采用问卷初筛形式进行报名。请同学们先填写以下调查问卷:&lt;br /&gt;
&lt;br /&gt;
https://table.nju.edu.cn/external-apps/9ea2fbd7-8ac8-45dd-b5bf-fbdb887989be/?page_id=9UIB&lt;br /&gt;
&lt;br /&gt;
问卷报名截止日期： 2026.6.20&lt;br /&gt;
&lt;br /&gt;
通过初筛的同学将于讲习班开始前两周收到包含报名链接的邮件。由于今年讲习班将在苏州校区举办，南京校区的南大同学如需统一安排住宿，也请填写问卷；无需安排住宿的同学，可在讲习班期间直接前往会场听取报告。&lt;br /&gt;
&lt;br /&gt;
费用：本科生包住宿，非本科生不包含住宿。餐费自理。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tentative Schedule ==&lt;br /&gt;
&lt;br /&gt;
Venue (地点)：南京大学苏州校区TBA&lt;br /&gt;
&lt;br /&gt;
Group photo: 7月24日上午茶歇环节中安排参会者合影留念&lt;br /&gt;
&lt;br /&gt;
Speakers (in lexicographic order): 陈林（浙江大学）、刘明谋（南京大学）、Pasin Manurangsi（Google Research）、任瀚林（IAS）、王启圣（上海交通大学）、俞华程（普林斯顿大学）、张天翼（南京大学）、TBD&lt;br /&gt;
&lt;br /&gt;
== Take-home Exams ==&lt;br /&gt;
成绩优秀的同学可推荐参加南京大学计算机学院预推免保研面试，并在录取后可凭借此次暑期讲习班申请两个研究生学分。&lt;br /&gt;
&lt;br /&gt;
作业提交方式：发送电子版到邮箱nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
== Links to Past Summer Schools ==&lt;br /&gt;
* [[计算理论之美 (Summer 2025)|计算理论之美暑期学校 (Summer 2025)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2024)|计算理论之美暑期学校 (Summer 2024)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2023)|计算理论之美暑期学校 (Summer 2023)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2021)|计算理论之美暑期学校 (Summer 2021)]]&lt;br /&gt;
&lt;br /&gt;
== About Our Summer School ==&lt;br /&gt;
Our summer school is supported by the School of Computer Science and the School of Intelligent Software and Engineering at Nanjing University and will be held from July 24th to July 27th, 2026, at the Suzhou Campus of Nanjing University in Suzhou, Jiangsu Province, China. The theme of this year&#039;s summer school will be the design and analysis of algorithms, with topics ranging from combinatorial optimization, hash table design, differential privacy, quantum computing, data structure compelxity, and graph algorithms etc. &lt;br /&gt;
Target audience will include aspiring undergraduate and graduate students from China and overseas, and the program will feature 4 days of advanced courses. The courses will be presented by leading young scholars both from within China and overseas, covering both cutting-edge research and modern toolkits in theoretical computer science. &lt;br /&gt;
The summer school will help connect aspiring young students with young scholars to engage research in theoretical computer science, and embark on a journey to appreciate the charm of computational theory.&lt;br /&gt;
&lt;br /&gt;
Accommodation (shared room) will be provided to undergraduates only.&lt;br /&gt;
&lt;br /&gt;
Due to capacity, we prioritize undergraduates seeking to join NJU TCS group for PhD or for a research intern. To register, please fill out the following form: https://table.nju.edu.cn/external-apps/9ea2fbd7-8ac8-45dd-b5bf-fbdb887989be/?page_id=9UIB&lt;br /&gt;
&lt;br /&gt;
If you are selected into our summer school, you will receive a confirmation email.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Main_Page&amp;diff=13803</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Main_Page&amp;diff=13803"/>
		<updated>2026-06-06T01:44:11Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* Home Pages for Courses and Seminars */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a course/seminar wiki run by the [http://tcs.nju.edu.cn theory group] in the Department of Computer Science and Technology at Nanjing University.&lt;br /&gt;
&lt;br /&gt;
== Home Pages for Courses and Seminars==&lt;br /&gt;
;Current semester &amp;amp; Summer school&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;big&amp;gt;[[计算理论之美 (Summer 2026) | 计算理论之美暑期学校 2026]]&amp;lt;/big&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[高级算法 (Spring 2026)|高级算法 Advanced Algorithms (Spring 2026, Suzhou)]]&lt;br /&gt;
&lt;br /&gt;
* [[组合数学 (Spring 2026)|组合数学 Combinatorics (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[计算复杂性 (Spring 2026)|计算复杂性 Computational Complexity (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[计算方法 Numerical method (Spring 2026)|计算方法 Numerical method (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[概率论与数理统计 (Spring 2026)|概率论与数理统计 Probability Theory (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[计算理论之美 (Summer 2026)|计算理论之美 (Summer 2026)]]&lt;br /&gt;
&lt;br /&gt;
;Past courses&lt;br /&gt;
&lt;br /&gt;
* Advanced Algorithms: [[高级算法 (Fall 2025)|Fall 2025]], [[高级算法 (Spring 2025)|Spring 2025(Suzhou)]], [[高级算法 (Fall 2024)|Fall 2024]], [[高级算法 (Fall 2023)|Fall 2023]], [[高级算法 (Fall 2022)|Fall 2022]], [[高级算法 (Fall 2021)|Fall 2021]], [[高级算法 (Fall 2020)|Fall 2020]], [[高级算法 (Fall 2019)|Fall 2019]], [[高级算法 (Fall 2018)|Fall 2018]], [[高级算法 (Fall 2017)|Fall 2017]], [[随机算法 \ 高级算法 (Fall 2016)|Fall 2016]].&lt;br /&gt;
&lt;br /&gt;
*Algorithm Design and Analysis: [https://tcs.nju.edu.cn/shili/courses/2024spring-algo/ Spring 2024]&lt;br /&gt;
&lt;br /&gt;
* Combinatorics: [[组合数学 (Spring 2025)|Spring 2025]], [[组合数学 (Spring 2024)|Spring 2024]], [[组合数学 (Spring 2023)|Spring 2023]], [[组合数学 (Fall 2019)|Fall 2019]], [[组合数学 (Fall 2017)|Fall 2017]], [[组合数学 (Fall 2016)|Fall 2016]], [[组合数学 (Fall 2015)|Fall 2015]], [[组合数学 (Spring 2014)|Spring 2014]], [[组合数学 (Spring 2013)|Spring 2013]], [[组合数学 (Fall 2011)|Fall 2011]], [[Combinatorics (Fall 2010)|Fall 2010]].&lt;br /&gt;
&lt;br /&gt;
* Computational Complexity: [[计算复杂性 (Spring 2025)|Spring 2025]], [[计算复杂性 (Spring 2024)|Spring 2024]], [[计算复杂性 (Spring 2023)|Spring 2023]], [[计算复杂性 (Fall 2019)|Fall 2019]], [[计算复杂性 (Fall 2018)|Fall 2018]].&lt;br /&gt;
&lt;br /&gt;
* Foundations of Data Science: [[数据科学基础 (Fall 2025)|Fall 2025]], [[数据科学基础 (Fall 2024)|Fall 2024]]&lt;br /&gt;
&lt;br /&gt;
* Numerical Method: [[计算方法 Numerical method (Spring 2025)|Spring 2025]], [[计算方法 Numerical method (Spring 2024)|Spring 2024]], [[计算方法 Numerical method (Spring 2023)|Spring 2023]], [https://liuexp.github.io/numerical.html Spring 2022].&lt;br /&gt;
&lt;br /&gt;
* Probability Theory: [[概率论与数理统计 (Spring 2025)|Spring 2025]], [[概率论与数理统计 (Spring 2024)|Spring 2024]], [[概率论与数理统计 (Spring 2023)|Spring 2023]].&lt;br /&gt;
&lt;br /&gt;
* Quantum Computation: [[量子计算 (Spring 2022)|Spring 2022]], [[量子计算 (Spring 2021)|Spring 2021]], [[量子计算 (Fall 2019)|Fall 2019]].&lt;br /&gt;
&lt;br /&gt;
* Randomized Algorithms:  [[随机算法 (Fall 2015)|Fall 2015]], [[随机算法 (Spring 2014)|Spring 2014]], [[随机算法 (Spring 2013)|Spring 2013]], [[随机算法 (Fall 2011)|Fall 2011]], [[Randomized Algorithms (Spring 2010)|Spring 2010]].&lt;br /&gt;
&lt;br /&gt;
;Past seminars, workshops and summer schools&lt;br /&gt;
*计算理论之美暑期学校: [[计算理论之美 (Summer 2025)|2025]], [[计算理论之美 (Summer 2024)|2024]], [[计算理论之美 (Summer 2023)|2023]], [[计算理论之美 (Summer 2021)|2021]]&lt;br /&gt;
*[[Theory Seminar|理论计算机科学讨论班]]&lt;br /&gt;
*[[Study Group|理论计算机科学学习小组]]&lt;br /&gt;
*[[TCSPhD2020| 理论计算机科学优秀博士生论坛2020]]&lt;br /&gt;
*[[Quantum|量子算法与物理实现研讨会]]&lt;br /&gt;
*Theory Day: [[Theory@Suzhou 2025 | 2025 (Suzhou)]],  [[Theory@Nanjing 2019|2019]], [[Theory@Nanjing 2018|2018]], [[Theory@Nanjing 2017|2017]]&lt;br /&gt;
*[[\Delta Seminar on Logic, Philosophy, and Computer Science|Δ Seminar on Logic, Philosophy, and Computer Science]]&lt;br /&gt;
*[[近似算法讨论班 (Fall 2011)|近似算法 Approximation Algorithms, Fall 2011.]]&lt;br /&gt;
&lt;br /&gt;
; 其它链接&lt;br /&gt;
* [[General Circulation(Fall 2025)|大气环流 General Circulation of the Atmosphere, Fall 2025]]&lt;br /&gt;
* [[General Circulation(Fall 2024)|大气环流 General Circulation of the Atmosphere, Fall 2024]]&lt;br /&gt;
&lt;br /&gt;
* [[概率论 (Summer 2014)| 概率与计算 (上海交大 Summer 2014)]]&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Main_Page&amp;diff=13802</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Main_Page&amp;diff=13802"/>
		<updated>2026-06-06T01:43:33Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* Home Pages for Courses and Seminars */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a course/seminar wiki run by the [http://tcs.nju.edu.cn theory group] in the Department of Computer Science and Technology at Nanjing University.&lt;br /&gt;
&lt;br /&gt;
== Home Pages for Courses and Seminars==&lt;br /&gt;
;Current semester &amp;amp; Summer school&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;[[计算理论之美 (Summer 2026) | 计算理论之美暑期学校 2026]]&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[高级算法 (Spring 2026)|高级算法 Advanced Algorithms (Spring 2026, Suzhou)]]&lt;br /&gt;
&lt;br /&gt;
* [[组合数学 (Spring 2026)|组合数学 Combinatorics (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[计算复杂性 (Spring 2026)|计算复杂性 Computational Complexity (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[计算方法 Numerical method (Spring 2026)|计算方法 Numerical method (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[概率论与数理统计 (Spring 2026)|概率论与数理统计 Probability Theory (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[计算理论之美 (Summer 2026)|计算理论之美 (Summer 2026)]]&lt;br /&gt;
&lt;br /&gt;
;Past courses&lt;br /&gt;
&lt;br /&gt;
* Advanced Algorithms: [[高级算法 (Fall 2025)|Fall 2025]], [[高级算法 (Spring 2025)|Spring 2025(Suzhou)]], [[高级算法 (Fall 2024)|Fall 2024]], [[高级算法 (Fall 2023)|Fall 2023]], [[高级算法 (Fall 2022)|Fall 2022]], [[高级算法 (Fall 2021)|Fall 2021]], [[高级算法 (Fall 2020)|Fall 2020]], [[高级算法 (Fall 2019)|Fall 2019]], [[高级算法 (Fall 2018)|Fall 2018]], [[高级算法 (Fall 2017)|Fall 2017]], [[随机算法 \ 高级算法 (Fall 2016)|Fall 2016]].&lt;br /&gt;
&lt;br /&gt;
*Algorithm Design and Analysis: [https://tcs.nju.edu.cn/shili/courses/2024spring-algo/ Spring 2024]&lt;br /&gt;
&lt;br /&gt;
* Combinatorics: [[组合数学 (Spring 2025)|Spring 2025]], [[组合数学 (Spring 2024)|Spring 2024]], [[组合数学 (Spring 2023)|Spring 2023]], [[组合数学 (Fall 2019)|Fall 2019]], [[组合数学 (Fall 2017)|Fall 2017]], [[组合数学 (Fall 2016)|Fall 2016]], [[组合数学 (Fall 2015)|Fall 2015]], [[组合数学 (Spring 2014)|Spring 2014]], [[组合数学 (Spring 2013)|Spring 2013]], [[组合数学 (Fall 2011)|Fall 2011]], [[Combinatorics (Fall 2010)|Fall 2010]].&lt;br /&gt;
&lt;br /&gt;
* Computational Complexity: [[计算复杂性 (Spring 2025)|Spring 2025]], [[计算复杂性 (Spring 2024)|Spring 2024]], [[计算复杂性 (Spring 2023)|Spring 2023]], [[计算复杂性 (Fall 2019)|Fall 2019]], [[计算复杂性 (Fall 2018)|Fall 2018]].&lt;br /&gt;
&lt;br /&gt;
* Foundations of Data Science: [[数据科学基础 (Fall 2025)|Fall 2025]], [[数据科学基础 (Fall 2024)|Fall 2024]]&lt;br /&gt;
&lt;br /&gt;
* Numerical Method: [[计算方法 Numerical method (Spring 2025)|Spring 2025]], [[计算方法 Numerical method (Spring 2024)|Spring 2024]], [[计算方法 Numerical method (Spring 2023)|Spring 2023]], [https://liuexp.github.io/numerical.html Spring 2022].&lt;br /&gt;
&lt;br /&gt;
* Probability Theory: [[概率论与数理统计 (Spring 2025)|Spring 2025]], [[概率论与数理统计 (Spring 2024)|Spring 2024]], [[概率论与数理统计 (Spring 2023)|Spring 2023]].&lt;br /&gt;
&lt;br /&gt;
* Quantum Computation: [[量子计算 (Spring 2022)|Spring 2022]], [[量子计算 (Spring 2021)|Spring 2021]], [[量子计算 (Fall 2019)|Fall 2019]].&lt;br /&gt;
&lt;br /&gt;
* Randomized Algorithms:  [[随机算法 (Fall 2015)|Fall 2015]], [[随机算法 (Spring 2014)|Spring 2014]], [[随机算法 (Spring 2013)|Spring 2013]], [[随机算法 (Fall 2011)|Fall 2011]], [[Randomized Algorithms (Spring 2010)|Spring 2010]].&lt;br /&gt;
&lt;br /&gt;
;Past seminars, workshops and summer schools&lt;br /&gt;
*计算理论之美暑期学校: [[计算理论之美 (Summer 2025)|2025]], [[计算理论之美 (Summer 2024)|2024]], [[计算理论之美 (Summer 2023)|2023]], [[计算理论之美 (Summer 2021)|2021]]&lt;br /&gt;
*[[Theory Seminar|理论计算机科学讨论班]]&lt;br /&gt;
*[[Study Group|理论计算机科学学习小组]]&lt;br /&gt;
*[[TCSPhD2020| 理论计算机科学优秀博士生论坛2020]]&lt;br /&gt;
*[[Quantum|量子算法与物理实现研讨会]]&lt;br /&gt;
*Theory Day: [[Theory@Suzhou 2025 | 2025 (Suzhou)]],  [[Theory@Nanjing 2019|2019]], [[Theory@Nanjing 2018|2018]], [[Theory@Nanjing 2017|2017]]&lt;br /&gt;
*[[\Delta Seminar on Logic, Philosophy, and Computer Science|Δ Seminar on Logic, Philosophy, and Computer Science]]&lt;br /&gt;
*[[近似算法讨论班 (Fall 2011)|近似算法 Approximation Algorithms, Fall 2011.]]&lt;br /&gt;
&lt;br /&gt;
; 其它链接&lt;br /&gt;
* [[General Circulation(Fall 2025)|大气环流 General Circulation of the Atmosphere, Fall 2025]]&lt;br /&gt;
* [[General Circulation(Fall 2024)|大气环流 General Circulation of the Atmosphere, Fall 2024]]&lt;br /&gt;
&lt;br /&gt;
* [[概率论 (Summer 2014)| 概率与计算 (上海交大 Summer 2014)]]&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=Main_Page&amp;diff=13801</id>
		<title>Main Page</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=Main_Page&amp;diff=13801"/>
		<updated>2026-06-06T01:43:09Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* Home Pages for Courses and Seminars */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a course/seminar wiki run by the [http://tcs.nju.edu.cn theory group] in the Department of Computer Science and Technology at Nanjing University.&lt;br /&gt;
&lt;br /&gt;
== Home Pages for Courses and Seminars==&lt;br /&gt;
;Current semester &amp;amp; Summer school&lt;br /&gt;
* &#039;&#039;&#039;&amp;lt;font color=&#039;red&#039;&amp;gt;[[计算理论之美 (Summer 2026) | 计算理论之美暑期学校 2026]]&amp;lt;/font&amp;gt;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[高级算法 (Spring 2026)|高级算法 Advanced Algorithms (Spring 2026, Suzhou)]]&lt;br /&gt;
&lt;br /&gt;
* [[组合数学 (Spring 2026)|组合数学 Combinatorics (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[计算复杂性 (Spring 2026)|计算复杂性 Computational Complexity (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[计算方法 Numerical method (Spring 2026)|计算方法 Numerical method (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[概率论与数理统计 (Spring 2026)|概率论与数理统计 Probability Theory (Spring 2026)]]&lt;br /&gt;
&lt;br /&gt;
* [[计算理论之美 (Summer 2026)|计算理论之美 (Summer 2026)]]&lt;br /&gt;
&lt;br /&gt;
;Past courses&lt;br /&gt;
&lt;br /&gt;
* Advanced Algorithms: [[高级算法 (Fall 2025)|Fall 2025]], [[高级算法 (Spring 2025)|Spring 2025(Suzhou)]], [[高级算法 (Fall 2024)|Fall 2024]], [[高级算法 (Fall 2023)|Fall 2023]], [[高级算法 (Fall 2022)|Fall 2022]], [[高级算法 (Fall 2021)|Fall 2021]], [[高级算法 (Fall 2020)|Fall 2020]], [[高级算法 (Fall 2019)|Fall 2019]], [[高级算法 (Fall 2018)|Fall 2018]], [[高级算法 (Fall 2017)|Fall 2017]], [[随机算法 \ 高级算法 (Fall 2016)|Fall 2016]].&lt;br /&gt;
&lt;br /&gt;
*Algorithm Design and Analysis: [https://tcs.nju.edu.cn/shili/courses/2024spring-algo/ Spring 2024]&lt;br /&gt;
&lt;br /&gt;
* Combinatorics: [[组合数学 (Spring 2025)|Spring 2025]], [[组合数学 (Spring 2024)|Spring 2024]], [[组合数学 (Spring 2023)|Spring 2023]], [[组合数学 (Fall 2019)|Fall 2019]], [[组合数学 (Fall 2017)|Fall 2017]], [[组合数学 (Fall 2016)|Fall 2016]], [[组合数学 (Fall 2015)|Fall 2015]], [[组合数学 (Spring 2014)|Spring 2014]], [[组合数学 (Spring 2013)|Spring 2013]], [[组合数学 (Fall 2011)|Fall 2011]], [[Combinatorics (Fall 2010)|Fall 2010]].&lt;br /&gt;
&lt;br /&gt;
* Computational Complexity: [[计算复杂性 (Spring 2025)|Spring 2025]], [[计算复杂性 (Spring 2024)|Spring 2024]], [[计算复杂性 (Spring 2023)|Spring 2023]], [[计算复杂性 (Fall 2019)|Fall 2019]], [[计算复杂性 (Fall 2018)|Fall 2018]].&lt;br /&gt;
&lt;br /&gt;
* Foundations of Data Science: [[数据科学基础 (Fall 2025)|Fall 2025]], [[数据科学基础 (Fall 2024)|Fall 2024]]&lt;br /&gt;
&lt;br /&gt;
* Numerical Method: [[计算方法 Numerical method (Spring 2025)|Spring 2025]], [[计算方法 Numerical method (Spring 2024)|Spring 2024]], [[计算方法 Numerical method (Spring 2023)|Spring 2023]], [https://liuexp.github.io/numerical.html Spring 2022].&lt;br /&gt;
&lt;br /&gt;
* Probability Theory: [[概率论与数理统计 (Spring 2025)|Spring 2025]], [[概率论与数理统计 (Spring 2024)|Spring 2024]], [[概率论与数理统计 (Spring 2023)|Spring 2023]].&lt;br /&gt;
&lt;br /&gt;
* Quantum Computation: [[量子计算 (Spring 2022)|Spring 2022]], [[量子计算 (Spring 2021)|Spring 2021]], [[量子计算 (Fall 2019)|Fall 2019]].&lt;br /&gt;
&lt;br /&gt;
* Randomized Algorithms:  [[随机算法 (Fall 2015)|Fall 2015]], [[随机算法 (Spring 2014)|Spring 2014]], [[随机算法 (Spring 2013)|Spring 2013]], [[随机算法 (Fall 2011)|Fall 2011]], [[Randomized Algorithms (Spring 2010)|Spring 2010]].&lt;br /&gt;
&lt;br /&gt;
;Past seminars, workshops and summer schools&lt;br /&gt;
*计算理论之美暑期学校: [[计算理论之美 (Summer 2025)|2025]], [[计算理论之美 (Summer 2024)|2024]], [[计算理论之美 (Summer 2023)|2023]], [[计算理论之美 (Summer 2021)|2021]]&lt;br /&gt;
*[[Theory Seminar|理论计算机科学讨论班]]&lt;br /&gt;
*[[Study Group|理论计算机科学学习小组]]&lt;br /&gt;
*[[TCSPhD2020| 理论计算机科学优秀博士生论坛2020]]&lt;br /&gt;
*[[Quantum|量子算法与物理实现研讨会]]&lt;br /&gt;
*Theory Day: [[Theory@Suzhou 2025 | 2025 (Suzhou)]],  [[Theory@Nanjing 2019|2019]], [[Theory@Nanjing 2018|2018]], [[Theory@Nanjing 2017|2017]]&lt;br /&gt;
*[[\Delta Seminar on Logic, Philosophy, and Computer Science|Δ Seminar on Logic, Philosophy, and Computer Science]]&lt;br /&gt;
*[[近似算法讨论班 (Fall 2011)|近似算法 Approximation Algorithms, Fall 2011.]]&lt;br /&gt;
&lt;br /&gt;
; 其它链接&lt;br /&gt;
* [[General Circulation(Fall 2025)|大气环流 General Circulation of the Atmosphere, Fall 2025]]&lt;br /&gt;
* [[General Circulation(Fall 2024)|大气环流 General Circulation of the Atmosphere, Fall 2024]]&lt;br /&gt;
&lt;br /&gt;
* [[概率论 (Summer 2014)| 概率与计算 (上海交大 Summer 2014)]]&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13800</id>
		<title>高级算法 (Spring 2026)/大作业</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13800"/>
		<updated>2026-06-06T01:39:21Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* 至多四人一组，从以下论文中选择一篇，撰写一篇 review，中英文不限。&lt;br /&gt;
**你需要尽可能详细地解释：该论文解决了什么问题，该问题为什么重要（或者提出了什么技术，该技术为什么重要），该问题有什么相关研究（包括该论文提到的，和没提到的，以及在该论文发表之后的新的相关研究），为了解决该问题该论文提出了什么技术，该技术背后的直觉是什么，该技术有什么非凡之处厉害之处。&lt;br /&gt;
**最后尽可能详细地（以一个挑剔严谨的、没有读过该论文的同学可以通过阅读你的 review 来轻松地弄明白、来轻松地验证为标准）解释该技术是如何实现的，如何证明该技术的正确性和优越性。&lt;br /&gt;
* 结果分数30%，过程分数70%. 必须使用 Notion / Overleaf / Google Docs / Word Online / Github 等在线的有版本历史的工具。(如需使用 overleaf student plan 这样的付费服务可以向老师申请，老师予以报销。 notion education plus 是免费的。）&lt;br /&gt;
**教师和助教应能够看到论文从资料收集、逐渐理解、观点形成、草稿撰写到反复修改的过程。如果记录不完整会扣除过程分。没有记录视为作弊。不接受截止日前一次性上传完整论文作为有效过程记录。&lt;br /&gt;
**必须开放可以随时在线访问的版本历史供教师或助教检查，老师会在你们撰写的过程中偶尔查看你们的进展。&lt;br /&gt;
**小组成员尽量保留阅读笔记、草稿和修改记录，需在版本历史记录中设法留下各自贡献的痕迹。&lt;br /&gt;
**有不懂的地方允许咨询AI帮助理解，或者求助AI帮助查询信息，但是不接受AI代写。需将AI使用记录放入版本历史中一并以可追溯的方式提交。&lt;br /&gt;
** 教师或助教可能在提交后随机抽取小组进行口头检查。每位成员都需要解释自己负责的内容、论文的核心论点、主要参考文献、修改过程以及 AI 工具的使用情况。若学生无法解释提交内容，或过程记录与最终文本严重不符，将被视为学术诚信风险，并影响成绩。&lt;br /&gt;
&lt;br /&gt;
# Succinct dynamic dictionaries and trees &lt;br /&gt;
# On Data Structures and Asymmetric Communication Complexity &lt;br /&gt;
# A Hash Table Without Hash Functions, and How to Get the Most Out of Your Random Bits &lt;br /&gt;
# Lower bounds on Locality Sensitive Hashing （很短，但是你需要解释其中的傅里叶分析） &lt;br /&gt;
# Data structures meet cryptography: 3SUM with preprocessing &lt;br /&gt;
# Optimal resizable arrays &lt;br /&gt;
# Tiny Pointers &lt;br /&gt;
# How to Approximate A Set Without Knowing Its Size In Advance &lt;br /&gt;
# Succinct Filters for Sets of Unknown Sizes &lt;br /&gt;
# Succincter. M Patrascu. 2008 &lt;br /&gt;
# Changing base without losing space&lt;br /&gt;
# Unifying the Landscape of Cell-Probe Lower Bounds &lt;br /&gt;
# Optimal Space Lower Bounds for all Frequency Moments &lt;br /&gt;
# Tight Lower Bounds for the Distinct Elements Problem &lt;br /&gt;
# On the Cell Probe Complexity of Dynamic Membership &lt;br /&gt;
# External Memory Priority Queues with Decrease-Key and Applications to Graph Algorithms &lt;br /&gt;
# An Improved Distributed Algorithm for Maximal Independent Set &lt;br /&gt;
# Breaking the &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt; bit barrier: Scalable byzantine agreement with an adaptive adversary &lt;br /&gt;
# Simple Contention Resolution via Multiplicative Weight Updates &lt;br /&gt;
# Universal Optimality of Dijkstra via Beyond-Worst-Case Heaps &lt;br /&gt;
# What Cannot Be Computed Locally! &lt;br /&gt;
# Impossibility of Distributed Consensus with One Faulty Process &lt;br /&gt;
&lt;br /&gt;
*获取论文原文也是作业的一部分。&lt;br /&gt;
*需要在review中注明参与完成 review 的每个同学的贡献。&lt;br /&gt;
*到[https://table.nju.edu.cn/dtable/links/1c631cfdfeab4c7093d1 南大表格]填写表格来认领论文。&lt;br /&gt;
*有问题可以问老师或者助教。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13799</id>
		<title>高级算法 (Spring 2026)/大作业</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13799"/>
		<updated>2026-06-06T01:37:32Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* 至多四人一组，从以下论文中选择一篇，撰写一篇 review，中英文不限。&lt;br /&gt;
**你需要尽可能详细地解释：该论文解决了什么问题，该问题为什么重要（或者提出了什么技术，该技术为什么重要），该问题有什么相关研究（包括该论文提到的，和没提到的，以及在该论文发表之后的新的相关研究），为了解决该问题该论文提出了什么技术，该技术背后的直觉是什么，该技术有什么非凡之处厉害之处。&lt;br /&gt;
**最后尽可能详细地（以一个挑剔严谨的、没有读过该论文的同学可以通过阅读你的 review 来轻松地弄明白、来轻松地验证为标准）解释该技术是如何实现的，如何证明该技术的正确性和优越性。&lt;br /&gt;
* 结果分数30%，过程分数70%. 必须使用 Notion / Overleaf / Google Docs / Word Online / Github 等在线的有版本历史的工具。(如需使用 overleaf student plan 这样的付费服务可以向老师申请，老师予以报销。 notion education plus 是免费的。）&lt;br /&gt;
**教师和助教应能够看到论文从资料收集、逐渐理解、观点形成、草稿撰写到反复修改的过程。如果记录不完整会扣除过程分。没有记录视为作弊。不接受截止日前一次性上传完整论文作为有效过程记录。&lt;br /&gt;
**必须开放可以随时在线访问的版本历史供教师或助教检查，老师会在你们撰写的过程中偶尔查看你们的进展。&lt;br /&gt;
**小组成员尽量保留阅读笔记、草稿和修改记录，需在设法留下各自贡献的痕迹。&lt;br /&gt;
**有不懂的地方允许咨询AI帮助理解，或者求助AI帮助查询信息，但是不接受AI代写。需将AI使用记录放入版本历史中一并以可追溯的方式提交。&lt;br /&gt;
** 教师或助教可能在提交后随机抽取小组进行口头检查。每位成员都需要解释自己负责的内容、论文的核心论点、主要参考文献、修改过程以及 AI 工具的使用情况。若学生无法解释提交内容，或过程记录与最终文本严重不符，将被视为学术诚信风险，并影响成绩。&lt;br /&gt;
&lt;br /&gt;
# Succinct dynamic dictionaries and trees &lt;br /&gt;
# On Data Structures and Asymmetric Communication Complexity &lt;br /&gt;
# A Hash Table Without Hash Functions, and How to Get the Most Out of Your Random Bits &lt;br /&gt;
# Lower bounds on Locality Sensitive Hashing （很短，但是你需要解释其中的傅里叶分析） &lt;br /&gt;
# Data structures meet cryptography: 3SUM with preprocessing &lt;br /&gt;
# Optimal resizable arrays &lt;br /&gt;
# Tiny Pointers &lt;br /&gt;
# How to Approximate A Set Without Knowing Its Size In Advance &lt;br /&gt;
# Succinct Filters for Sets of Unknown Sizes &lt;br /&gt;
# Succincter. M Patrascu. 2008 &lt;br /&gt;
# Changing base without losing space&lt;br /&gt;
# Unifying the Landscape of Cell-Probe Lower Bounds &lt;br /&gt;
# Optimal Space Lower Bounds for all Frequency Moments &lt;br /&gt;
# Tight Lower Bounds for the Distinct Elements Problem &lt;br /&gt;
# On the Cell Probe Complexity of Dynamic Membership &lt;br /&gt;
# External Memory Priority Queues with Decrease-Key and Applications to Graph Algorithms &lt;br /&gt;
# An Improved Distributed Algorithm for Maximal Independent Set &lt;br /&gt;
# Breaking the &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt; bit barrier: Scalable byzantine agreement with an adaptive adversary &lt;br /&gt;
# Simple Contention Resolution via Multiplicative Weight Updates &lt;br /&gt;
# Universal Optimality of Dijkstra via Beyond-Worst-Case Heaps &lt;br /&gt;
# What Cannot Be Computed Locally! &lt;br /&gt;
# Impossibility of Distributed Consensus with One Faulty Process &lt;br /&gt;
&lt;br /&gt;
*获取论文原文也是作业的一部分。&lt;br /&gt;
*需要在review中注明参与完成 review 的每个同学的贡献。&lt;br /&gt;
*到[https://table.nju.edu.cn/dtable/links/1c631cfdfeab4c7093d1 南大表格]填写表格来认领论文。有问题可以问老师或者助教。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13798</id>
		<title>高级算法 (Spring 2026)/大作业</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13798"/>
		<updated>2026-06-06T01:33:48Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* 至多四人一组，从以下论文中选择一篇，撰写一篇 review，中英文不限。&lt;br /&gt;
**你需要尽可能详细地解释：该论文解决了什么问题，该问题为什么重要（或者提出了什么技术，该技术为什么重要），该问题有什么相关研究（包括该论文提到的，和没提到的，以及在该论文发表之后的新的相关研究），为了解决该问题该论文提出了什么技术，该技术背后的直觉是什么，该技术有什么非凡之处厉害之处。&lt;br /&gt;
**最后尽可能详细地（以一个挑剔严谨的、没有读过该论文的同学可以通过阅读你的 review 来轻松地弄明白、来轻松地验证为标准）解释该技术是如何实现的，如何证明该技术的正确性和优越性。&lt;br /&gt;
* 结果分数30%，过程分数70%. 必须使用 Notion / Overleaf / Google Docs / Word Online / Github 等在线的有版本历史的工具。(如需使用 overleaf student plan / notion plus 这样的付费服务可以向老师申请，老师予以报销）&lt;br /&gt;
**教师和助教应能够看到论文从资料收集、逐渐理解、观点形成、草稿撰写到反复修改的过程。如果记录不完整会扣除过程分。没有记录视为作弊。不接受截止日前一次性上传完整论文作为有效过程记录。&lt;br /&gt;
**必须开放可以随时在线访问的版本历史供教师或助教检查，老师会在你们撰写的过程中偶尔查看你们的进展。&lt;br /&gt;
**小组成员尽量保留阅读笔记、草稿和修改记录，需在设法留下各自贡献的痕迹。&lt;br /&gt;
**有不懂的地方允许咨询AI帮助理解，或者求助AI帮助查询信息，但是不接受AI代写。需将AI使用记录放入版本历史中一并以可追溯的方式提交。&lt;br /&gt;
** 教师或助教可能在提交后随机抽取小组进行口头检查。每位成员都需要解释自己负责的内容、论文的核心论点、主要参考文献、修改过程以及 AI 工具的使用情况。若学生无法解释提交内容，或过程记录与最终文本严重不符，将被视为学术诚信风险，并影响成绩。&lt;br /&gt;
&lt;br /&gt;
# Succinct dynamic dictionaries and trees &lt;br /&gt;
# On Data Structures and Asymmetric Communication Complexity &lt;br /&gt;
# A Hash Table Without Hash Functions, and How to Get the Most Out of Your Random Bits &lt;br /&gt;
# Lower bounds on Locality Sensitive Hashing （很短，但是你需要解释其中的傅里叶分析） &lt;br /&gt;
# Data structures meet cryptography: 3SUM with preprocessing &lt;br /&gt;
# Optimal resizable arrays &lt;br /&gt;
# Tiny Pointers &lt;br /&gt;
# How to Approximate A Set Without Knowing Its Size In Advance &lt;br /&gt;
# Succinct Filters for Sets of Unknown Sizes &lt;br /&gt;
# Succincter. M Patrascu. 2008 &lt;br /&gt;
# Changing base without losing space&lt;br /&gt;
# Unifying the Landscape of Cell-Probe Lower Bounds &lt;br /&gt;
# Optimal Space Lower Bounds for all Frequency Moments &lt;br /&gt;
# Tight Lower Bounds for the Distinct Elements Problem &lt;br /&gt;
# On the Cell Probe Complexity of Dynamic Membership &lt;br /&gt;
# External Memory Priority Queues with Decrease-Key and Applications to Graph Algorithms &lt;br /&gt;
# An Improved Distributed Algorithm for Maximal Independent Set &lt;br /&gt;
# Breaking the &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt; bit barrier: Scalable byzantine agreement with an adaptive adversary &lt;br /&gt;
# Simple Contention Resolution via Multiplicative Weight Updates &lt;br /&gt;
# Universal Optimality of Dijkstra via Beyond-Worst-Case Heaps &lt;br /&gt;
# What Cannot Be Computed Locally! &lt;br /&gt;
# Impossibility of Distributed Consensus with One Faulty Process &lt;br /&gt;
&lt;br /&gt;
*获取论文原文也是作业的一部分。&lt;br /&gt;
*需要在review中注明参与完成 review 的每个同学的贡献。&lt;br /&gt;
*到[https://table.nju.edu.cn/dtable/links/1c631cfdfeab4c7093d1 南大表格]填写表格来认领论文。有问题可以问老师或者助教。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13797</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13797"/>
		<updated>2026-06-06T01:32:19Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 课后作业 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039; Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/11)&#039;&#039;&#039; 第一节课（9am-10am）期中考试&lt;br /&gt;
* &#039;&#039;&#039;(2026/6/1)&#039;&#039;&#039; 老师出差，停课一次&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
*[[高级算法_(Spring_2026)/大作业|大作业]]。 暂定7月30日截止，将本作业的在线访问链接填写到表格中供老师和助教检查和验收。&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
# [https://box.nju.edu.cn/f/c44c13910eff43ffaf7f/ Dimensionality reduction]&lt;br /&gt;
#* Johnson-Lindenstrauss Transformation:&lt;br /&gt;
#** Intuition: In high-dimensional spaces, a uniformly random vector is almost certainly nearly orthogonal to any fixed vector&lt;br /&gt;
#** Constructions: independent Gaussian entries, projection onto uniform random subspace, i.i.d. -1/+1 entries&lt;br /&gt;
#** Modern applications: TurboQuant versus RaBitQ versus Quantized  JL&lt;br /&gt;
#** Fast Johnson-Lindenstrauss Transformation&lt;br /&gt;
#* Approximate Nearest Neighbor Search: by dimensionality reduction, by Locality Sensitive Hashing (LSH)&lt;br /&gt;
#* Oblivious Subspace Embedding (OSE): net argument&lt;br /&gt;
#** Application: linear regression by sketch-and-solve via OSE, linear regression by fast iteration with OSE&lt;br /&gt;
#** Sparse Oblivious Subspace Embedding: count sketch&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13796</id>
		<title>高级算法 (Spring 2026)/大作业</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13796"/>
		<updated>2026-06-06T01:25:25Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* 至多四人一组，从以下论文中选择一篇，撰写一篇 review，中英文不限。&lt;br /&gt;
**你需要尽可能详细地解释：该论文解决了什么问题，该问题为什么重要（或者提出了什么技术，该技术为什么重要），该问题有什么相关研究（包括该论文提到的，和没提到的，以及在该论文发表之后的新的相关研究），为了解决该问题该论文提出了什么技术，该技术背后的直觉是什么，该技术有什么非凡之处厉害之处。&lt;br /&gt;
**最后尽可能详细地（以一个挑剔严谨的、没有读过该论文的同学可以通过阅读你的 review 来轻松地弄明白、来轻松地验证为标准）解释该技术是如何实现的，如何证明该技术的正确性和优越性。&lt;br /&gt;
* 结果分数30%，过程分数70%. 必须使用 Notion / Overleaf / Google Docs / Word Online / Github 等在线的有版本历史的工具。(需要使用 overleaf student plan 这样的付费服务可以向老师申请，老师予以报销）&lt;br /&gt;
**教师和助教应能够看到论文从资料收集、逐渐理解、观点形成、草稿撰写到反复修改的过程。如果记录不完整会扣除过程分。没有记录视为作弊。不接受截止日前一次性上传完整论文作为有效过程记录。&lt;br /&gt;
**必须开放可以随时在线访问的版本历史供教师或助教检查，老师会在你们撰写的过程中偶尔查看你们的进展。&lt;br /&gt;
**小组成员尽量保留阅读笔记、草稿和修改记录，需在设法留下各自贡献的痕迹。&lt;br /&gt;
**有不懂的地方允许咨询AI帮助理解，或者求助AI帮助查询信息，但是不接受AI代写。需将AI使用记录放入版本历史中一并以可追溯的方式提交。&lt;br /&gt;
** 教师或助教可能在提交后随机抽取小组进行口头检查。每位成员都需要解释自己负责的内容、论文的核心论点、主要参考文献、修改过程以及 AI 工具的使用情况。若学生无法解释提交内容，或过程记录与最终文本严重不符，将被视为学术诚信风险，并影响成绩。&lt;br /&gt;
&lt;br /&gt;
# Succinct dynamic dictionaries and trees &lt;br /&gt;
# On Data Structures and Asymmetric Communication Complexity &lt;br /&gt;
# A Hash Table Without Hash Functions, and How to Get the Most Out of Your Random Bits &lt;br /&gt;
# Lower bounds on Locality Sensitive Hashing （很短，但是你需要解释其中的傅里叶分析） &lt;br /&gt;
# Data structures meet cryptography: 3SUM with preprocessing &lt;br /&gt;
# Optimal resizable arrays &lt;br /&gt;
# Tiny Pointers &lt;br /&gt;
# How to Approximate A Set Without Knowing Its Size In Advance &lt;br /&gt;
# Succinct Filters for Sets of Unknown Sizes &lt;br /&gt;
# Succincter. M Patrascu. 2008 &lt;br /&gt;
# Changing base without losing space&lt;br /&gt;
# Unifying the Landscape of Cell-Probe Lower Bounds &lt;br /&gt;
# Optimal Space Lower Bounds for all Frequency Moments &lt;br /&gt;
# Tight Lower Bounds for the Distinct Elements Problem &lt;br /&gt;
# On the Cell Probe Complexity of Dynamic Membership &lt;br /&gt;
# External Memory Priority Queues with Decrease-Key and Applications to Graph Algorithms &lt;br /&gt;
# An Improved Distributed Algorithm for Maximal Independent Set &lt;br /&gt;
# Breaking the &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt; bit barrier: Scalable byzantine agreement with an adaptive adversary &lt;br /&gt;
# Simple Contention Resolution via Multiplicative Weight Updates &lt;br /&gt;
# Universal Optimality of Dijkstra via Beyond-Worst-Case Heaps &lt;br /&gt;
# What Cannot Be Computed Locally! &lt;br /&gt;
# Impossibility of Distributed Consensus with One Faulty Process &lt;br /&gt;
&lt;br /&gt;
*获取论文原文也是作业的一部分。&lt;br /&gt;
*需要在review中注明参与完成 review 的每个同学的贡献。&lt;br /&gt;
*到[https://table.nju.edu.cn/dtable/links/1c631cfdfeab4c7093d1 南大表格]填写表格来认领论文。有问题可以问老师或者助教。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13795</id>
		<title>高级算法 (Spring 2026)/大作业</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13795"/>
		<updated>2026-06-06T01:23:18Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* 至多四人一组，从以下论文中选择一篇，撰写一篇 review，中英文不限。&lt;br /&gt;
**你需要尽可能详细地解释：该论文解决了什么问题，该问题为什么重要（或者提出了什么技术，该技术为什么重要），该问题有什么相关研究（包括该论文提到的，和没提到的，以及在该论文发表之后的新的相关研究），为了解决该问题该论文提出了什么技术，该技术背后的直觉是什么，该技术有什么非凡之处厉害之处。&lt;br /&gt;
**最后尽可能详细地（以一个挑剔严谨的、没有读过该论文的同学可以通过阅读你的 review 来轻松地弄明白、来轻松地验证为标准）解释该技术是如何实现的，如何证明该技术的正确性和优越性。&lt;br /&gt;
* 结果分数30%，过程分数70%. 必须使用 Notion / Overleaf / Google Docs / Word Online / Github 等在线的有版本历史的工具。(需要使用 overleaf student plan 这样的付费服务可以向老师申请，老师予以报销）&lt;br /&gt;
**教师和助教应能够看到论文从资料收集、逐渐理解、观点形成、草稿撰写到反复修改的过程。如果记录不完整会扣除过程分。没有记录视为作弊。不接受截止日前一次性上传完整论文作为有效过程记录。&lt;br /&gt;
**必须开放可以随时在线访问的版本历史供教师或助教检查，老师会在你们撰写的过程中偶尔查看你们的进展。&lt;br /&gt;
**小组成员尽量保留阅读笔记、草稿和修改记录，需在设法留下各自贡献的痕迹。&lt;br /&gt;
**有不懂的地方允许咨询AI帮助理解，或者求助AI帮助查询信息，但是不接受AI代写。需将AI使用记录放入版本历史中一并以可追溯的方式提交。&lt;br /&gt;
** 教师或助教可能在提交后随机抽取小组进行口头检查。每位成员都需要解释自己负责的内容、论文的核心论点、主要参考文献、修改过程以及 AI 工具的使用情况。若学生无法解释提交内容，或过程记录与最终文本严重不符，将被视为学术诚信风险，并影响成绩。&lt;br /&gt;
&lt;br /&gt;
# Succinct dynamic dictionaries and trees &lt;br /&gt;
# On Data Structures and Asymmetric Communication Complexity &lt;br /&gt;
# A Hash Table Without Hash Functions, and How to Get the Most Out of Your Random Bits &lt;br /&gt;
# Lower bounds on Locality Sensitive Hashing （很短，但是你需要解释其中的傅里叶分析） &lt;br /&gt;
# Data structures meet cryptography: 3SUM with preprocessing &lt;br /&gt;
# Optimal resizable arrays &lt;br /&gt;
# Tiny Pointers &lt;br /&gt;
# How to Approximate A Set Without Knowing Its Size In Advance &lt;br /&gt;
# Succinct Filters for Sets of Unknown Sizes &lt;br /&gt;
# Succincter. M Patrascu. 2008 &lt;br /&gt;
# Changing base without losing space&lt;br /&gt;
# Unifying the Landscape of Cell-Probe Lower Bounds &lt;br /&gt;
# Optimal Space Lower Bounds for all Frequency Moments &lt;br /&gt;
# Tight Lower Bounds for the Distinct Elements Problem &lt;br /&gt;
# On the Cell Probe Complexity of Dynamic Membership &lt;br /&gt;
# External Memory Priority Queues with Decrease-Key and Applications to Graph Algorithms &lt;br /&gt;
# An Improved Distributed Algorithm for Maximal Independent Set &lt;br /&gt;
# Breaking the &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt; bit barrier: Scalable byzantine agreement with an adaptive adversary &lt;br /&gt;
# Simple Contention Resolution via Multiplicative Weight Updates &lt;br /&gt;
# Universal Optimality of Dijkstra via Beyond-Worst-Case Heaps &lt;br /&gt;
# What Cannot Be Computed Locally! &lt;br /&gt;
# Impossibility of Distributed Consensus with One Faulty Process &lt;br /&gt;
&lt;br /&gt;
*获取论文原文也是作业的一部分。&lt;br /&gt;
*需要在review中注明参与完成 review 的每个同学的贡献。&lt;br /&gt;
*到[https://table.nju.edu.cn/dtable/external-links/c4bc4c8a1669451ba854/ 南大表格]填写表格来认领论文。有问题可以问老师或者助教。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13794</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13794"/>
		<updated>2026-06-05T18:16:56Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 课后作业 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039; Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/11)&#039;&#039;&#039; 第一节课（9am-10am）期中考试&lt;br /&gt;
* &#039;&#039;&#039;(2026/6/1)&#039;&#039;&#039; 老师出差，停课一次&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
*[[高级算法_(Spring_2026)/大作业|大作业]]。 DDL：TBA&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
# [https://box.nju.edu.cn/f/c44c13910eff43ffaf7f/ Dimensionality reduction]&lt;br /&gt;
#* Johnson-Lindenstrauss Transformation:&lt;br /&gt;
#** Intuition: In high-dimensional spaces, a uniformly random vector is almost certainly nearly orthogonal to any fixed vector&lt;br /&gt;
#** Constructions: independent Gaussian entries, projection onto uniform random subspace, i.i.d. -1/+1 entries&lt;br /&gt;
#** Modern applications: TurboQuant versus RaBitQ versus Quantized  JL&lt;br /&gt;
#** Fast Johnson-Lindenstrauss Transformation&lt;br /&gt;
#* Approximate Nearest Neighbor Search: by dimensionality reduction, by Locality Sensitive Hashing (LSH)&lt;br /&gt;
#* Oblivious Subspace Embedding (OSE): net argument&lt;br /&gt;
#** Application: linear regression by sketch-and-solve via OSE, linear regression by fast iteration with OSE&lt;br /&gt;
#** Sparse Oblivious Subspace Embedding: count sketch&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13793</id>
		<title>高级算法 (Spring 2026)/大作业</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13793"/>
		<updated>2026-06-05T18:11:54Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* 至多四人一组，从以下论文中选择一篇，撰写一篇 review，中英文不限。&lt;br /&gt;
**你需要尽可能详细地解释：该论文解决了什么问题，该问题为什么重要（或者提出了什么技术，该技术为什么重要），该问题有什么相关研究（包括该论文提到的，和没提到的，以及在该论文发表之后的新的相关研究），为了解决该问题该论文提出了什么技术，该技术背后的直觉是什么，该技术有什么非凡之处厉害之处。&lt;br /&gt;
**最后尽可能详细地（以一个挑剔严谨的、没有读过该论文的同学可以通过阅读你的 review 来轻松地弄明白、来轻松地验证为标准）解释该技术是如何实现的，如何证明该技术的正确性和优越性。&lt;br /&gt;
* 结果分数30%，过程分数70%. 必须使用 Notion / Overleaf / Google Docs / Word Online / Github 等在线的有版本历史的工具。(需要使用 overleaf student plan 这样的付费服务可以向老师申请，老师予以报销）&lt;br /&gt;
**教师和助教应能够看到论文从资料收集、逐渐理解、观点形成、草稿撰写到反复修改的过程。如果记录不完整会扣除过程分。没有记录视为作弊。不接受截止日前一次性上传完整论文作为有效过程记录。&lt;br /&gt;
**必须开放可以随时在线访问的版本历史供教师或助教检查，老师会在你们撰写的过程中偶尔查看你们的进展。&lt;br /&gt;
**小组成员尽量保留阅读笔记、草稿和修改记录，需在设法留下各自贡献的痕迹。&lt;br /&gt;
**有不懂的地方允许咨询AI帮助理解，或者求助AI帮助查询信息，但是不接受AI代写。需将AI使用记录放入版本历史中一并以可追溯的方式提交。&lt;br /&gt;
** 教师或助教可能在提交后随机抽取小组进行口头检查。每位成员都需要解释自己负责的内容、论文的核心论点、主要参考文献、修改过程以及 AI 工具的使用情况。若学生无法解释提交内容，或过程记录与最终文本严重不符，将被视为学术诚信风险，并影响成绩。&lt;br /&gt;
&lt;br /&gt;
# Succinct dynamic dictionaries and trees &lt;br /&gt;
# On Data Structures and Asymmetric Communication Complexity &lt;br /&gt;
# A Hash Table Without Hash Functions, and How to Get the Most Out of Your Random Bits &lt;br /&gt;
# Lower bounds on Locality Sensitive Hashing （很短，但是你需要解释其中的傅里叶分析） &lt;br /&gt;
# Data structures meet cryptography: 3SUM with preprocessing &lt;br /&gt;
# Optimal resizable arrays &lt;br /&gt;
# Tiny Pointers &lt;br /&gt;
# How to Approximate A Set Without Knowing Its Size In Advance &lt;br /&gt;
# Succinct Filters for Sets of Unknown Sizes &lt;br /&gt;
# Succincter. M Patrascu. 2008 &lt;br /&gt;
# Changing base without losing space&lt;br /&gt;
# Unifying the Landscape of Cell-Probe Lower Bounds &lt;br /&gt;
# Optimal Space Lower Bounds for all Frequency Moments &lt;br /&gt;
# Tight Lower Bounds for the Distinct Elements Problem &lt;br /&gt;
# On the Cell Probe Complexity of Dynamic Membership &lt;br /&gt;
# External Memory Priority Queues with Decrease-Key and Applications to Graph Algorithms &lt;br /&gt;
# An Improved Distributed Algorithm for Maximal Independent Set &lt;br /&gt;
# Breaking the &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt; bit barrier: Scalable byzantine agreement with an adaptive adversary &lt;br /&gt;
# Simple Contention Resolution via Multiplicative Weight Updates &lt;br /&gt;
# Universal Optimality of Dijkstra via Beyond-Worst-Case Heaps &lt;br /&gt;
# What Cannot Be Computed Locally! &lt;br /&gt;
# Impossibility of Distributed Consensus with One Faulty Process &lt;br /&gt;
&lt;br /&gt;
*获取论文原文也是作业的一部分。&lt;br /&gt;
*需要在review中注明参与完成 review 的每个同学的贡献。&lt;br /&gt;
*到qq群中填写表格来认领论文。有问题可以问老师或者助教。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13792</id>
		<title>高级算法 (Spring 2026)/大作业</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13792"/>
		<updated>2026-06-05T18:04:36Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* 至多四人一组，从以下论文中选择一篇，撰写一篇 review，中英文不限。&lt;br /&gt;
**你需要尽可能详细地解释：该论文解决了什么问题，该问题为什么重要（或者提出了什么技术，该技术为什么重要），该问题有什么相关研究（包括该论文提到的，和没提到的，以及在该论文发表之后的新的相关研究），为了解决该问题该论文提出了什么技术，该技术背后的直觉是什么，该技术有什么非凡之处厉害之处。&lt;br /&gt;
**最后尽可能详细地（以一个挑剔严谨的、没有读过该论文的同学可以通过阅读你的 review 来轻松地弄明白、来轻松地验证为标准）解释该技术是如何实现的，如何证明该技术的正确性和优越性。&lt;br /&gt;
* 结果分数30%，过程分数70%. 必须使用 Notion / Overleaf / Google Docs / Word Online / Github 等在线的有版本历史的工具。&lt;br /&gt;
**并且能够通过版本历史追溯你们逐渐加深理解、反复修改、最终逐渐完成的过程。如果记录不完整会扣除过程分。没有记录视为作弊。不接受截止日前一次性上传完整论文作为有效过程记录。&lt;br /&gt;
**必须开放可以随时在线访问的版本历史供教师或助教检查，老师会在你们撰写的过程中偶尔查看你们的进展。&lt;br /&gt;
**小组成员尽量保留阅读笔记、草稿和修改记录，需在设法留下各自贡献的痕迹。&lt;br /&gt;
**有不懂的地方允许咨询AI帮助理解，或者求助AI帮助查询信息，但是不接受AI代写。需将AI使用记录放入版本历史中一并以可追溯的方式提交。&lt;br /&gt;
** 教师或助教可能在提交后随机抽取小组进行口头检查。每位成员都需要解释自己负责的内容、论文的核心论点、主要参考文献、修改过程以及 AI 工具的使用情况。若学生无法解释提交内容，或过程记录与最终文本严重不符，将被视为学术诚信风险，并影响成绩。&lt;br /&gt;
&lt;br /&gt;
# Succinct dynamic dictionaries and trees &lt;br /&gt;
# On Data Structures and Asymmetric Communication Complexity &lt;br /&gt;
# A Hash Table Without Hash Functions, and How to Get the Most Out of Your Random Bits &lt;br /&gt;
# Lower bounds on Locality Sensitive Hashing （很短，但是你需要解释其中的傅里叶分析） &lt;br /&gt;
# Data structures meet cryptography: 3SUM with preprocessing &lt;br /&gt;
# Optimal resizable arrays &lt;br /&gt;
# Tiny Pointers &lt;br /&gt;
# How to Approximate A Set Without Knowing Its Size In Advance &lt;br /&gt;
# Succinct Filters for Sets of Unknown Sizes &lt;br /&gt;
# Succincter. M Patrascu. 2008 &lt;br /&gt;
# Changing base without losing space&lt;br /&gt;
# Unifying the Landscape of Cell-Probe Lower Bounds &lt;br /&gt;
# Optimal Space Lower Bounds for all Frequency Moments &lt;br /&gt;
# Tight Lower Bounds for the Distinct Elements Problem &lt;br /&gt;
# On the Cell Probe Complexity of Dynamic Membership &lt;br /&gt;
# External Memory Priority Queues with Decrease-Key and Applications to Graph Algorithms &lt;br /&gt;
# An Improved Distributed Algorithm for Maximal Independent Set &lt;br /&gt;
# Breaking the &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt; bit barrier: Scalable byzantine agreement with an adaptive adversary &lt;br /&gt;
# Simple Contention Resolution via Multiplicative Weight Updates &lt;br /&gt;
# Universal Optimality of Dijkstra via Beyond-Worst-Case Heaps &lt;br /&gt;
# What Cannot Be Computed Locally! &lt;br /&gt;
# Impossibility of Distributed Consensus with One Faulty Process &lt;br /&gt;
&lt;br /&gt;
获取论文原文也是作业的一部分。需要在review中注明参与完成 review 的每个同学的贡献。到qq群中填写表格来认领论文。有问题可以问老师或者助教。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13791</id>
		<title>高级算法 (Spring 2026)/大作业</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)/%E5%A4%A7%E4%BD%9C%E4%B8%9A&amp;diff=13791"/>
		<updated>2026-06-05T18:04:22Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: Created page with &amp;quot;* 至多四人一组，从以下论文中选择一篇，撰写一篇 review，中英文不限。 **你需要尽可能详细地解释：该论文解决了什么问题，该问题为什么重要（或者提出了什么技术，该技术为什么重要），该问题有什么相关研究（包括该论文提到的，和没提到的，以及在该论文发表之后的新的相关研究），为了解决该问题该论文提出了什么技术，该技术背后的直觉是什...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* 至多四人一组，从以下论文中选择一篇，撰写一篇 review，中英文不限。&lt;br /&gt;
**你需要尽可能详细地解释：该论文解决了什么问题，该问题为什么重要（或者提出了什么技术，该技术为什么重要），该问题有什么相关研究（包括该论文提到的，和没提到的，以及在该论文发表之后的新的相关研究），为了解决该问题该论文提出了什么技术，该技术背后的直觉是什么，该技术有什么非凡之处厉害之处。&lt;br /&gt;
**最后尽可能详细地（以一个挑剔严谨的、没有读过该论文的同学可以通过阅读你的 review 来轻松地弄明白、来轻松地验证为标准）解释该技术是如何实现的，如何证明该技术的正确性和优越性。&lt;br /&gt;
* 结果分数30%，过程分数70%。必须使用 Notion / Overleaf / Google Docs / Word Online / Github 等在线的有版本历史的工具。&lt;br /&gt;
**并且能够通过版本历史追溯你们逐渐加深理解、反复修改、最终逐渐完成的过程。如果记录不完整会扣除过程分。没有记录视为作弊。不接受截止日前一次性上传完整论文作为有效过程记录。&lt;br /&gt;
**必须开放可以随时在线访问的版本历史供教师或助教检查，老师会在你们撰写的过程中偶尔查看你们的进展。&lt;br /&gt;
**小组成员尽量保留阅读笔记、草稿和修改记录，需在设法留下各自贡献的痕迹。&lt;br /&gt;
**有不懂的地方允许咨询AI帮助理解，或者求助AI帮助查询信息，但是不接受AI代写。需将AI使用记录放入版本历史中一并以可追溯的方式提交。&lt;br /&gt;
** 教师或助教可能在提交后随机抽取小组进行口头检查。每位成员都需要解释自己负责的内容、论文的核心论点、主要参考文献、修改过程以及 AI 工具的使用情况。若学生无法解释提交内容，或过程记录与最终文本严重不符，将被视为学术诚信风险，并影响成绩。&lt;br /&gt;
&lt;br /&gt;
# Succinct dynamic dictionaries and trees &lt;br /&gt;
# On Data Structures and Asymmetric Communication Complexity &lt;br /&gt;
# A Hash Table Without Hash Functions, and How to Get the Most Out of Your Random Bits &lt;br /&gt;
# Lower bounds on Locality Sensitive Hashing （很短，但是你需要解释其中的傅里叶分析） &lt;br /&gt;
# Data structures meet cryptography: 3SUM with preprocessing &lt;br /&gt;
# Optimal resizable arrays &lt;br /&gt;
# Tiny Pointers &lt;br /&gt;
# How to Approximate A Set Without Knowing Its Size In Advance &lt;br /&gt;
# Succinct Filters for Sets of Unknown Sizes &lt;br /&gt;
# Succincter. M Patrascu. 2008 &lt;br /&gt;
# Changing base without losing space&lt;br /&gt;
# Unifying the Landscape of Cell-Probe Lower Bounds &lt;br /&gt;
# Optimal Space Lower Bounds for all Frequency Moments &lt;br /&gt;
# Tight Lower Bounds for the Distinct Elements Problem &lt;br /&gt;
# On the Cell Probe Complexity of Dynamic Membership &lt;br /&gt;
# External Memory Priority Queues with Decrease-Key and Applications to Graph Algorithms &lt;br /&gt;
# An Improved Distributed Algorithm for Maximal Independent Set &lt;br /&gt;
# Breaking the &amp;lt;math&amp;gt;O(n^2)&amp;lt;/math&amp;gt; bit barrier: Scalable byzantine agreement with an adaptive adversary &lt;br /&gt;
# Simple Contention Resolution via Multiplicative Weight Updates &lt;br /&gt;
# Universal Optimality of Dijkstra via Beyond-Worst-Case Heaps &lt;br /&gt;
# What Cannot Be Computed Locally! &lt;br /&gt;
# Impossibility of Distributed Consensus with One Faulty Process &lt;br /&gt;
&lt;br /&gt;
获取论文原文也是作业的一部分。需要在review中注明参与完成 review 的每个同学的贡献。到qq群中填写表格来认领论文。有问题可以问老师或者助教。&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13779</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13779"/>
		<updated>2026-05-28T07:11:31Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 通知 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039; Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/11)&#039;&#039;&#039; 第一节课（9am-10am）期中考试&lt;br /&gt;
* &#039;&#039;&#039;(2026/6/1)&#039;&#039;&#039; 老师出差，停课一次&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
# [https://box.nju.edu.cn/f/c44c13910eff43ffaf7f/ Dimensionality reduction]&lt;br /&gt;
#* Johnson-Lindenstrauss Transformation:&lt;br /&gt;
#** Intuition: In high-dimensional spaces, a uniformly random vector is almost certainly nearly orthogonal to any fixed vector&lt;br /&gt;
#** Constructions: independent Gaussian entries, projection onto uniform random subspace, i.i.d. -1/+1 entries&lt;br /&gt;
#** Modern applications: TurboQuant versus RaBitQ versus Quantized  JL&lt;br /&gt;
#** Fast Johnson-Lindenstrauss Transformation&lt;br /&gt;
#* Approximate Nearest Neighbor Search: by dimensionality reduction, by Locality Sensitive Hashing (LSH)&lt;br /&gt;
#* Oblivious Subspace Embedding (OSE): net argument&lt;br /&gt;
#** Application: linear regression by sketch-and-solve via OSE, linear regression by fast iteration with OSE&lt;br /&gt;
#** Sparse Oblivious Subspace Embedding: count sketch&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13742</id>
		<title>计算理论之美 (Summer 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13742"/>
		<updated>2026-05-14T03:27:53Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* Tentative Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox &lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|headerstyle  = background:#4D72BE;&lt;br /&gt;
|labelstyle   = background:#DAE1F0;&lt;br /&gt;
&lt;br /&gt;
|header1 = &amp;lt;font size=3, color=white&amp;gt;计算理论之美&amp;lt;/font&amp;gt;&lt;br /&gt;
|label2  = {{Nowrap|负责人}} &lt;br /&gt;
|data2   = 黄棱潇 ([mailto:huanglingxiao@nju.edu.cn huanglingxiao@nju.edu.cn]) &lt;br /&gt;
|label4 = 时间&lt;br /&gt;
|data4  = 2026.7.24 — 2026.7.27&lt;br /&gt;
|label5 = 地点&lt;br /&gt;
|data5  = {{Nowrap|南京大学苏州校区 TBA}}&lt;br /&gt;
|belowstyle = background:#DAE1F0;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
由南京大学计算机学院和智能软件学院支持的第5届“计算理论之美”暑期讲习班将于2026年7月24日至7月27日在江苏省苏州市南京大学苏州校区开班。本次讲习班将围绕算法设计主题开展系列报告，包括组合最优化、哈希表、差分隐私、量子计算、数据结构复杂性、图计算等板块，主要面向对理论计算机科学以及计算机科学中的数学感兴趣的国内外本科生，安排4天的高级课程。内容深入浅出，由国内外一线的优秀学者讲授，使学员初步了解理论计算机科学的一些研究前沿、初步掌握一些新理论与新方法，为有志于从事理论计算机科学研究的学者打下一定的基础，也让从事其他相关方向研究的学生与教师们领略计算理论的魅力。&lt;br /&gt;
&lt;br /&gt;
联系邮箱：nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
联系人：&lt;br /&gt;
* 黄棱潇：	huanglingxiao@nju.edu.cn&lt;br /&gt;
* 刘明谋：	lmm@nju.edu.cn&lt;br /&gt;
* 班吟：		175227530@qq.com&lt;br /&gt;
&lt;br /&gt;
注册报名流程：由于前几届报名人数过多，本届将会采用问卷初筛形式进行报名。请同学们先填写以下[TBA 调查问卷]:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
通过初筛后的同学将提前两周收到包含报名链接的邮件。&lt;br /&gt;
南大同学仅需填写问卷，讲习班期间直接到会场听报告即可。&lt;br /&gt;
&lt;br /&gt;
费用：本科生包住宿，非本科生不包含住宿。餐费自理&lt;br /&gt;
问卷报名截止日期： TBD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tentative Schedule ==&lt;br /&gt;
&lt;br /&gt;
Venue (地点)：南京大学苏州校区TBA&lt;br /&gt;
&lt;br /&gt;
Group photo: 7月TBD日上午茶歇环节中安排参会者合影留念&lt;br /&gt;
&lt;br /&gt;
Speakers (in lexicographic order): 陈林（浙江大学）、刘明谋（南京大学）、Pasin Manurangsi（Google Research）、王启圣（上海交通大学）、俞华程（普林斯顿大学）、张天翼（南京大学）、TBD&lt;br /&gt;
&lt;br /&gt;
== Take-home Exams ==&lt;br /&gt;
成绩优秀的同学可推荐参加南京大学计算机学院预推免保研面试，并在录取后可凭借此次暑期讲习班申请两个研究生学分。&lt;br /&gt;
&lt;br /&gt;
作业提交方式：发送电子版到邮箱nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
== Links to Past Summer Schools ==&lt;br /&gt;
* [[计算理论之美 (Summer 2025)|计算理论之美暑期学校 (Summer 2025)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2024)|计算理论之美暑期学校 (Summer 2024)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2023)|计算理论之美暑期学校 (Summer 2023)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2021)|计算理论之美暑期学校 (Summer 2021)]]&lt;br /&gt;
&lt;br /&gt;
== About Our Summer School ==&lt;br /&gt;
Our summer school is supported by the School of Computer Science and the School of Intelligent Software and Engineering at Nanjing University and will be held from July 24th to July 27th, 2026, at the Suzhou Campus of Nanjing University in Suzhou, Jiangsu Province, China. The theme of this year&#039;s summer school will be the design and analysis of algorithms, with topics ranging from combinatorial optimization, hash table design, differential privacy, quantum computing, data structure compelxity, and graph algorithms etc. &lt;br /&gt;
Target audience will include aspiring undergraduate and graduate students from China and overseas, and the program will feature 4 days of advanced courses. The courses will be presented by leading young scholars both from within China and overseas, covering both cutting-edge research and modern toolkits in theoretical computer science. &lt;br /&gt;
The summer school will help connect aspiring young students with young scholars to engage research in theoretical computer science, and embark on a journey to appreciate the charm of computational theory.&lt;br /&gt;
&lt;br /&gt;
Accommodation (shared room) will be provided to undergraduates only.&lt;br /&gt;
&lt;br /&gt;
Due to capacity, we prioritize undergraduates seeking to join NJU TCS group for PhD or for a research intern. To register, please fill out the following form: TBA&lt;br /&gt;
&lt;br /&gt;
If you are selected into our summer school, you will receive a confirmation email.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13741</id>
		<title>计算理论之美 (Summer 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13741"/>
		<updated>2026-05-14T02:25:44Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox &lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|headerstyle  = background:#4D72BE;&lt;br /&gt;
|labelstyle   = background:#DAE1F0;&lt;br /&gt;
&lt;br /&gt;
|header1 = &amp;lt;font size=3, color=white&amp;gt;计算理论之美&amp;lt;/font&amp;gt;&lt;br /&gt;
|label2  = {{Nowrap|负责人}} &lt;br /&gt;
|data2   = 黄棱潇 ([mailto:huanglingxiao@nju.edu.cn huanglingxiao@nju.edu.cn]) &lt;br /&gt;
|label4 = 时间&lt;br /&gt;
|data4  = 2026.7.24 — 2026.7.27&lt;br /&gt;
|label5 = 地点&lt;br /&gt;
|data5  = {{Nowrap|南京大学苏州校区 TBA}}&lt;br /&gt;
|belowstyle = background:#DAE1F0;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
由南京大学计算机学院和智能软件学院支持的第5届“计算理论之美”暑期讲习班将于2026年7月24日至7月27日在江苏省苏州市南京大学苏州校区开班。本次讲习班将围绕算法设计主题开展系列报告，包括组合最优化、哈希表、差分隐私、量子计算、数据结构复杂性、图计算等板块，主要面向对理论计算机科学以及计算机科学中的数学感兴趣的国内外本科生，安排4天的高级课程。内容深入浅出，由国内外一线的优秀学者讲授，使学员初步了解理论计算机科学的一些研究前沿、初步掌握一些新理论与新方法，为有志于从事理论计算机科学研究的学者打下一定的基础，也让从事其他相关方向研究的学生与教师们领略计算理论的魅力。&lt;br /&gt;
&lt;br /&gt;
联系邮箱：nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
联系人：&lt;br /&gt;
* 黄棱潇：	huanglingxiao@nju.edu.cn&lt;br /&gt;
* 刘明谋：	lmm@nju.edu.cn&lt;br /&gt;
* 班吟：		175227530@qq.com&lt;br /&gt;
&lt;br /&gt;
注册报名流程：由于前几届报名人数过多，本届将会采用问卷初筛形式进行报名。请同学们先填写以下[TBA 调查问卷]:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
通过初筛后的同学将提前两周收到包含报名链接的邮件。&lt;br /&gt;
南大同学仅需填写问卷，讲习班期间直接到会场听报告即可。&lt;br /&gt;
&lt;br /&gt;
费用：本科生包住宿，非本科生不包含住宿。餐费自理&lt;br /&gt;
问卷报名截止日期： TBD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tentative Schedule ==&lt;br /&gt;
&lt;br /&gt;
Venue (地点)：南京大学苏州校区TBA&lt;br /&gt;
&lt;br /&gt;
Group photo: 7月TBD日上午茶歇环节中安排参会者合影留念&lt;br /&gt;
&lt;br /&gt;
Speakers (in lexicographic order): 陈林、刘明谋、Pasin Manurangsi、王启圣、俞华程、张天翼、TBD&lt;br /&gt;
&lt;br /&gt;
== Take-home Exams ==&lt;br /&gt;
成绩优秀的同学可推荐参加南京大学计算机学院预推免保研面试，并在录取后可凭借此次暑期讲习班申请两个研究生学分。&lt;br /&gt;
&lt;br /&gt;
作业提交方式：发送电子版到邮箱nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
== Links to Past Summer Schools ==&lt;br /&gt;
* [[计算理论之美 (Summer 2025)|计算理论之美暑期学校 (Summer 2025)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2024)|计算理论之美暑期学校 (Summer 2024)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2023)|计算理论之美暑期学校 (Summer 2023)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2021)|计算理论之美暑期学校 (Summer 2021)]]&lt;br /&gt;
&lt;br /&gt;
== About Our Summer School ==&lt;br /&gt;
Our summer school is supported by the School of Computer Science and the School of Intelligent Software and Engineering at Nanjing University and will be held from July 24th to July 27th, 2026, at the Suzhou Campus of Nanjing University in Suzhou, Jiangsu Province, China. The theme of this year&#039;s summer school will be the design and analysis of algorithms, with topics ranging from combinatorial optimization, hash table design, differential privacy, quantum computing, data structure compelxity, and graph algorithms etc. &lt;br /&gt;
Target audience will include aspiring undergraduate and graduate students from China and overseas, and the program will feature 4 days of advanced courses. The courses will be presented by leading young scholars both from within China and overseas, covering both cutting-edge research and modern toolkits in theoretical computer science. &lt;br /&gt;
The summer school will help connect aspiring young students with young scholars to engage research in theoretical computer science, and embark on a journey to appreciate the charm of computational theory.&lt;br /&gt;
&lt;br /&gt;
Accommodation (shared room) will be provided to undergraduates only.&lt;br /&gt;
&lt;br /&gt;
Due to capacity, we prioritize undergraduates seeking to join NJU TCS group for PhD or for a research intern. To register, please fill out the following form: TBA&lt;br /&gt;
&lt;br /&gt;
If you are selected into our summer school, you will receive a confirmation email.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13740</id>
		<title>计算理论之美 (Summer 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13740"/>
		<updated>2026-05-14T02:22:03Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox &lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|headerstyle  = background:#4D72BE;&lt;br /&gt;
|labelstyle   = background:#DAE1F0;&lt;br /&gt;
&lt;br /&gt;
|header1 = &amp;lt;font size=3, color=white&amp;gt;计算理论之美&amp;lt;/font&amp;gt;&lt;br /&gt;
|label2  = {{Nowrap|负责人}} &lt;br /&gt;
|data2   = 黄棱潇 ([mailto:huanglingxiao@nju.edu.cn huanglingxiao@nju.edu.cn]) &lt;br /&gt;
|label4 = 时间&lt;br /&gt;
|data4  = 2026.7.24 — 2026.7.27&lt;br /&gt;
|label5 = 地点&lt;br /&gt;
|data5  = {{Nowrap|南京大学苏州校区 TBA}}&lt;br /&gt;
|belowstyle = background:#DAE1F0;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
由南京大学计算机学院和智能软件学院支持的第5届“计算理论之美”暑期讲习班将于2026年7月24日至7月27日在江苏省苏州市南京大学苏州校区开班。本次讲习班将围绕算法设计主题开展系列报告，包括TBA等板块，主要面向对理论计算机科学以及计算机科学中的数学感兴趣的国内外本科生，安排4天的高级课程。内容深入浅出，由国内外一线的优秀学者讲授，使学员初步了解理论计算机科学的一些研究前沿、初步掌握一些新理论与新方法，为有志于从事理论计算机科学研究的学者打下一定的基础，也让从事其他相关方向研究的学生与教师们领略计算理论的魅力。&lt;br /&gt;
&lt;br /&gt;
联系邮箱：nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
联系人：&lt;br /&gt;
* 黄棱潇：	huanglingxiao@nju.edu.cn&lt;br /&gt;
* 刘明谋：	lmm@nju.edu.cn&lt;br /&gt;
* 班吟：		175227530@qq.com&lt;br /&gt;
&lt;br /&gt;
注册报名流程：由于前几届报名人数过多，本届将会采用问卷初筛形式进行报名。请同学们先填写以下[TBA 调查问卷]:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
通过初筛后的同学将提前两周收到包含报名链接的邮件。&lt;br /&gt;
南大同学仅需填写问卷，讲习班期间直接到会场听报告即可。&lt;br /&gt;
&lt;br /&gt;
费用：本科生包住宿，非本科生不包含住宿。餐费自理&lt;br /&gt;
问卷报名截止日期： TBD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tentative Schedule ==&lt;br /&gt;
&lt;br /&gt;
Venue (地点)：南京大学苏州校区TBA&lt;br /&gt;
&lt;br /&gt;
Group photo: 7月TBD日上午茶歇环节中安排参会者合影留念&lt;br /&gt;
&lt;br /&gt;
Speakers (in lexicographic order): 陈林、刘明谋、Pasin Manurangsi、王启圣、俞华程、张天翼、TBD&lt;br /&gt;
&lt;br /&gt;
== Take-home Exams ==&lt;br /&gt;
成绩优秀的同学可推荐参加南京大学计算机学院预推免保研面试，并在录取后可凭借此次暑期讲习班申请两个研究生学分。&lt;br /&gt;
&lt;br /&gt;
作业提交方式：发送电子版到邮箱nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
== Links to Past Summer Schools ==&lt;br /&gt;
* [[计算理论之美 (Summer 2025)|计算理论之美暑期学校 (Summer 2025)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2024)|计算理论之美暑期学校 (Summer 2024)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2023)|计算理论之美暑期学校 (Summer 2023)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2021)|计算理论之美暑期学校 (Summer 2021)]]&lt;br /&gt;
&lt;br /&gt;
== About Our Summer School ==&lt;br /&gt;
Our summer school is supported by the School of Computer Science and the School of Intelligent Software and Engineering at Nanjing University and will be held from July 24th to July 27th, 2026, at the Suzhou Campus of Nanjing University in Suzhou, Jiangsu Province, China. The theme of this year&#039;s summer school will be the design and analysis of algorithms, with topics ranging from TBA etc. &lt;br /&gt;
Target audience will include aspiring undergraduate and graduate students from China and overseas, and the program will feature 4 days of advanced courses. The courses will be presented by leading young scholars both from within China and overseas, covering both cutting-edge research and modern toolkits in theoretical computer science. &lt;br /&gt;
The summer school will help connect aspiring young students with young scholars to engage research in theoretical computer science, and embark on a journey to appreciate the charm of computational theory.&lt;br /&gt;
&lt;br /&gt;
Accommodation (shared room) will be provided to undergraduates only.&lt;br /&gt;
&lt;br /&gt;
Due to capacity, we prioritize undergraduates seeking to join NJU TCS group for PhD or for a research intern. To register, please fill out the following form: TBA&lt;br /&gt;
&lt;br /&gt;
If you are selected into our summer school, you will receive a confirmation email.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13739</id>
		<title>计算理论之美 (Summer 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13739"/>
		<updated>2026-05-14T02:06:23Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* Tentative Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox &lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|headerstyle  = background:#4D72BE;&lt;br /&gt;
|labelstyle   = background:#DAE1F0;&lt;br /&gt;
&lt;br /&gt;
|header1 = &amp;lt;font size=3, color=white&amp;gt;计算理论之美&amp;lt;/font&amp;gt;&lt;br /&gt;
|label2  = {{Nowrap|负责人}} &lt;br /&gt;
|data2   = 黄棱潇 ([mailto:huanglingxiao@nju.edu.cn huanglingxiao@nju.edu.cn]) &lt;br /&gt;
|label4 = 时间&lt;br /&gt;
|data4  = 2026.7.24 — 2026.7.27&lt;br /&gt;
|label5 = 地点&lt;br /&gt;
|data5  = {{Nowrap|南京大学苏州校区 TBA}}&lt;br /&gt;
|belowstyle = background:#DAE1F0;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
由南京大学计算机学院和智能软件学院支持的第5届“计算理论之美”暑期讲习班将于2026年7月24日至7月27日在江苏省苏州市南京大学苏州校区开班。本次讲习班将围绕算法设计主题开展系列报告，包括TBA等板块，主要面向对理论计算机科学以及计算机科学中的数学感兴趣的国内外本科生，安排4天的高级课程。内容深入浅出，由国内外一线的优秀学者讲授，使学员初步了解理论计算机科学的一些研究前沿、初步掌握一些新理论与新方法，为有志于从事理论计算机科学研究的学者打下一定的基础，也让从事其他相关方向研究的学生与教师们领略计算理论的魅力。&lt;br /&gt;
&lt;br /&gt;
联系邮箱：nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
联系人：&lt;br /&gt;
* 黄棱潇：	huanglingxiao@nju.edu.cn&lt;br /&gt;
* 刘明谋：	lmm@nju.edu.cn&lt;br /&gt;
* 班吟：		175227530@qq.com&lt;br /&gt;
&lt;br /&gt;
注册报名流程：由于前几届报名人数过多，本届将会采用问卷初筛形式进行报名。请同学们先填写以下[TBA 调查问卷]:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
通过初筛后的同学将提前两周收到包含报名链接的邮件。&lt;br /&gt;
南大同学仅需填写问卷，讲习班期间直接到会场听报告即可。&lt;br /&gt;
&lt;br /&gt;
费用：本科生包住宿，非本科生不包含住宿。餐费自理&lt;br /&gt;
问卷报名截止日期： TBD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tentative Schedule ==&lt;br /&gt;
&lt;br /&gt;
Venue (地点)：南京大学苏州校区TBA&lt;br /&gt;
&lt;br /&gt;
Group photo: 7月TBD日上午茶歇环节中安排参会者合影留念&lt;br /&gt;
&lt;br /&gt;
Speakers (in lexicographic order): 陈霖、刘明谋、Pasin Manurangsi、王启圣、俞华程、张天翼、TBD&lt;br /&gt;
&lt;br /&gt;
== Take-home Exams ==&lt;br /&gt;
成绩优秀的同学可推荐参加南京大学计算机学院预推免保研面试，并在录取后可凭借此次暑期讲习班申请两个研究生学分。&lt;br /&gt;
&lt;br /&gt;
作业提交方式：发送电子版到邮箱nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
== Links to Past Summer Schools ==&lt;br /&gt;
* [[计算理论之美 (Summer 2025)|计算理论之美暑期学校 (Summer 2025)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2024)|计算理论之美暑期学校 (Summer 2024)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2023)|计算理论之美暑期学校 (Summer 2023)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2021)|计算理论之美暑期学校 (Summer 2021)]]&lt;br /&gt;
&lt;br /&gt;
== About Our Summer School ==&lt;br /&gt;
Our summer school is supported by the School of Computer Science and the School of Intelligent Software and Engineering at Nanjing University and will be held from July 24th to July 27th, 2026, at the Suzhou Campus of Nanjing University in Suzhou, Jiangsu Province, China. The theme of this year&#039;s summer school will be the design and analysis of algorithms, with topics ranging from TBA etc. &lt;br /&gt;
Target audience will include aspiring undergraduate and graduate students from China and overseas, and the program will feature 4 days of advanced courses. The courses will be presented by leading young scholars both from within China and overseas, covering both cutting-edge research and modern toolkits in theoretical computer science. &lt;br /&gt;
The summer school will help connect aspiring young students with young scholars to engage research in theoretical computer science, and embark on a journey to appreciate the charm of computational theory.&lt;br /&gt;
&lt;br /&gt;
Accommodation (shared room) will be provided to undergraduates only.&lt;br /&gt;
&lt;br /&gt;
Due to capacity, we prioritize undergraduates seeking to join NJU TCS group for PhD or for a research intern. To register, please fill out the following form: TBA&lt;br /&gt;
&lt;br /&gt;
If you are selected into our summer school, you will receive a confirmation email.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13738</id>
		<title>计算理论之美 (Summer 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13738"/>
		<updated>2026-05-14T02:05:13Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* Tentative Schedule */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox &lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|headerstyle  = background:#4D72BE;&lt;br /&gt;
|labelstyle   = background:#DAE1F0;&lt;br /&gt;
&lt;br /&gt;
|header1 = &amp;lt;font size=3, color=white&amp;gt;计算理论之美&amp;lt;/font&amp;gt;&lt;br /&gt;
|label2  = {{Nowrap|负责人}} &lt;br /&gt;
|data2   = 黄棱潇 ([mailto:huanglingxiao@nju.edu.cn huanglingxiao@nju.edu.cn]) &lt;br /&gt;
|label4 = 时间&lt;br /&gt;
|data4  = 2026.7.24 — 2026.7.27&lt;br /&gt;
|label5 = 地点&lt;br /&gt;
|data5  = {{Nowrap|南京大学苏州校区 TBA}}&lt;br /&gt;
|belowstyle = background:#DAE1F0;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
由南京大学计算机学院和智能软件学院支持的第5届“计算理论之美”暑期讲习班将于2026年7月24日至7月27日在江苏省苏州市南京大学苏州校区开班。本次讲习班将围绕算法设计主题开展系列报告，包括TBA等板块，主要面向对理论计算机科学以及计算机科学中的数学感兴趣的国内外本科生，安排4天的高级课程。内容深入浅出，由国内外一线的优秀学者讲授，使学员初步了解理论计算机科学的一些研究前沿、初步掌握一些新理论与新方法，为有志于从事理论计算机科学研究的学者打下一定的基础，也让从事其他相关方向研究的学生与教师们领略计算理论的魅力。&lt;br /&gt;
&lt;br /&gt;
联系邮箱：nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
联系人：&lt;br /&gt;
* 黄棱潇：	huanglingxiao@nju.edu.cn&lt;br /&gt;
* 刘明谋：	lmm@nju.edu.cn&lt;br /&gt;
* 班吟：		175227530@qq.com&lt;br /&gt;
&lt;br /&gt;
注册报名流程：由于前几届报名人数过多，本届将会采用问卷初筛形式进行报名。请同学们先填写以下[TBA 调查问卷]:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
通过初筛后的同学将提前两周收到包含报名链接的邮件。&lt;br /&gt;
南大同学仅需填写问卷，讲习班期间直接到会场听报告即可。&lt;br /&gt;
&lt;br /&gt;
费用：本科生包住宿，非本科生不包含住宿。餐费自理&lt;br /&gt;
问卷报名截止日期： TBD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tentative Schedule ==&lt;br /&gt;
&lt;br /&gt;
Venue (地点)：南京大学苏州校区TBA&lt;br /&gt;
&lt;br /&gt;
Group photo: 7月TBD日上午茶歇环节中安排参会者合影留念&lt;br /&gt;
&lt;br /&gt;
Speakers (in lexicographic order): 陈霖、刘明谋、Pasin Manurangsi、王启圣、俞华程、张天翼&lt;br /&gt;
&lt;br /&gt;
== Take-home Exams ==&lt;br /&gt;
成绩优秀的同学可推荐参加南京大学计算机学院预推免保研面试，并在录取后可凭借此次暑期讲习班申请两个研究生学分。&lt;br /&gt;
&lt;br /&gt;
作业提交方式：发送电子版到邮箱nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
== Links to Past Summer Schools ==&lt;br /&gt;
* [[计算理论之美 (Summer 2025)|计算理论之美暑期学校 (Summer 2025)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2024)|计算理论之美暑期学校 (Summer 2024)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2023)|计算理论之美暑期学校 (Summer 2023)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2021)|计算理论之美暑期学校 (Summer 2021)]]&lt;br /&gt;
&lt;br /&gt;
== About Our Summer School ==&lt;br /&gt;
Our summer school is supported by the School of Computer Science and the School of Intelligent Software and Engineering at Nanjing University and will be held from July 24th to July 27th, 2026, at the Suzhou Campus of Nanjing University in Suzhou, Jiangsu Province, China. The theme of this year&#039;s summer school will be the design and analysis of algorithms, with topics ranging from TBA etc. &lt;br /&gt;
Target audience will include aspiring undergraduate and graduate students from China and overseas, and the program will feature 4 days of advanced courses. The courses will be presented by leading young scholars both from within China and overseas, covering both cutting-edge research and modern toolkits in theoretical computer science. &lt;br /&gt;
The summer school will help connect aspiring young students with young scholars to engage research in theoretical computer science, and embark on a journey to appreciate the charm of computational theory.&lt;br /&gt;
&lt;br /&gt;
Accommodation (shared room) will be provided to undergraduates only.&lt;br /&gt;
&lt;br /&gt;
Due to capacity, we prioritize undergraduates seeking to join NJU TCS group for PhD or for a research intern. To register, please fill out the following form: TBA&lt;br /&gt;
&lt;br /&gt;
If you are selected into our summer school, you will receive a confirmation email.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13737</id>
		<title>计算理论之美 (Summer 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E8%AE%A1%E7%AE%97%E7%90%86%E8%AE%BA%E4%B9%8B%E7%BE%8E_(Summer_2026)&amp;diff=13737"/>
		<updated>2026-05-14T02:02:26Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: Created page with &amp;quot;{{Infobox  |name         = Infobox |headerstyle  = background:#4D72BE; |labelstyle   = background:#DAE1F0;  |header1 = &amp;lt;font size=3, color=white&amp;gt;计算理论之美&amp;lt;/font&amp;gt; |label2  = {{Nowrap|负责人}}  |data2   = 黄棱潇 ([mailto:huanglingxiao@nju.edu.cn huanglingxiao@nju.edu.cn])  |label4 = 时间 |data4  = 2026.7.24 — 2026.7.27 |label5 = 地点 |data5  = {{Nowrap|南京大学苏州校区 TBA}} |belowstyle = background:#DAE1F0; |below =  }}  由南京大学计算...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox &lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|headerstyle  = background:#4D72BE;&lt;br /&gt;
|labelstyle   = background:#DAE1F0;&lt;br /&gt;
&lt;br /&gt;
|header1 = &amp;lt;font size=3, color=white&amp;gt;计算理论之美&amp;lt;/font&amp;gt;&lt;br /&gt;
|label2  = {{Nowrap|负责人}} &lt;br /&gt;
|data2   = 黄棱潇 ([mailto:huanglingxiao@nju.edu.cn huanglingxiao@nju.edu.cn]) &lt;br /&gt;
|label4 = 时间&lt;br /&gt;
|data4  = 2026.7.24 — 2026.7.27&lt;br /&gt;
|label5 = 地点&lt;br /&gt;
|data5  = {{Nowrap|南京大学苏州校区 TBA}}&lt;br /&gt;
|belowstyle = background:#DAE1F0;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
由南京大学计算机学院和智能软件学院支持的第5届“计算理论之美”暑期讲习班将于2026年7月24日至7月27日在江苏省苏州市南京大学苏州校区开班。本次讲习班将围绕算法设计主题开展系列报告，包括TBA等板块，主要面向对理论计算机科学以及计算机科学中的数学感兴趣的国内外本科生，安排4天的高级课程。内容深入浅出，由国内外一线的优秀学者讲授，使学员初步了解理论计算机科学的一些研究前沿、初步掌握一些新理论与新方法，为有志于从事理论计算机科学研究的学者打下一定的基础，也让从事其他相关方向研究的学生与教师们领略计算理论的魅力。&lt;br /&gt;
&lt;br /&gt;
联系邮箱：nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
联系人：&lt;br /&gt;
* 黄棱潇：	huanglingxiao@nju.edu.cn&lt;br /&gt;
* 刘明谋：	lmm@nju.edu.cn&lt;br /&gt;
* 班吟：		175227530@qq.com&lt;br /&gt;
&lt;br /&gt;
注册报名流程：由于前几届报名人数过多，本届将会采用问卷初筛形式进行报名。请同学们先填写以下[TBA 调查问卷]:&lt;br /&gt;
&lt;br /&gt;
TBA&lt;br /&gt;
&lt;br /&gt;
通过初筛后的同学将提前两周收到包含报名链接的邮件。&lt;br /&gt;
南大同学仅需填写问卷，讲习班期间直接到会场听报告即可。&lt;br /&gt;
&lt;br /&gt;
费用：本科生包住宿，非本科生不包含住宿。餐费自理&lt;br /&gt;
问卷报名截止日期： TBD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Tentative Schedule ==&lt;br /&gt;
&lt;br /&gt;
Venue (地点)：南京大学苏州校区TBA&lt;br /&gt;
&lt;br /&gt;
Group photo: 7月TBD日上午茶歇环节中安排参会者合影留念&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Take-home Exams ==&lt;br /&gt;
成绩优秀的同学可推荐参加南京大学计算机学院预推免保研面试，并在录取后可凭借此次暑期讲习班申请两个研究生学分。&lt;br /&gt;
&lt;br /&gt;
作业提交方式：发送电子版到邮箱nju_tcs@163.com&lt;br /&gt;
&lt;br /&gt;
== Links to Past Summer Schools ==&lt;br /&gt;
* [[计算理论之美 (Summer 2025)|计算理论之美暑期学校 (Summer 2025)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2024)|计算理论之美暑期学校 (Summer 2024)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2023)|计算理论之美暑期学校 (Summer 2023)]]&lt;br /&gt;
* [[计算理论之美 (Summer 2021)|计算理论之美暑期学校 (Summer 2021)]]&lt;br /&gt;
&lt;br /&gt;
== About Our Summer School ==&lt;br /&gt;
Our summer school is supported by the School of Computer Science and the School of Intelligent Software and Engineering at Nanjing University and will be held from July 24th to July 27th, 2026, at the Suzhou Campus of Nanjing University in Suzhou, Jiangsu Province, China. The theme of this year&#039;s summer school will be the design and analysis of algorithms, with topics ranging from TBA etc. &lt;br /&gt;
Target audience will include aspiring undergraduate and graduate students from China and overseas, and the program will feature 4 days of advanced courses. The courses will be presented by leading young scholars both from within China and overseas, covering both cutting-edge research and modern toolkits in theoretical computer science. &lt;br /&gt;
The summer school will help connect aspiring young students with young scholars to engage research in theoretical computer science, and embark on a journey to appreciate the charm of computational theory.&lt;br /&gt;
&lt;br /&gt;
Accommodation (shared room) will be provided to undergraduates only.&lt;br /&gt;
&lt;br /&gt;
Due to capacity, we prioritize undergraduates seeking to join NJU TCS group for PhD or for a research intern. To register, please fill out the following form: TBA&lt;br /&gt;
&lt;br /&gt;
If you are selected into our summer school, you will receive a confirmation email.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13727</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13727"/>
		<updated>2026-05-11T15:23:25Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 课件及相关阅读资料 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039; Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/11)&#039;&#039;&#039; 第一节课（9am-10am）期中考试&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
# [https://box.nju.edu.cn/f/c44c13910eff43ffaf7f/ Dimensionality reduction]&lt;br /&gt;
#* Johnson-Lindenstrauss Transformation:&lt;br /&gt;
#** Intuition: In high-dimensional spaces, a uniformly random vector is almost certainly nearly orthogonal to any fixed vector&lt;br /&gt;
#** Constructions: independent Gaussian entries, projection onto uniform random subspace, i.i.d. -1/+1 entries&lt;br /&gt;
#** Modern applications: TurboQuant versus RaBitQ versus Quantized  JL&lt;br /&gt;
#** Fast Johnson-Lindenstrauss Transformation&lt;br /&gt;
#* Approximate Nearest Neighbor Search: by dimensionality reduction, by Locality Sensitive Hashing (LSH)&lt;br /&gt;
#* Oblivious Subspace Embedding (OSE): net argument&lt;br /&gt;
#** Application: linear regression by sketch-and-solve via OSE, linear regression by fast iteration with OSE&lt;br /&gt;
#** Sparse Oblivious Subspace Embedding: count sketch&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13726</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13726"/>
		<updated>2026-05-11T15:07:31Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 课件及相关阅读资料 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039; Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/11)&#039;&#039;&#039; 第一节课（9am-10am）期中考试&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
# [https://box.nju.edu.cn/f/c44c13910eff43ffaf7f/ Dimensionality reduction]&lt;br /&gt;
#* Johnson-Lindenstrauss Transformation:&lt;br /&gt;
#** Intuition: In high-dimensional spaces, a uniformly random vector is almost certainly nearly orthogonal to any fixed vector&lt;br /&gt;
#** Constructions: independent Gaussian entries, projection onto uniform random subspace, i.i.d. -1/+1 entries&lt;br /&gt;
#** Modern applications: TurboQuant versus RaBitQ versus JL&lt;br /&gt;
#** Fast Johnson-Lindenstrauss Transformation&lt;br /&gt;
#* Approximate Nearest Neighbor Search: by dimensionality reduction, by Locality Sensitive Hashing (LSH)&lt;br /&gt;
#* Oblivious Subspace Embedding (OSE): net argument&lt;br /&gt;
#** Application: linear regression by sketch-and-solve via OSE, linear regression by fast iteration with OSE&lt;br /&gt;
#** Sparse Oblivious Subspace Embedding: count sketch&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13724</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13724"/>
		<updated>2026-05-10T16:28:58Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 课件及相关阅读资料 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039; Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/11)&#039;&#039;&#039; 第一节课（9am-10am）期中考试&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
# [https://box.nju.edu.cn/f/c44c13910eff43ffaf7f/ Dimensionality reduction]&lt;br /&gt;
#* Johnson-Lindenstrauss Transformation: independent Gaussian entries, projection onto uniform random subspace, i.i.d. -1/+1 entries&lt;br /&gt;
#** Fast Johnson-Lindenstrauss Transformation&lt;br /&gt;
#* Approximate Nearest Neighbor Search: by dimensionality reduction, by Locality Sensitive Hashing (LSH)&lt;br /&gt;
#* Oblivious Subspace Embedding (OSE): net argument&lt;br /&gt;
#** Application: linear regression by sketch-and-solve via OSE, linear regression by fast iteration with OSE&lt;br /&gt;
#** Sparse Oblivious Subspace Embedding: count sketch&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13721</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13721"/>
		<updated>2026-05-06T15:24:41Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 通知 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039; Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/11)&#039;&#039;&#039; 第一节课（9am-10am）期中考试&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13713</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13713"/>
		<updated>2026-05-03T08:52:05Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 通知 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039; Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
	<entry>
		<id>https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13712</id>
		<title>高级算法 (Spring 2026)</title>
		<link rel="alternate" type="text/html" href="https://tcs.nju.edu.cn/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%AE%97%E6%B3%95_(Spring_2026)&amp;diff=13712"/>
		<updated>2026-05-02T20:30:29Z</updated>

		<summary type="html">&lt;p&gt;Liumingmou: /* 通知 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox&lt;br /&gt;
|name         = Infobox&lt;br /&gt;
|bodystyle    = &lt;br /&gt;
|title        = &amp;lt;font size=3&amp;gt;高级算法 &lt;br /&gt;
&amp;lt;br&amp;gt;Advanced Algorithms&amp;lt;/font&amp;gt;&lt;br /&gt;
|titlestyle   = &lt;br /&gt;
&lt;br /&gt;
|image        = &lt;br /&gt;
|imagestyle   = &lt;br /&gt;
|caption      = &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 =任课教师&lt;br /&gt;
|label1  = &lt;br /&gt;
|data1   = &lt;br /&gt;
|header2 = &lt;br /&gt;
|label2  = &lt;br /&gt;
|data2   = &#039;&#039;&#039;刘明谋&#039;&#039;&#039;&lt;br /&gt;
|header3 = &lt;br /&gt;
|label3  = 电子邮件&lt;br /&gt;
|data3   = lmm@nju.edu.cn &lt;br /&gt;
|header4 =&lt;br /&gt;
|label4= 办公室&lt;br /&gt;
|data4= 南雍-西229&lt;br /&gt;
|header5 = &lt;br /&gt;
|label5  = &lt;br /&gt;
|header11 = 课程时间地点&lt;br /&gt;
|label11  = &lt;br /&gt;
|data11   = &lt;br /&gt;
|header12 =&lt;br /&gt;
|label12  = 教室&lt;br /&gt;
|data12   = 周一，9am-12pm&amp;lt;br&amp;gt;苏教B207&lt;br /&gt;
|header13 =&lt;br /&gt;
|label13  = Place&lt;br /&gt;
|data13   = &lt;br /&gt;
|header14 =&lt;br /&gt;
|label14  = 答疑时间&lt;br /&gt;
|data14   = 周五，2pm-5pm&amp;lt;br&amp;gt;南雍-西229&lt;br /&gt;
|header15 = 教材&lt;br /&gt;
|label15  = &lt;br /&gt;
|data15   = &lt;br /&gt;
|header16 =&lt;br /&gt;
|label16  = &lt;br /&gt;
|data16   = [[File:MR-randomized-algorithms.png|border|100px]]&lt;br /&gt;
|header17 =&lt;br /&gt;
|label17  = &lt;br /&gt;
|data17   = Motwani and Raghavan. &amp;lt;br&amp;gt;&#039;&#039;Randomized Algorithms&#039;&#039;.&amp;lt;br&amp;gt; Cambridge Univ Press, 1995.&lt;br /&gt;
|header18 =&lt;br /&gt;
|label18  = &lt;br /&gt;
|data18   = [[File:Approximation_Algorithms.jpg|border|100px]]&lt;br /&gt;
|header19 =&lt;br /&gt;
|label19  = &lt;br /&gt;
|data19   =  Vazirani. &amp;lt;br&amp;gt;&#039;&#039;Approximation Algorithms&#039;&#039;. &amp;lt;br&amp;gt; Springer-Verlag, 2001.&lt;br /&gt;
|belowstyle = background:#ddf;&lt;br /&gt;
|below = &lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This is the webpage for the &#039;&#039;Advanced Algorithms&#039;&#039; class of spring 2026. Students who take this class should check this page periodically for content updates and new announcements. &lt;br /&gt;
&lt;br /&gt;
= 通知 =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/2)&#039;&#039;&#039; 第一堂课&lt;br /&gt;
* &#039;&#039;&#039;(2026/3/23)&#039;&#039;&#039; 请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
* &#039;&#039;&#039;(2026/4/6)&#039;&#039;&#039; 是清明节假期，停课一次。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/3)&#039;&#039;&#039;： Feistel cipher / Feistel permutation 的正确定义是 &amp;lt;math&amp;gt;(x_1,x_2) \mapsto (f(x_2)\oplus x_1,x_2)&amp;lt;/math&amp;gt;。第二次作业原本的题面写错了。&lt;br /&gt;
* &#039;&#039;&#039;(2026/5/4)&#039;&#039;&#039; 是五一假期，停课一次。&lt;br /&gt;
&lt;br /&gt;
= 课程信息 =&lt;br /&gt;
* &#039;&#039;&#039;任课教师&#039;&#039;&#039;: &lt;br /&gt;
:* [https://liumingmou.github.io 刘明谋]：[mailto:lmm@nju.edu.cn 📧]，南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;助教&#039;&#039;&#039;: &lt;br /&gt;
** 王思齐：[mailto:siqi_wang@smail.nju.edu.cn 📧]&lt;br /&gt;
** 齐世毅：[mailto:1083951258@qq.com 📧]&lt;br /&gt;
* &#039;&#039;&#039;课程时间地点&#039;&#039;&#039;: &lt;br /&gt;
** 周一，9am-12pm，苏教B207&lt;br /&gt;
* &#039;&#039;&#039;答疑时间&#039;&#039;&#039;: 周五, 2pm-5pm, 南雍-西229&lt;br /&gt;
* &#039;&#039;&#039;QQ群&#039;&#039;&#039;: 1083465754&lt;br /&gt;
&lt;br /&gt;
= 教学大纲 =&lt;br /&gt;
随着计算机算法理论的不断发展，现代计算机算法的设计与分析大量地使用非初等的数学工具以及非传统的算法思想。“高级算法”这门课程就是面向计算机算法的这一发展趋势而设立的。课程将针对传统算法课程未系统涉及、却在计算机科学各领域的科研和实践中扮演重要角色的高等算法设计思想和算法分析工具进行系统讲授。&lt;br /&gt;
&lt;br /&gt;
课程内容分为五大部分：&lt;br /&gt;
* 基于哈希的大数据算法&lt;br /&gt;
* 哈希表与面向大数据的现代计算场景&lt;br /&gt;
* 测度的集中与处理高维数据&lt;br /&gt;
* 最大流与线性规划&lt;br /&gt;
* 其他重要话题&lt;br /&gt;
&lt;br /&gt;
=== 先修课程 ===&lt;br /&gt;
* 必须：离散数学，概率论，线性代数。&lt;br /&gt;
* 推荐：算法设计与分析。&lt;br /&gt;
&lt;br /&gt;
=== 课程教材 ===&lt;br /&gt;
本门课较为前沿，大部分课程内容还没有进入任何教材。以下教材和参考书仅作为参考。&lt;br /&gt;
* [[高级算法 (Fall 2024) / Course materials|&amp;lt;font size=3&amp;gt;教材和参考书&amp;lt;/font&amp;gt;]]&lt;br /&gt;
更多的内容也可以参考[[#Related_Online_Courses |其他学者的同类课程]]。&lt;br /&gt;
&lt;br /&gt;
=== 成绩 ===&lt;br /&gt;
* 课程成绩：本课程将会有若干次作业和一次期末考核。最终成绩将由平时作业成绩和期末考核成绩综合得出。&lt;br /&gt;
* 迟交：如果有特殊的理由，无法按时完成作业，请提前联系授课老师，给出正当理由。否则迟交的作业将不被接受。&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;font color=red&amp;gt; 学术诚信 Academic Integrity &amp;lt;/font&amp;gt;===&lt;br /&gt;
学术诚信是所有从事学术活动的学生和学者最基本的职业道德底线，本课程将不遗余力的维护学术诚信规范，违反这一底线的行为将不会被容忍。&lt;br /&gt;
&lt;br /&gt;
作业完成的原则：&#039;&#039;&#039;署你名字的工作必须是你个人的贡献，任何不是由你完成的部分都必须明确标注&#039;&#039;&#039;，特别是由AI生成的部分，否则就涉嫌抄袭。在完成作业的过程中，允许讨论，前提是讨论的所有参与者均处于同等完成度。但关键想法的执行、以及作业文本的写作必须独立完成，并在作业中致谢（acknowledge）所有参与讨论的人。符合规则的讨论与致谢将不会影响得分。不允许其他任何形式的合作——尤其是与已经完成作业的同学“讨论”。&lt;br /&gt;
&lt;br /&gt;
本课程将对剽窃行为采取零容忍的态度。在完成作业过程中，对他人工作（出版物、互联网资料、其他人的作业等）直接的文本抄袭和对关键思想、关键元素的抄袭，按照 [http://www.acm.org/publications/policies/plagiarism_policy ACM Policy on Plagiarism]的解释，都将视为剽窃。剽窃者成绩将被取消。如果发现互相抄袭行为，&amp;lt;font color=red&amp;gt; 抄袭和被抄袭双方的成绩都将被取消&amp;lt;/font&amp;gt;。因此请主动防止自己的作业被他人抄袭。&lt;br /&gt;
&lt;br /&gt;
学术诚信影响学生个人的品行，也关乎整个教育系统的正常运转。为了一点分数而做出学术不端的行为，不仅使自己沦为一个欺骗者，也使他人的诚实努力失去意义。让我们一起努力维护一个诚信的环境。&lt;br /&gt;
&lt;br /&gt;
= 课后作业 =&lt;br /&gt;
Late policy: In general, we will accomodate late submission requests ONLY IF you made such requests ahead of time.&lt;br /&gt;
&lt;br /&gt;
请大家&amp;lt;font color=red &amp;gt;&#039;&#039;&#039;严格遵守[https://jw.nju.edu.cn/_upload/article/files/ab/85/1f49e9e9434dbf23018539b4c338/a550b349-9828-4a05-a5ec-d088b442bee1.pdf 《关于本科生规范使用生成式人工智能工具的指导意见（试行）》]&#039;&#039;&#039;&amp;lt;/font&amp;gt;！&lt;br /&gt;
&lt;br /&gt;
（如果你提交过作业之后想重新提交，可以通过更改“版本”字段换一个文件名提交）&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业1|作业1]] 请在 2026/04/06 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/628bff0686e14f8cbf3f/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;).&lt;br /&gt;
*[[高级算法_(Spring_2026)/作业2|作业2]] 请在 2026/05/11 上课前（9am UTC+8）上传到 [https://box.nju.edu.cn/u/d/475a895457d14d31ab24/ 南大云盘] (文件名为&#039;&amp;lt;font color=red &amp;gt;学号_姓名_版本.pdf&amp;lt;/font&amp;gt;&#039;)。&lt;br /&gt;
&lt;br /&gt;
= 课件及相关阅读资料 =&lt;br /&gt;
# [https://box.nju.edu.cn/f/980d814e4ad64285a640/ Fingerprinting]&lt;br /&gt;
#* Polynomial Identity Testing&lt;br /&gt;
#* Communication Complexity (Equality)&lt;br /&gt;
#* Application: Bipartite Perfect Matching, Checking Matrix Multiplication&lt;br /&gt;
#* Karp-Rabin Algorithm (string-searching), Lipton’s Algorithm (checking identity of multisets)&lt;br /&gt;
# [https://box.nju.edu.cn/f/fcf9e2b3051e443fb324/ Sketching]&lt;br /&gt;
#* Morris&#039; Algorithm&lt;br /&gt;
#** mean trick, median trick&lt;br /&gt;
#* Counting Distinct Elements: min sketch, Flajolet-Martin algorithm, bottom-&amp;lt;math&amp;gt;k&amp;lt;/math&amp;gt; algorithm, HyperLogLog&lt;br /&gt;
#* Heavy Hitter &amp;amp; Point Query: count-min sketch&lt;br /&gt;
#* 2nd Frequency Moments Estimator: count sketch&lt;br /&gt;
#** &amp;lt;math&amp;gt;\ell_2&amp;lt;/math&amp;gt; point query with count sketch&lt;br /&gt;
#* Approximate Membership: Bloom filter&lt;br /&gt;
# [https://box.nju.edu.cn/f/40f8ae1bc97c409aa485/ Hashing]&lt;br /&gt;
#* Load Balancing: maximum load, power of two choices&lt;br /&gt;
#* Perfect Hashing: birthday paradox, FKS perfect hashing&lt;br /&gt;
#* Modern Hash Table: Cuckoo hashing, succinct dictionaries&lt;br /&gt;
#* Hashing in Practice: Chernoff Bound with limited independence, tabulation hashing&lt;br /&gt;
&lt;br /&gt;
= Related Online Courses=&lt;br /&gt;
* [https://www.cs.columbia.edu/~andoni/advancedS24/index.html Advanced Algorithms] by Alexandr Andoni at Columbia University.&lt;br /&gt;
* [https://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15854-f21/www/ Advanced Approximation Algorithms] by Anupam Gupta at CMU.&lt;br /&gt;
* [http://people.csail.mit.edu/moitra/854.html Advanced Algorithms] by Ankur Moitra at MIT.&lt;br /&gt;
* [https://6.5210.csail.mit.edu/ Advanced Algorithms] by David Karger at MIT.&lt;br /&gt;
* [https://www.cs.cmu.edu/~dwoodruf/teaching/15851-spring24/ Algorithms for Big Data] by David Woodruff at CMU.&lt;br /&gt;
* [https://www.sketchingbigdata.org/fall20/lec/ Sketching Algorithms] by Jelani Nelson at UC Berkeley.&lt;br /&gt;
* [http://web.stanford.edu/class/cs168/index.html The Modern Algorithmic Toolbox] by Tim Roughgarden and Gregory Valiant at Stanford.&lt;br /&gt;
* [https://www.cs.princeton.edu/courses/archive/fall18/cos521/ Advanced Algorithm Design] by Pravesh Kothari and Christopher Musco at Princeton.&lt;br /&gt;
* [http://www.cs.cmu.edu/afs/cs.cmu.edu/academic/class/15859-f11/www/ Linear and Semidefinite Programming (Advanced Algorithms)] by Anupam Gupta and Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://www.cs.cmu.edu/~odonnell/papers/cs-theory-toolkit-lecture-notes.pdf CS Theory Toolkit] by Ryan O&#039;Donnell at CMU.&lt;br /&gt;
* [https://cs.uwaterloo.ca/~lapchi/cs860/index.html Eigenvalues and Polynomials] by Lap Chi Lau at University of Waterloo.&lt;/div&gt;</summary>
		<author><name>Liumingmou</name></author>
	</entry>
</feed>