跳到正文

算法·理论

【彩虹日报 #1】 卷积入门

mofan101028约 4 分钟
原文
文章信息与版本

文章信息

发布
2025年12月12日
收录
2025年12月12日
更新
2025年12月12日
篇幅
约 4 分钟

版本

  1. v1当前

连续卷积

对于函数 f,g:R→Cf, g: \mathbb{R} \to \mathbb{C},其卷积定义为:

(f∗g)(t)=∫−∞∞f(τ)g(t−τ)dτ(f * g)(t) = \displaystyle \int_{-\infty}^{\infty} f(\tau) g(t - \tau) d\tau

离散卷积

对于序列 f,g:Z→Cf, g: \mathbb{Z} \to \mathbb{C},其卷积定义为:

(f∗g)[n]=∑m=−∞∞f[m]g[n−m](f * g)[n] = \large \sum_{m = -\infty}^{\infty} \normalsize f[m] g[n - m]

多维卷积

对于 Rn\mathbb{R}^n 上的函数:

(f∗g)(x)=∫Rnf(y)g(x−y)dy(f * g)(\mathbf{x}) = \displaystyle \int_{\mathbb{R}^n} f(\mathbf{y}) g(\mathbf{x} - \mathbf{y}) d\mathbf{y}

其中 x,y∈Rn\mathbf{x}, \mathbf{y} \in \mathbb{R}^n。

并卷积

对于函数 f,g:2[n]→Cf, g: 2^{[n]} \to \mathbb{C},其并卷积定义为:

(f∗∪g)(S)=∑T,U⊆[n]T∪U=Sf(T)g(U)(f *_{\cup} g)(S) = \large \sum_{\substack{T, U \subseteq [n] \\ T \cup U = S}} \normalsize f(T) g(U)

莫比乌斯变换表示: 定义 zetazeta 变换:ζ∪(f)(S)=∑T⊆Sf(T)\zeta_{\cup}(f)(S) = \sum_{T \subseteq S} f(T) 则并卷积可表示为:

f∗∪g=μ∪(ζ∪(f)⋅ζ∪(g))f *_{\cup} g = \mu_{\cup}(\zeta_{\cup}(f) \cdot \zeta_{\cup}(g))

其中 μ∪\mu_{\cup} 是莫比乌斯反演。

交卷积

对于函数 f,g:2[n]→Cf, g: 2^{[n]} \to \mathbb{C},其交卷积定义为:

(f∗∩g)(S)=∑T,U⊆[n]T∩U=Sf(T)g(U)(f *_{\cap} g)(S) = \large \sum_{\substack{T, U \subseteq [n] \\ T \cap U = S}} \normalsize f(T) g(U)

对偶关系: 交卷积与并卷积通过补集运算相关联:

(f∗∩g)(S)=(f~∗∪g~)(S‾)(f *_{\cap} g)(S) = (\tilde{f} *_{\cup} \tilde{g})(\overline{S})

其中 f~(T)=f(T‾)\tilde{f}(T) = f(\overline{T}),S‾=[n]∖S\overline{S} = [n] \setminus S。

对称差卷积

对于函数 f,g:2[n]→Cf, g: 2^{[n]} \to \mathbb{C},其对称差卷积定义为:

(f∗△g)(S)=∑T,U⊆[n]T△U=Sf(T)g(U)(f *_{\triangle} g)(S) = \large \sum_{\substack{T, U \subseteq [n] \\ T \triangle U = S}} \normalsize f(T) g(U)

其中 T△U=(T∖U)∪(U∖T)T \triangle U = (T \setminus U) \cup (U \setminus T)。

子集卷积

对于定义在有限集合幂集上的两个函数 f,g:2[n]→Cf, g: 2^{[n]} \to \mathbb{C},其中 [n]={1,2,…,n}[n] = \{1, 2, \dots, n\} ,其子集卷积定义为:

(f∗g)(S)=∑T⊆ST∩(S∖T)=∅f(T)g(S∖T)(f * g)(S) = \large \sum_{\substack{T \subseteq S \\ T \cap (S \setminus T) = \emptyset}} \normalsize f(T) g(S \setminus T)

由于 T⊆ST \subseteq S 时自动满足 T∩(S∖T)=∅T \cap (S \setminus T) = \emptyset,上式可简化为:

(f∗g)(S)=∑T⊆Sf(T)g(S∖T)(f * g)(S) = \large \sum_{T \subseteq S} \normalsize f(T) g(S \setminus T)

其中 S⊆[n]S \subseteq [n]。

原文