Does information entropy with binary options reduce to the simple frequency count?

25 Views Asked by At

This is a simple question, but I'd like some reassurance that my thinking is correct:

I need to calculate Shannon information entropy and use it as a measure of randomness. I have a sequence of 200 letters that consist of only say As and Bs. In my case it's simple because the choice set is binary ($x_1$ and $x_2$, i.e. the information entropy equation $H(x) = -\sum_{i=1}^np(x_i) \log_2 p(x_i)$ becomes:

$$ H(x) = -(p(x_1)*log_2(p(x_1))+(1-p(x_1))*log_2(1-p(x_1))) $$

So for example, if I have a sequence of 150 As and 50 Bs, then H(x)= 0.8, for 100 As and 100 Bs, H=1, so maximum surprise and for 0 As and 200 Bs, H(x) is taken to be = 0, no surprise at all.

I will be using this entropy value in a statistical analysis as a dependent variable. It occurred to me that it might be overkill to calculate H(x) if I could just as well just take the frequency of e.g. the letter since it's a binary case?

I'm wondering if in my case the entropy formulation gives me any additional information that I wouldn't have gotten from just looking at the frequency count of one of the letters. In other words, knowing that A occured 150 out of 200 times is enough because it is identical to knowing that H(x) = 0.8