如何计算硬币翻转的熵

时间:2015-06-16 12:15:11

标签: math encoding statistics probability entropy

我想知道......

在重复的硬币翻转中,¿如何计算随机变量X的熵,该熵代表在第一次获得“头部”之前要做的翻转次数?

1 个答案:

答案 0 :(得分:2)

变量X可以取1到无穷大的任意数字。概率是:

p(X = i) = (1/2)^i

熵是:

H = - Sum {i from 1 to infinity} ( p(X = i) * log2(p(X = i)) )
  = - Sum {i from 1 to infinity} ( 1/2^i * log2(1/2^i) )
  = - Sum {i from 1 to infinity} ( 1/2^i * i * log2(1/2) )
  =   Sum {i from 1 to infinity} ( 1/2^i * i )

解决这个问题:

H = 2 bit