香农信息论交互实验室

通过交互式可视化探索信息论的数学基础

1 自信息 (Self-Information)

$$ I(x) = -\log_2 P(x) $$

单个事件发生时的"惊讶度"或信息量

稀有 (0.01) 等可能 (0.5) 常见 (0.99)

自信息量:

{{ selfInformation.toFixed(4) }} bits

惊讶度:

{{ getSurpriseLevel(selfInformation) }}
I(x)
{{ selfInformation.toFixed(2) }}

2 信息熵 (Information Entropy)

$$ H(X) = -\sum_{i=1}^n P(x_i) \log_2 P(x_i) $$

随机变量的平均不确定性

$x_{{index+1}}$ {{ (prob/100).toFixed(3) }}

信息熵 $H(X)$:

{{ entropy.toFixed(4) }} bits

最大可能熵:

{{ maxEntropy.toFixed(4) }} bits

不确定性程度: {{ (entropy/maxEntropy*100).toFixed(1) }}%

3 二元熵 (Binary Entropy)

$$ H(p) = -p \log_2 p - (1-p) \log_2(1-p) $$

伯努利分布的特例

$P(A)$

{{ pBinary.toFixed(3) }}

$P(\bar{A})$

{{ (1-pBinary).toFixed(3) }}

二元熵值:

{{ binaryEntropy.toFixed(4) }} bits

{{ getBinaryEntropyInterpretation(pBinary) }}

4 互信息 (Mutual Information)

$$ I(X;Y) = \sum_{x\in X}\sum_{y\in Y} P(x,y) \log_2\frac{P(x,y)}{P(x)P(y)} $$

两个随机变量之间的共享信息量

负相关 (-1) 独立 (0) 正相关 (1)

$H(X)$

{{ marginalEntropyX.toFixed(3) }}

$I(X;Y)$

{{ mutualInformation.toFixed(3) }}

$H(Y)$

{{ marginalEntropyY.toFixed(3) }}

共享信息
{{ mutualInformation.toFixed(2) }} bits

5 香农-哈特利定理 (Shannon-Hartley Theorem)

$$ C = B \log_2\left(1 + \frac{S}{N}\right) $$

高斯白噪声信道的容量上限

窄带 (1MHz) 宽带 (50MHz) 超宽带 (100MHz)
差 (-10dB) 中等 (15dB) 优 (40dB)

线性 SNR

{{ snrLinear.toFixed(2) }}

频谱效率

{{ spectralEfficiency.toFixed(2) }} bps/Hz

信道容量上限:

{{ channelCapacity.toFixed(2) }} Mbps

每秒可传输 {{ Math.floor(channelCapacity * 1e6 / 8).toLocaleString() }} 字节

6 文本熵分析

$$ H_{\text{text}} = -\sum_{c \in \text{chars}} p(c) \log_2 p(c) $$

计算自然语言的信息密度

字符数

{{ textInput.length }}

独特字符

{{ uniqueChars }}

最大可能熵

{{ maxTextEntropy.toFixed(3) }}

实际熵:

{{ textEntropy.toFixed(4) }} bits/char

压缩效率:

{{ compressionEfficiency.toFixed(1) }}%