math-skill 1.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.en-US.md +313 -0
- package/README.md +313 -278
- package/agents/math-critic.en.md +235 -0
- package/agents/math-critic.md +237 -203
- package/commands/abstraction.md +11 -34
- package/commands/algorithmic-thinking.md +11 -34
- package/commands/ask.md +18 -21
- package/commands/axiomatization.md +11 -34
- package/commands/causal-inference.md +11 -34
- package/commands/discrete-combinatorial.md +11 -34
- package/commands/game-theory.md +11 -34
- package/commands/induction-analogy.md +11 -34
- package/commands/information-theory.md +11 -34
- package/commands/logic-deduction.md +11 -34
- package/commands/modeling.md +11 -37
- package/commands/optimization.md +11 -33
- package/commands/probability-statistics.md +11 -36
- package/commands/symmetry-invariance.md +11 -34
- package/commands/topological-thinking.md +11 -33
- package/commands/transformation.md +11 -33
- package/knowledge-base/overview.en.md +228 -0
- package/knowledge-base/overview.md +230 -230
- package/package.json +73 -59
- package/references/agentic-workflow.en.md +53 -0
- package/references/agentic-workflow.md +55 -0
- package/references/books/abstract-algebra.md +124 -0
- package/references/books/algebraic-geometry-rising-sea.md +171 -0
- package/references/books/differential-geometry.md +140 -0
- package/references/books/matrix-analysis.md +146 -0
- package/references/books/micro-lie-theory.md +116 -0
- package/references/books/optimization-ml.md +164 -0
- package/references/books/smooth-manifolds.md +105 -0
- package/references/gpu-friendly-math.en.md +65 -0
- package/references/gpu-friendly-math.md +67 -0
- package/references/inspiration.en.md +113 -0
- package/{docs → references}/inspiration.md +2 -0
- package/skills/abstraction/SKILL.en.md +117 -0
- package/skills/abstraction/SKILL.md +121 -264
- package/skills/abstraction/original-texts.en.md +163 -0
- package/skills/algorithmic-thinking/SKILL.en.md +132 -0
- package/skills/algorithmic-thinking/SKILL.md +138 -371
- package/skills/algorithmic-thinking/original-texts.en.md +253 -0
- package/skills/axiomatization/SKILL.en.md +144 -0
- package/skills/axiomatization/SKILL.md +151 -213
- package/skills/axiomatization/original-texts.en.md +154 -0
- package/skills/causal-inference/SKILL.en.md +147 -0
- package/skills/causal-inference/SKILL.md +151 -374
- package/skills/causal-inference/original-texts.en.md +136 -0
- package/skills/discrete-combinatorial/SKILL.en.md +124 -0
- package/skills/discrete-combinatorial/SKILL.md +131 -286
- package/skills/discrete-combinatorial/original-texts.en.md +184 -0
- package/skills/game-theory/SKILL.en.md +117 -0
- package/skills/game-theory/SKILL.md +123 -318
- package/skills/game-theory/original-texts.en.md +131 -0
- package/skills/induction-analogy/SKILL.en.md +145 -0
- package/skills/induction-analogy/SKILL.md +152 -310
- package/skills/induction-analogy/original-texts.en.md +140 -0
- package/skills/information-theory/SKILL.en.md +134 -0
- package/skills/information-theory/SKILL.md +140 -242
- package/skills/information-theory/original-texts.en.md +127 -0
- package/skills/logic-deduction/SKILL.en.md +130 -0
- package/skills/logic-deduction/SKILL.md +135 -280
- package/skills/logic-deduction/original-texts.en.md +160 -0
- package/skills/math-research-activator/SKILL.en.md +132 -0
- package/skills/math-research-activator/SKILL.md +136 -0
- package/skills/math-research-activator/original-texts.en.md +105 -0
- package/skills/{meta-selector → math-research-activator}/original-texts.md +104 -104
- package/skills/modeling/SKILL.en.md +135 -0
- package/skills/modeling/SKILL.md +139 -318
- package/skills/modeling/original-texts.en.md +162 -0
- package/skills/optimization/SKILL.en.md +129 -0
- package/skills/optimization/SKILL.md +135 -292
- package/skills/optimization/original-texts.en.md +167 -0
- package/skills/probability-statistics/SKILL.en.md +146 -0
- package/skills/probability-statistics/SKILL.md +151 -312
- package/skills/probability-statistics/original-texts.en.md +191 -0
- package/skills/symmetry-invariance/SKILL.en.md +135 -0
- package/skills/symmetry-invariance/SKILL.md +139 -358
- package/skills/symmetry-invariance/original-texts.en.md +206 -0
- package/skills/topological-thinking/SKILL.en.md +124 -0
- package/skills/topological-thinking/SKILL.md +128 -273
- package/skills/topological-thinking/original-texts.en.md +134 -0
- package/skills/transformation/SKILL.en.md +120 -0
- package/skills/transformation/SKILL.md +124 -264
- package/skills/transformation/original-texts.en.md +204 -0
- package/docs/CLAUDE.md +0 -187
- package/skills/meta-selector/SKILL.md +0 -188
|
@@ -1,242 +1,140 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: information-theory
|
|
3
|
-
description: |
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
# 📡 信息论思想
|
|
11
|
-
|
|
12
|
-
> "信息是不确定性的减少——知道更多意味着怀疑更少。"
|
|
13
|
-
> "Information is reduction of uncertainty — knowing more means doubting less."
|
|
14
|
-
>
|
|
15
|
-
> —— 信息论、编码理论、统计推断
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
>
|
|
29
|
-
>
|
|
30
|
-
>
|
|
31
|
-
>
|
|
32
|
-
>
|
|
33
|
-
>
|
|
34
|
-
>
|
|
35
|
-
>
|
|
36
|
-
>
|
|
37
|
-
>
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
|
|
46
|
-
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
- 需要最优数据压缩(信源编码定理保证最优压缩极限为 H(X) bits/symbol
|
|
64
|
-
|
|
65
|
-
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
-
|
|
91
|
-
-
|
|
92
|
-
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
|
|
142
|
-
**生活模式 / Life Mode:**
|
|
143
|
-
- 信息传递的瓶颈在哪?——不是所有信息都能有效传达,识别沟通的限制条件
|
|
144
|
-
Where is the bottleneck in information transmission? — not all information can be effectively conveyed; identify communication constraints
|
|
145
|
-
|
|
146
|
-
**共通要点 / Common Point:**
|
|
147
|
-
- 核心都是识别信息传递的限制——科研用信道容量 C 量化数学极限,生活用沟通瓶颈识别实际限制
|
|
148
|
-
The core is identifying limits of information transmission — research uses channel capacity C to quantify mathematical limits, life uses communication bottlenecks to identify practical limits
|
|
149
|
-
|
|
150
|
-
### 第五步:应用信息准则 / Step 5: Apply Information Criteria
|
|
151
|
-
|
|
152
|
-
**科研模式 / Research Mode:**
|
|
153
|
-
- **AIC(赤池信息准则)**:AIC = −2lnL + 2k——偏重拟合,适合预测目标
|
|
154
|
-
- **BIC(贝叶斯信息准则)**:BIC = −2lnL + k·ln(n)——偏重简约,适合解释目标
|
|
155
|
-
- **KL 散度 D(P||Q) = Σ p(x) log(p(x)/q(x))**——衡量用 Q 替代 P 的信息损失,注意不对称性 D(P||Q) ≠ D(Q||P)
|
|
156
|
-
- **MDL 原则(最小描述长度)**:选择使"数据描述长度 + 模型描述长度"最小的模型——信息论版本的奥卡姆剃刀
|
|
157
|
-
|
|
158
|
-
**生活模式 / Life Mode:**
|
|
159
|
-
- 如何判断哪个解释更好?——最简洁且最解释力的解释优于复杂但增量解释力很小的解释(奥卡姆剃刀的信息论版本)
|
|
160
|
-
How to judge which explanation is better? — the simplest yet most explanatory explanation beats complex ones with marginal explanatory gain (the information-theoretic version of Occam's razor)
|
|
161
|
-
|
|
162
|
-
**共通要点 / Common Point:**
|
|
163
|
-
- 核心都是简洁性与解释力的权衡——科研用 AIC/BIC/KL/MDL 精确量化,生活用"简洁且有解释力"直觉判断
|
|
164
|
-
The core is balancing simplicity and explanatory power — research uses AIC/BIC/KL/MDL for precise quantification, life uses "simple yet explanatory" intuitive judgment
|
|
165
|
-
|
|
166
|
-
### 第六步:做出信息最优决策 / Step 6: Make Information-Optimal Decision
|
|
167
|
-
|
|
168
|
-
**科研模式 / Research Mode:**
|
|
169
|
-
- **贝叶斯实验设计**:选择使期望信息增益 max E[I(θ;Y)] 最大的实验——优先获取最能减少不确定性的数据
|
|
170
|
-
- **最小化 KL 散度**:决策输出分布 Q 应尽量接近目标分布 P,即 min D(P||Q)
|
|
171
|
-
- **最大熵原则**:在已知约束下选择使 H(X) 最大的分布——最少假设,最保守推断
|
|
172
|
-
- **信息瓶颈**:min I(X;T) − βI(T;Y)——在压缩 X 为 T 时保留关于 Y 的最大相关信息
|
|
173
|
-
|
|
174
|
-
**生活模式 / Life Mode:**
|
|
175
|
-
- 在当前信息水平下做最优决策——信息不足时先收集关键信息,信息足够时果断行动
|
|
176
|
-
Make the optimal decision at the current information level — collect key info when insufficient, act decisively when sufficient
|
|
177
|
-
|
|
178
|
-
**共通要点 / Common Point:**
|
|
179
|
-
- 核心都是信息与行动的平衡——科研用信息增益最大化设计实验,生活用"信息不足先收集、信息足够果断行动"策略
|
|
180
|
-
The core is balancing information and action — research uses information gain maximization to design experiments, life uses "collect when insufficient, act when sufficient" strategy
|
|
181
|
-
|
|
182
|
-
## 常见错误 / Common Errors
|
|
183
|
-
|
|
184
|
-
| 错误 / Error | 数学批评 / Mathematical Critique | 正确做法 / Correct Approach | 标签 / Tag |
|
|
185
|
-
|---|---|---|---|
|
|
186
|
-
| 把信息等同于比特而非概率减少 | 熵 H(X) 是概率分布的函数,不是比特的物理量;信息增益 I(X;Y) 是不确定性的减少量 | 理解信息为不确定性的减少:I(X;Y) = H(X) − H(X|Y),比特只是量化单位 | `[科研]` |
|
|
187
|
-
| 忽视信道容量极限 | R > C 时无论何种编码都不能实现可靠通信;信道容量是数学极限而非工程限制 | 计算信道容量 C = max I(X;Y),确保 R < C | `[科研]` |
|
|
188
|
-
| 混淆熵与方差 | 熵 H(X) 度量分布的"扩散度"(概率意义上),方差 Var(X) 度量分布的"展开度"(距离意义上);两者不等价 | 熵量化概率结构的不确定性,方差量化数值偏差;连续分布熵可为负 | `[科研]` |
|
|
189
|
-
| 过度压缩低于熵限 | 信源编码定理保证最优压缩 ≥ H(X) bits/symbol;低于此限必然丢失信息 | 最优压缩极限为 H(X),接受此极限并据此设计编码 | `[科研]` |
|
|
190
|
-
| 忽视 KL 散度不对称性 | D(P||Q) ≠ D(Q||P);D(P||Q) 衡量"用 Q 近似 P 的信息损失",D(Q||P) 衡量"用 P 近似 Q 的信息损失" | 明确 KL 散度的方向性:D(P||Q) 用于编码(用 Q 编码 P 的额外代价) | `[科研]` |
|
|
191
|
-
| 把相关性等同于信息 | 相关 ρ(X,Y) 仅衡量线性关联;互信息 I(X;Y) 衡量所有依赖关系(含非线性);I(X;Y)=0 ⇔ X,Y 独立,但 ρ=0 ≠ X,Y 独立 | 用互信息 I(X;Y) 代替相关系数 ρ 评估变量间依赖关系 | `[科研]` |
|
|
192
|
-
| 把定性判断强行量化 | 信息论量化的是概率意义上的不确定性,非语义歧义或主观感受 | 区分概率不确定性与语义歧义,不要对定性问题强行套用熵公式 | `[通用]` |
|
|
193
|
-
| 被噪音信息淹没而忽略关键信息 | 信息过载时,大量低价值信息掩盖了少量高价值信息 | 先评估每条信息的不确定性减少能力,优先关注高信息增益的信息 | `[生活]` |
|
|
194
|
-
| 追求更多信息而不评估其价值 | 数量 ≠ 质量;未经筛选的信息可能是噪音而非信息 | 每获取一条信息前先问"这条信息能减少多少不确定性?" | `[生活]` |
|
|
195
|
-
| 信息过载导致决策瘫痪 | 信息量超过处理能力时,决策质量反而下降 | 设定信息收集的止损点——信息足够时果断行动,不再追求完美信息 | `[生活]` |
|
|
196
|
-
|
|
197
|
-
## 操作规程 / Operating Procedure
|
|
198
|
-
|
|
199
|
-
当本 skill 被触发时,首先判断模式:
|
|
200
|
-
|
|
201
|
-
- **科研模式**:问题涉及熵计算、信道容量、编码理论、模型选择等数学形式化
|
|
202
|
-
- **生活模式**:问题涉及评估信息价值、减少冗余、判断该获取哪些信息等日常决策
|
|
203
|
-
|
|
204
|
-
---
|
|
205
|
-
|
|
206
|
-
### 科研模式输出格式 / Research Mode Output Format
|
|
207
|
-
|
|
208
|
-
1. **[信息源]:[描述]** H(X) = [值]——定义随机变量 X,计算其熵,量化当前不确定性
|
|
209
|
-
2. **[信息增益]:[描述]** I(X;Y) = [值]——计算互信息,识别最有价值的观察 Y
|
|
210
|
-
3. **[编码策略]:[选择]**——信源编码(压缩)或信道编码(纠错),说明逼近哪种极限
|
|
211
|
-
4. **[信道容量]:[描述]** C = [值]——计算信道容量,比较传输速率 R 与 C
|
|
212
|
-
5. **[信息准则]:[AIC/BIC/KL/MDL]**——说明选择的信息准则及理由
|
|
213
|
-
6. **[最优决策]:[说明]**——基于信息增益最大化或 KL 散度最小化的决策建议
|
|
214
|
-
|
|
215
|
-
**科研模式输出必须包含以上 6 项,不得只输出分析性文字而不给出结论。**
|
|
216
|
-
|
|
217
|
-
---
|
|
218
|
-
|
|
219
|
-
### 生活模式输出格式 / Life Mode Output Format
|
|
220
|
-
|
|
221
|
-
1. **[核心不确定性]:[描述]** — 你最想搞清楚什么
|
|
222
|
-
**[Core Uncertainty]:[description]** — What you most want to figure out
|
|
223
|
-
2. **[信息价值排序]:[列表]** — 哪些信息最能减少不确定性,价值高低排序
|
|
224
|
-
**[Information Value Ranking]:[list]** — Which information best reduces uncertainty, ranked by value
|
|
225
|
-
3. **[信息瓶颈]:[识别]** — 信息传递或获取的限制在哪
|
|
226
|
-
**[Information Bottleneck]:[identification]** — Where are the limits on information transmission or acquisition
|
|
227
|
-
4. **[精炼传递]:[建议]** — 如何用最精炼的方式聚焦关键信息
|
|
228
|
-
**[Concise Transmission]:[suggestion]** — How to focus key information in the most concise way
|
|
229
|
-
5. **[最优解释]:[判断]** — 哪个解释最简洁且最有力
|
|
230
|
-
**[Optimal Explanation]:[judgment]** — Which explanation is simplest yet most powerful
|
|
231
|
-
6. **[行动建议]:[步骤]** — 在当前信息水平下最务实的行动方案
|
|
232
|
-
**[Action Advice]:[steps]** — The most pragmatic action plan at the current information level
|
|
233
|
-
|
|
234
|
-
**生活模式输出必须包含以上 6 项,不得只输出分析性文字而不给出结论。**
|
|
235
|
-
|
|
236
|
-
## 与其他 skill 的关系 / Relations to Other Skills
|
|
237
|
-
|
|
238
|
-
- **概率与统计**(熵与信息增益补充概率推理)——熵 H(X) 度量概率分布的不确定性,信息增益 I(X;Y) 是贝叶斯更新的信息论表达
|
|
239
|
-
- **优化思想**(信道容量最大化是优化问题)——C = max_{p(x)} I(X;Y) 是在输入分布上的最优化问题
|
|
240
|
-
- **变换思想**(编码是信息空间的变换)——编码将信息从原始空间映射到压缩/纠错空间,是信息空间的变换
|
|
241
|
-
- **建模思想**(信息准则指导模型选择)——AIC/BIC/MDL 从信息论角度量化模型的拟合与复杂度权衡
|
|
242
|
-
- **算法思想**(压缩算法是计算实现)——Huffman/LZ/LDPC 等算法是信息论极限的逼近实现
|
|
1
|
+
---
|
|
2
|
+
name: information-theory
|
|
3
|
+
description: |
|
|
4
|
+
触发:问题需量化不确定性、以"信息=不确定性的减少"度量信息价值;或需计算熵/互信息/KL 散度/信道容量,为压缩/KV 压缩/量化/路由设计信息准则时调用。
|
|
5
|
+
English: Trigger when a problem needs to quantify uncertainty, measure information value as "information = reduction of uncertainty"; or compute entropy / mutual information / KL divergence / channel capacity, or design information criteria for compression / KV-cache compression / quantization / routing.
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
> **语言路由**:若用户消息为英文,请读取并遵循同目录下的 `SKILL.en.md`,按其操作规程以英文输出;中文消息则继续使用本文件。
|
|
9
|
+
|
|
10
|
+
# 📡 信息论思想 / Information Theory
|
|
11
|
+
|
|
12
|
+
> "信息是不确定性的减少——知道更多意味着怀疑更少。"
|
|
13
|
+
> "Information is reduction of uncertainty — knowing more means doubting less."
|
|
14
|
+
>
|
|
15
|
+
> —— 信息论、编码理论、统计推断 / Information Theory, Coding Theory, Statistical Inference
|
|
16
|
+
|
|
17
|
+
## 核心原则 / Core Principle
|
|
18
|
+
|
|
19
|
+
**信息是不确定性的减少——不确定性可由熵精确量化,压缩与通信存在由熵限与信道容量刻画的不可逾越极限,信息增益则指导在不确定性下应优先获取何种观察。**
|
|
20
|
+
|
|
21
|
+
**Information is reduction of uncertainty — uncertainty is precisely quantified by entropy; compression and communication have unbreakable limits set by the entropy bound and channel capacity; information gain guides which observation to prioritize under uncertainty.**
|
|
22
|
+
|
|
23
|
+
> **数学形式化 / Mathematical Formalization**
|
|
24
|
+
>
|
|
25
|
+
> Shannon 熵 $H(X) = -\sum_x p(x)\log p(x)$ 量化随机变量的平均"惊奇度"——概率越低的事件发生时惊奇越大,熵是惊奇度的期望。
|
|
26
|
+
>
|
|
27
|
+
> 互信息 $I(X;Y) = H(X) - H(X|Y) = \sum_{x,y} p(x,y)\log\frac{p(x,y)}{p(x)p(y)}$,即观察 $Y$ 后对 $X$ 不确定性的减少——这正是"信息"的数学定义。
|
|
28
|
+
>
|
|
29
|
+
> KL 散度 $D_{KL}(P\|Q) = \sum_x p(x)\log\frac{p(x)}{q(x)}$ 衡量用 $Q$ 替代 $P$ 的信息损失,**不对称** $D(P\|Q)\neq D(Q\|P)$。
|
|
30
|
+
>
|
|
31
|
+
> 信源编码定理:最优压缩的平均编码长度 $\ge H(X)$ bits/symbol,低于熵限则必然丢失信息。
|
|
32
|
+
>
|
|
33
|
+
> 信道编码定理:可靠通信的速率上限为信道容量 $C = \max_{p(x)} I(X;Y)$;$R<C$ 时存在编码使误码率趋零,$R>C$ 时可靠通信不可能。
|
|
34
|
+
>
|
|
35
|
+
> 率失真函数 $R(D) = \min_{p(\hat{x}|x):\,\mathbb{E}[d(x,\hat{x})]\le D} I(X;\hat{X})$ 给定失真 $D$ 下的最小信息率——有损压缩的极限。
|
|
36
|
+
>
|
|
37
|
+
> 详细数学依据见 `original-texts.md`。
|
|
38
|
+
|
|
39
|
+
## GPU 友好性 / GPU-Friendliness(横切检查)
|
|
40
|
+
|
|
41
|
+
信息论量用于**压缩/剪枝/量化/KV 压缩/路由设计**时,须过 `../../references/gpu-friendly-math.md` 八维门。核心判据:**局部、可融合的熵/KL 估计 = 友好;全局精确信息估计 = 不友好**。
|
|
42
|
+
|
|
43
|
+
- **量化校准(per-block 熵/Hessian)**:局部、可批量 GEMM 化、低精度可行——友好(维度 1/2/5)。
|
|
44
|
+
- **KV-Cache 压缩(信息瓶颈/块摘要)**:低秩块摘要压缩显存——友好(维度 4);Plücker 式块摘要见 `../../references/books/algebraic-geometry-rising-sea.md`。
|
|
45
|
+
- **互信息剪枝/特征选择**:用局部或低秩近似估计 $I(X;Y)$ 则可改造;若需全分布精确估计则不友好。
|
|
46
|
+
- **信息增益路由**:全局精确 $I(X;Y)$ 需 $O(n^2)$ 显存、高精度、不可融合——反模式;改用 softmax/热带门控等连续可微近似(维度 3/6/8)。
|
|
47
|
+
- **反模式**:在完整 token 分布上精确计算熵/互信息——显存爆炸、需 fp64、串行依赖,"美但不可算"。
|
|
48
|
+
|
|
49
|
+
八维最低判定(正式术语):**张量化**看熵/KL/MI 是否可按 token/block/batch 估计;**GEMM 可映射**看压缩、投影、校准是否落线性代数;**复杂度**避免全分布精确估计;**显存与 KV-Cache**量化 KV/激活/码本占用;**低精度稳定**检查 log/softmax/KL 动态范围;**并行与通信**看分块统计是否可跨设备归约;**稀疏结构**看码本/路由是否块结构化;**算子融合**看统计、mask、量化能否融合。
|
|
50
|
+
|
|
51
|
+
> 配合 `../../references/books/matrix-analysis.md`(低秩压缩)、`../../references/books/abstract-algebra.md`(编码/有限域)。
|
|
52
|
+
|
|
53
|
+
## 不适用场景 / When NOT to Use
|
|
54
|
+
|
|
55
|
+
- **问题无概率结构**(如纯粹符号推理、逻辑演绎)——熵与信息增益需要概率分布,无概率则无信息论。
|
|
56
|
+
- **纯确定性场景无不确定性**(如已知精确答案的数学问题)——熵为零时信息论退化为平凡结论。
|
|
57
|
+
- **定性判断无需量化**(如美学评价、情感判断)——信息论量化的是概率意义上的不确定性,非语义歧义。
|
|
58
|
+
|
|
59
|
+
## 何时使用 / When to Use
|
|
60
|
+
|
|
61
|
+
- 需要度量不确定性的大小(熵 $H(X)$ 量化随机变量的"混乱程度")。
|
|
62
|
+
- 需要比较不同信息源的价值(互信息 $I(X;Y)$ 衡量哪个观察 $Y$ 最能减少关于 $X$ 的不确定性)。
|
|
63
|
+
- 需要最优数据压缩(信源编码定理保证最优压缩极限为 $H(X)$ bits/symbol)。
|
|
64
|
+
- 需要在噪声环境下可靠通信(信道编码定理保证 $R<C$ 时可靠传输可行)。
|
|
65
|
+
- 需要特征选择或模型选择(互信息筛选特征,AIC/BIC/MDL 作为信息准则选择模型)。
|
|
66
|
+
- 需要贝叶斯模型比较(KL 散度 $D(P\|Q)$ 衡量分布间信息距离,贝叶斯因子量化模型间证据比)。
|
|
67
|
+
- **为压缩 / KV-Cache 压缩 / 量化 / 路由设计信息准则**,并评估其 GPU 可行性。
|
|
68
|
+
|
|
69
|
+
## 方法流程 / Method
|
|
70
|
+
|
|
71
|
+
### 第一步:识别信息源与不确定度 / Identify Source and Uncertainty
|
|
72
|
+
- **随机变量 $X$** 是什么?——定义信息源,明确要研究的不确定性对象。
|
|
73
|
+
- **概率分布 $p(x)$**——离散分布用概率表,连续分布用密度函数。
|
|
74
|
+
- **计算 $H(X) = -\sum p(x)\log p(x)$**——量化当前不确定性水平。
|
|
75
|
+
- **识别要减少的不确定性**——明确"知道什么之后不确定性会降低?"
|
|
76
|
+
|
|
77
|
+
### 第二步:量化信息增益 / Quantify Information Gain
|
|
78
|
+
- **计算条件熵 $H(X|Y)$**——观察 $Y$ 之后 $X$ 的剩余不确定性。
|
|
79
|
+
- **计算互信息 $I(X;Y) = H(X) - H(X|Y)$**——$Y$ 对 $X$ 提供的信息量。
|
|
80
|
+
- **识别最优观察**——哪个 $Y$ 使 $I(X;Y)$ 最大?该观察最值得获取。
|
|
81
|
+
- **链式规则**——$H(X_1,\dots,X_n) = H(X_1) + H(X_2|X_1) + \dots + H(X_n|X_1,\dots,X_{n-1})$,逐变量拆解联合不确定性。
|
|
82
|
+
|
|
83
|
+
### 第三步:选择编码策略 / Choose Coding Strategy
|
|
84
|
+
- **信源编码(压缩)**:Huffman 编码(贪心最优前缀码,平均长度接近 $H(X)$)、算术编码(更接近熵限)、通用编码(LZ77/LZ78/LZW,无需已知分布)。
|
|
85
|
+
- **信道编码(纠错)**:Hamming 码(最小距离 3,纠正 1 位错)、Reed-Solomon 码(突发纠错)、LDPC/Turbo 码(逼近 Shannon 极限)。
|
|
86
|
+
- **编码选择原则**:压缩需求用信源编码→逼近 $H(X)$;噪声防护用信道编码→逼近 Shannon 极限 ($R\to C$)。
|
|
87
|
+
|
|
88
|
+
### 第四步:评估信道容量 / Evaluate Channel Capacity
|
|
89
|
+
- **计算信道容量 $C = \max_{p(x)} I(X;Y)$**——在所有输入分布上最大化互信息。
|
|
90
|
+
- **比较传输速率 $R$ 与容量 $C$**:$R<C$ → 可靠通信可行;$R>C$ → 必定出错。
|
|
91
|
+
- **噪声模型**:BSC(二元对称信道,翻转概率 $p$)、BEC(二元擦除信道,擦除概率 $\varepsilon$)、AWGN(加性白高斯噪声信道)。
|
|
92
|
+
- **容量公式示例**:BSC 容量 $C = 1 - H(p)$;AWGN 容量 $C = \frac{1}{2}\log(1 + S/N)$。
|
|
93
|
+
|
|
94
|
+
### 第五步:应用信息准则 / Apply Information Criteria
|
|
95
|
+
- **AIC(赤池信息准则)**:$\text{AIC} = -2\ln L + 2k$——偏重拟合,适合预测目标。
|
|
96
|
+
- **BIC(贝叶斯信息准则)**:$\text{BIC} = -2\ln L + k\ln n$——偏重简约,适合解释目标。
|
|
97
|
+
- **KL 散度 $D_{KL}(P\|Q) = \sum p(x)\log\frac{p(x)}{q(x)}$**——衡量用 $Q$ 替代 $P$ 的信息损失,注意不对称性。
|
|
98
|
+
- **MDL 原则(最小描述长度)**:选择使"数据描述长度 + 模型描述长度"最小的模型——信息论版本的奥卡姆剃刀。
|
|
99
|
+
|
|
100
|
+
### 第六步:做出信息最优决策 / Make Information-Optimal Decision
|
|
101
|
+
- **贝叶斯实验设计**:选择使期望信息增益 $\max\,\mathbb{E}[I(\theta;Y)]$ 最大的实验——优先获取最能减少不确定性的数据。
|
|
102
|
+
- **最小化 KL 散度**:决策输出分布 $Q$ 应尽量接近目标分布 $P$,即 $\min D(P\|Q)$。
|
|
103
|
+
- **最大熵原则**:在已知约束下选择使 $H(X)$ 最大的分布——最少假设,最保守推断。
|
|
104
|
+
- **信息瓶颈**:$\min I(X;T) - \beta I(T;Y)$——在压缩 $X$ 为 $T$ 时保留关于 $Y$ 的最大相关信息。
|
|
105
|
+
|
|
106
|
+
## 常见错误 / Common Errors
|
|
107
|
+
|
|
108
|
+
| 错误 / Error | 批评 / Critique | 正确做法 / Correct Approach |
|
|
109
|
+
|---|---|---|
|
|
110
|
+
| 把信息等同于比特而非概率减少 | 熵 $H(X)$ 是概率分布的函数,比特只是量化单位 | 理解信息为不确定性的减少 $I(X;Y)=H(X)-H(X\|Y)$ |
|
|
111
|
+
| 忽视信道容量极限 | $R>C$ 时无论何种编码都不能可靠通信 | 计算容量 $C=\max I(X;Y)$,确保 $R<C$ |
|
|
112
|
+
| 混淆熵与方差 | 熵度量概率结构的"扩散度",方差度量数值"展开度",两者不等价 | 概率不确定性用熵,数值偏差用方差;连续熵可为负 |
|
|
113
|
+
| 过度压缩低于熵限 | 最优压缩 $\ge H(X)$ bits/symbol,低于此限必然丢信息 | 接受熵限并据此设计编码 |
|
|
114
|
+
| 忽视 KL 散度不对称性 | $D(P\|Q)\ne D(Q\|P)$,方向不同含义不同 | 明确方向:$D(P\|Q)$ 用于"用 $Q$ 编码 $P$ 的额外代价" |
|
|
115
|
+
| 把相关性等同于信息 | 相关 $\rho$ 仅衡量线性关联;$I(X;Y)=0 \Leftrightarrow$ 独立,但 $\rho=0 \not\Rightarrow$ 独立 | 用互信息 $I(X;Y)$ 评估依赖关系 |
|
|
116
|
+
| 把定性判断强行量化 | 信息论量化概率不确定性,非语义歧义或主观感受 | 区分概率不确定性与语义歧义,不对定性问题套熵公式 |
|
|
117
|
+
| 全局精确熵/互信息不可算 | 在完整分布上精确估计 $I(X;Y)$ 需 $O(n^2)$ 显存与高精度,GPU 不可行 | 用局部/采样/低秩估计,过 GPU 八维门 |
|
|
118
|
+
|
|
119
|
+
## 操作规程 / Operating Procedure
|
|
120
|
+
|
|
121
|
+
当本 skill 被触发时,输出必须包含:
|
|
122
|
+
|
|
123
|
+
1. **[信息源]:[描述]** $H(X)=$ [值]——定义随机变量 $X$,计算其熵,量化当前不确定性。
|
|
124
|
+
2. **[信息增益]:[描述]** $I(X;Y)=$ [值]——计算互信息,识别最有价值的观察 $Y$。
|
|
125
|
+
3. **[编码策略]:[选择]**——信源编码(压缩)或信道编码(纠错),说明逼近哪种极限。
|
|
126
|
+
4. **[信道容量]:[描述]** $C=$ [值]——计算信道容量,比较传输速率 $R$ 与 $C$。
|
|
127
|
+
5. **[信息准则]:[AIC/BIC/KL/MDL]**——说明选择的信息准则及理由。
|
|
128
|
+
6. **[最优决策]:[说明]**——基于信息增益最大化或 KL 散度最小化的决策建议。
|
|
129
|
+
7. **[GPU 可行性]**(若用于压缩/KV 压缩/量化/路由)——熵/KL/互信息估计是局部可融合还是全局精确?过八维门,标注友好/可改造/不友好 + 改造建议。
|
|
130
|
+
|
|
131
|
+
**输出不得只给分析而无结论。**
|
|
132
|
+
|
|
133
|
+
## 与其他 skill 的关系 / Relations to Other Skills
|
|
134
|
+
|
|
135
|
+
- **概率与统计**:熵与信息增益补充概率推理——$H(X)$ 度量分布不确定性,$I(X;Y)$ 是贝叶斯更新的信息论表达。
|
|
136
|
+
- **优化思想**:信道容量最大化是优化问题——$C=\max_{p(x)} I(X;Y)$ 是输入分布上的最优化。
|
|
137
|
+
- **变换思想**:编码是信息空间的变换——信源编码变换为高效表示,信道编码变换为抗干扰表示。
|
|
138
|
+
- **建模思想**:信息准则指导模型选择——AIC/BIC/MDL 从信息论角度量化拟合与复杂度权衡。
|
|
139
|
+
- **算法思想**:压缩算法是计算实现——Huffman/LZ/LDPC 等算法是信息论极限的逼近实现。
|
|
140
|
+
- **现代数学激活**:`../../references/books/matrix-analysis.md`(低秩压缩)、`../../references/books/abstract-algebra.md`(编码/有限域)、`../../references/books/algebraic-geometry-rising-sea.md`(Plücker KV 压缩)。
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
# Mathematical Sources and Classic Texts
|
|
2
|
+
|
|
3
|
+
## Shannon's Information Theory (1948)
|
|
4
|
+
|
|
5
|
+
> H(X) = -Sum p(x) log p(x) -- Entropy, the average uncertainty of an information source
|
|
6
|
+
> I(X;Y) = H(X) - H(X|Y) -- Mutual information, the information contribution of observing Y about X
|
|
7
|
+
> C = max_{p(x)} I(X;Y) -- Channel capacity, the upper bound on the rate of reliable communication
|
|
8
|
+
>
|
|
9
|
+
> Source coding theorem: optimal compression >= H(X) bits/symbol
|
|
10
|
+
> Channel coding theorem: when R < C, there exists a coding scheme that drives the error rate to zero
|
|
11
|
+
|
|
12
|
+
**Meaning**: Information can be precisely quantified; there exist insurmountable mathematical limits on compression and communication, not merely limits imposed by the current state of engineering. Entropy measures "average surprise" -- low-probability events carry more information when they occur. Mutual information measures "reduction in uncertainty" -- how much observing Y reduces our uncertainty about X.
|
|
13
|
+
|
|
14
|
+
**Mathematical background**: Claude Shannon founded information theory in "A Mathematical Theory of Communication" (1948). Core contributions: (1) Defined entropy H(X) = -Sum p(x) log p(x), where the choice of logarithm base determines the unit (base 2 -> bits, base e -> nats); (2) The source coding theorem proves that the average length L of an optimal prefix code satisfies L >= H(X), with equality if and only if all probabilities are powers of 2; (3) The channel coding theorem proves that when R < C there exist coding sequences such that P(error) -> 0, while for R > C, P(error) > 0 is unavoidable. Shannon's proofs use random coding arguments -- constructing a random codebook and then showing that the error rate of a "typical" code approaches zero, thereby establishing the existence of at least one such code.
|
|
15
|
+
|
|
16
|
+
## Huffman Coding (1952)
|
|
17
|
+
|
|
18
|
+
> Greedy construction of optimal prefix codes: repeatedly merge the two symbols with the smallest probabilities, building the tree bottom-up.
|
|
19
|
+
> Average code length L(Huffman) <= H(X) + 1; when probabilities are powers of 2, L = H(X).
|
|
20
|
+
|
|
21
|
+
**Meaning**: An optimal prefix code (unambiguously decodable) can be constructed exactly via a greedy algorithm, with average length approaching the entropy bound.
|
|
22
|
+
|
|
23
|
+
**Mathematical background**: David Huffman published this algorithm in 1952 as an MIT student, proving its optimality. Huffman coding is a variable-length prefix code -- more frequent symbols receive shorter codewords, and the prefix condition guarantees that no codeword is a prefix of another, enabling instantaneous decoding. When symbol probabilities are not all powers of 2, the average length of Huffman coding is strictly greater than H(X); arithmetic coding encodes an entire message as an interval and can approach the entropy bound more closely.
|
|
24
|
+
|
|
25
|
+
## Hamming Codes (1950)
|
|
26
|
+
|
|
27
|
+
> [7,4] Hamming code: 4 information bits + 3 parity bits = 7-bit codeword, minimum Hamming distance d_min = 3
|
|
28
|
+
> Can correct 1-bit errors or detect 2-bit errors
|
|
29
|
+
> General [2^r - 1, 2^r - 1 - r] Hamming code: r parity bits, minimum distance 3
|
|
30
|
+
|
|
31
|
+
**Meaning**: The first systematic construction of error-correcting codes -- a small amount of redundancy can protect information from corruption by noise.
|
|
32
|
+
|
|
33
|
+
**Mathematical background**: Richard Hamming, working at Bell Labs, designed the first systematic error-correcting code after hardware errors in early computers caused his programs to crash. Hamming distance d(x,y) = the number of positions at which two binary strings differ; a minimum distance d_min >= 2t+1 allows correction of t-bit errors. Hamming codes are perfect codes -- the sphere packing exactly fills the entire space. Subsequent developments: Reed-Solomon codes (1960) for burst error correction and CD/DVD; LDPC codes (Gallager 1962) and Turbo codes (1993) approach the Shannon limit.
|
|
34
|
+
|
|
35
|
+
## Kolmogorov Complexity (1965)
|
|
36
|
+
|
|
37
|
+
> K(x) = the length of the shortest program that outputs x (on a universal Turing machine)
|
|
38
|
+
> Kolmogorov complexity is an algorithmic measure of information -- complementary to Shannon entropy
|
|
39
|
+
>
|
|
40
|
+
> Uncomputability: K(x) is not computable in general (Chaitin's incompleteness theorem)
|
|
41
|
+
|
|
42
|
+
**Meaning**: The shortest program description length is the intrinsic information content of an object -- a more fundamental measure of information than Shannon entropy, independent of any probability distribution.
|
|
43
|
+
|
|
44
|
+
**Mathematical background**: Andrey Kolmogorov proposed algorithmic information theory in 1965, defining K(x) as the length |p| of the shortest program p that outputs x on a universal Turing machine U: K_U(x) = min{|p| : U(p) = x}. Key properties: (1) Uncomputability -- no algorithm can compute K(x) in general; (2) Invariance theorem -- the values of K_U(x) on different universal Turing machines differ by at most a constant c (depending on the choice of machine); (3) Relation to entropy -- for i.i.d. sequences, E[K(x)] is approximately nH(X) (the algorithmic analogue of Shannon entropy); (4) Chaitin's incompleteness theorem -- a formal system cannot prove K(x) > c for most x. Kolmogorov complexity is the theoretical foundation of the MDL principle.
|
|
45
|
+
|
|
46
|
+
## KL Divergence (Kullback-Leibler, 1951)
|
|
47
|
+
|
|
48
|
+
> D(P||Q) = Sum p(x) log(p(x)/q(x)) = E_P[log(p(X)/q(X))]
|
|
49
|
+
>
|
|
50
|
+
> D(P||Q) >= 0, with equality if and only if P = Q
|
|
51
|
+
> D(P||Q) is not equal to D(Q||P) -- it is asymmetric
|
|
52
|
+
> D(P||Q) is not a distance (asymmetric, does not satisfy the triangle inequality)
|
|
53
|
+
|
|
54
|
+
**Meaning**: KL divergence measures "the number of extra bits needed to encode data from distribution P using distribution Q" -- a one-directional measure of information loss.
|
|
55
|
+
|
|
56
|
+
**Mathematical background**: Solomon Kullback and Richard Leibler proposed relative entropy in 1951, defined as D(P||Q) = Sum p(x) log(p(x)/q(x)). Core properties: (1) Non-negativity D(P||Q) >= 0 (proved via Gibbs' inequality); (2) Asymmetry D(P||Q) is not equal to D(Q||P) -- the interpretation of D(P||Q) is "the expected extra length of encoding data from P using Q," and the direction cannot be interchanged; (3) Relation to mutual information: I(X;Y) = D(p(x,y)||p(x)p(y)) -- mutual information is the KL divergence between the joint distribution and the product of the marginals; (4) Relation to entropy: H(P) + D(P||Q) = Sum p(x)(-log q(x)) -- cross-entropy equals entropy plus KL divergence. The cross-entropy loss function is central to deep learning: minimizing H(P) + D(P||Q) = minimizing Sum p(x)(-log q(x)).
|
|
57
|
+
|
|
58
|
+
## Rate-Distortion Theory (Shannon, 1959)
|
|
59
|
+
|
|
60
|
+
> R(D) = min_{p(z|x): E[d(x,z)] <= D} I(X;Z)
|
|
61
|
+
>
|
|
62
|
+
> The minimum rate R(D) required under an allowed distortion D
|
|
63
|
+
> R(0) = H(X) (lossless compression), R(D_max) = 0 (maximum allowable distortion)
|
|
64
|
+
|
|
65
|
+
**Meaning**: Lossy compression has a fundamental limit given by the rate-distortion function R(D) -- lower rates require accepting greater distortion.
|
|
66
|
+
|
|
67
|
+
**Mathematical background**: Shannon extended the source coding theorem to lossy compression in 1959. The rate-distortion function R(D) is defined as the minimum of mutual information I(X;Z) subject to the constraint that expected distortion E[d(x,z)] <= D. The distortion measure d(x,z) can be Hamming distortion (binary), squared error (continuous), etc. R(D) is monotonically decreasing and convex -- greater tolerance for distortion yields lower required rate. The inverse function D(R) gives the minimum achievable distortion at a given rate. Practical applications: JPEG/MPEG compression, speech coding, and related technologies follow this theoretical framework.
|
|
68
|
+
|
|
69
|
+
## Fisher Information (1925)
|
|
70
|
+
|
|
71
|
+
> I(theta) = E[(d log f(X;theta)/d theta)^2] = -E[d^2 log f(X;theta)/d theta^2]
|
|
72
|
+
>
|
|
73
|
+
> Cramer-Rao lower bound: Var(theta_hat) >= 1/I(theta), for any unbiased estimator theta_hat
|
|
74
|
+
> Fisher information measures the information content of data about parameter theta
|
|
75
|
+
|
|
76
|
+
**Meaning**: Fisher information is the information-theoretic measure in statistical inference -- it connects information theory to the theoretical limits of parameter estimation.
|
|
77
|
+
|
|
78
|
+
**Mathematical background**: R.A. Fisher proposed the concept of information content I(theta) in 1925, measuring the discriminative power of a single observation with respect to parameter theta. Cramer (1946) and Rao (1945) independently proved the Cramer-Rao lower bound Var(theta_hat) >= 1/(nI(theta)). Key connections: (1) Fisher information and KL divergence -- I(theta) = lim_{theta' -> theta} 2D(f(x;theta)||f(x;theta'))/(theta - theta')^2, the local second-order approximation of KL divergence; (2) Fisher information and Bayesian information -- the Jeffreys prior p(theta) proportional to |I(theta)|^(1/2) makes the volume uniform under the Fisher information metric in parameter space; (3) Large-sample properties of maximum likelihood estimation -- theta_hat_MLE is asymptotically normal N(theta, 1/(nI(theta))), achieving the Cramer-Rao lower bound. Fisher information is the bridge between information theory and statistical inference.
|
|
79
|
+
|
|
80
|
+
## MDL Principle (Rissanen, 1978)
|
|
81
|
+
|
|
82
|
+
> MDL(M, D) = L(D|M) + L(M)
|
|
83
|
+
>
|
|
84
|
+
> Choose the model that minimizes "description length of data given the model + description length of the model itself"
|
|
85
|
+
> L(D|M) = -log P(D|M) (negative log-likelihood of the data)
|
|
86
|
+
> L(M) = model encoding length (complexity penalty)
|
|
87
|
+
|
|
88
|
+
**Meaning**: MDL is the information-theoretic version of Occam's razor -- a good model is both accurate (short data description) and parsimonious (short model description).
|
|
89
|
+
|
|
90
|
+
**Mathematical background**: Jorma Rissanen proposed the Minimum Description Length principle in 1978, reducing model selection to a coding problem. Relationships between MDL and other criteria: (1) MDL and BIC -- two-part MDL (L(D|M) + L(M)) is asymptotically equivalent to BIC (-2 ln L + k ln(n)) for large samples; (2) MDL and Kolmogorov complexity -- ideal MDL uses Kolmogorov complexity K(M) to measure model complexity, but K(M) is uncomputable; practical MDL approximates it with parameter encoding length. Normalized MDL (1996) uses mixture coding to handle parameters, avoiding the arbitrary-precision problem. The central insight of MDL: model selection is fundamentally data compression -- the best model is the one that compresses the data best.
|
|
91
|
+
|
|
92
|
+
## Mutual Information and Channel Capacity
|
|
93
|
+
|
|
94
|
+
> I(X;Y) = H(X) - H(X|Y) = H(Y) - H(Y|X) = H(X) + H(Y) - H(X,Y)
|
|
95
|
+
>
|
|
96
|
+
> Symmetry of mutual information: I(X;Y) = I(Y;X)
|
|
97
|
+
> Non-negativity of mutual information: I(X;Y) >= 0, with equality if and only if X and Y are independent
|
|
98
|
+
>
|
|
99
|
+
> Channel capacity C = max_{p(x)} I(X;Y)
|
|
100
|
+
> Typical set A_epsilon^n: {x^n : |-log p(x^n)/n - H(X)| < epsilon}
|
|
101
|
+
|
|
102
|
+
**Meaning**: Mutual information is a precise measure of the dependence between two random variables -- it is zero if and only if they are independent, and positive if statistical association exists. Channel capacity is the maximum of mutual information over all input distributions, defining the theoretical limit of reliable communication.
|
|
103
|
+
|
|
104
|
+
**Mathematical background**: Mutual information I(X;Y) = Sum p(x,y) log(p(x,y)/(p(x)p(y))) = D(p(x,y)||p(x)p(y)) -- the KL divergence between the joint distribution and the product of the marginals. The typical set is the key tool in Shannon's proofs of coding theorems: for an i.i.d. source X^n, typical sequences x^n satisfy |-1/n log p(x^n) - H(X)| < epsilon; the probability of the typical set approaches 1 (as n -> infinity), yet the size of the typical set is approximately 2^{nH(X)}, far smaller than the entire space 2^n (when H(X) < 1). This explains why compression to nH(X) bits suffices to cover nearly all valid sequences.
|
|
105
|
+
|
|
106
|
+
## Joint Entropy, Conditional Entropy, and Chain Rules
|
|
107
|
+
|
|
108
|
+
> H(X,Y) = H(X) + H(Y|X) -- Chain rule for joint entropy
|
|
109
|
+
> H(Y|X) = Sum p(x) H(Y|X=x) -- Conditional entropy
|
|
110
|
+
> I(X;Y) = H(X) - H(X|Y) = H(Y) - H(Y|X) -- Mutual information
|
|
111
|
+
> I(X;Y|Z) = H(X|Z) - H(X|Y,Z) -- Conditional mutual information
|
|
112
|
+
> Chain expansion of I(X1;X2;...;Xn): I(X;Y,Z) = I(X;Y) + I(X;Z|Y)
|
|
113
|
+
|
|
114
|
+
**Meaning**: The chain rule for entropy decomposes joint uncertainty into the contributions of individual variables -- enabling an understanding of the information structure of multivariate systems.
|
|
115
|
+
|
|
116
|
+
**Mathematical background**: Joint entropy H(X,Y) = -Sum p(x,y) log p(x,y) measures the total uncertainty of a pair of random variables. The chain rule H(X,Y) = H(X) + H(Y|X) states: once X is known, the additional uncertainty of Y is H(Y|X). Generalized to n variables: H(X1,...,Xn) = Sum_i H(Xi|X1,...,Xi-1). Conditional mutual information I(X;Y|Z) measures "the additional information that Y provides about X, given that Z is already known" -- a key tool in information bottleneck methods and causal inference. The chain expansion of multivariate mutual information: I(X;Y,Z) = I(X;Y) + I(X;Z|Y), showing that the joint information of Y and Z about X equals the direct information from Y plus the conditional information from Z.
|
|
117
|
+
|
|
118
|
+
## Everyday Insights from Information Theory and Coding Theory
|
|
119
|
+
|
|
120
|
+
> "The core of information theory is not about computing precise bit counts, but about cultivating the habit of mind that uncertainty is quantifiable, information has value, and fundamental limits cannot be transcended."
|
|
121
|
+
|
|
122
|
+
- Do not ignore uncertainty -- entropy H(X) quantifies it
|
|
123
|
+
- Information has direction and magnitude -- mutual information I(X;Y) measures it
|
|
124
|
+
- Compression has limits -- the source coding theorem defines them
|
|
125
|
+
- Communication has limits -- the channel coding theorem defines them
|
|
126
|
+
- Model selection has information-theoretic criteria -- AIC/BIC/MDL guide it
|
|
127
|
+
- There is an information-theoretic distance between probability distributions -- KL divergence measures it
|