互信息/熵计算帮助

发布于 2024-08-30 15:22:28 字数 304 浏览 2 评论 0原文

希望有人能给我一些关于这个熵问题的指导。

假设 X 是从均匀整数分布 0-32(含)中随机选择的。

我计算熵 H(X) = 32 位,因为每个 Xi 出现的概率相等。

现在,假设执行以下伪代码。

int r = 兰特(0,1); // 随机整数 0 或 1

r = r * 33 + X;

我如何计算两个变量 r 和 X 之间的互信息?

互信息定义为 I(X; Y) = H(X) - H(X|Y) 但我不太明白如何将条件熵 H(X|Y) 应用于这个问题。

谢谢

Hoping someone can give me some pointers with this entropy problem.

Say X is chosen randomly from the uniform integer distribution 0-32 (inclusive).

I calculate the entropy, H(X) = 32 bits, as each Xi has equal probability of occurring.

Now, say the following pseudocode executes.

int r = rand(0,1); // a random integer 0 or 1

r = r * 33 + X;

How would I work out the mutual information between the two variables r and X?

Mutual Information is defined as I(X; Y) = H(X) - H(X|Y) but I don't really understand how to apply the conditional entropy H(X|Y) to this problem.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼眸印温柔 2024-09-06 15:22:28

如果这是作业,那么我会给出提示。 (另外,我假设 X ~ unif[0,31] 所以数字效果很好。你确定它是 [0,32] 而不是 [0,31] 吗?)

首先,检查 H(X) 的计算。 H(X) = 5,而不是 32。

其次,方程 r = 33r + X 没有意义。让我使用不同的变量:

Y = 32R + X

第三,你没有说明 R 的概率分布。假设 0 和 1 是等概率的,则 H(R) = 1。

正如你所说, I(X;Y) = H(X) - H(X|Y) = H(Y) - H(Y|X)。考虑 H(Y|X)。如果 X 给定,即保持不变,那么 Y 仅取决于 R,对吧?因此,H(Y|X) = H(R)。

最后,使用全概率定律计算 Y 的概率分布。(提示:这很简单。)然后您可以计算 H(Y),最后计算 I(X;Y)。

If this is homework, then I'll give hints. (Also, I'll suppose X ~ unif[0,31] so the numbers work out nice. Are you sure it's [0,32] and not [0,31]?)

First, check your calculation for H(X). H(X) = 5, not 32.

Second, the equation r = 33r + X makes no sense. Let me use different variables:

Y = 32R + X

Third, you don't state the probability distribution of R. Assuming 0 and 1 are equiprobable, then H(R) = 1.

As you said, I(X;Y) = H(X) - H(X|Y) = H(Y) - H(Y|X). Consider H(Y|X). If X is given, i.e. held constant, then Y only depends on R, right? Therefore, H(Y|X) = H(R).

Finally, use the law of total probability to compute the probability distribution of Y. (Hint: it's a simple one.) Then you can compute H(Y), and finally, I(X;Y).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文