How to calculate the entropy of a coin flip

2.4k views Asked by At

I would like to know ...

In the repeated coin flip, ¿how do I calculate the entropy of the random variable X that represents the number of flips to do until get "head" for first time?

1

There are 1 answers

0
Nico Schertler On

The variable X can take any number from 1 through infinity. The probabilities are:

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

The entropy is:

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 )

Solving this yields:

H = 2 bit