6

Given a matrix whose entries consist of only 1's and 0's, I would like to come up with a measure of how "ordered" the matrix is, in some sense. This exact question was posed here:

Measuring entropy/ information/ patterns of a 2d binary matrix

in which the top-rated answer posted by whuber provided what I'm looking for, except that I didn't understand one key detail. Referring to his answer, he writes: 'Let's measure this randomness with their base-2 entropy. For $a_1$, the sequence of these entropies is $(1.92, 1.5, 1.58, 1.0)$. Let's call this the "profile" of $a_1$.'

Unfortunately, I've tried but failed to come up with the same entropy values, so I'd appreciate it if I could get some help on how to arrive at those numbers.

jyinvicta
  • 61
  • 3
  • Did you find a solution? – productioncoder Mar 17 '14 at 10:01
  • 1
    I'd just like to tack on a point of interest; whuber and Cosmo Harrigan have provided excellent answers to this question but I would also encourage you to reframe this as a graph problem. Graph entropy has quite a bit of literature about this and approaches the exact same problem from a different viewpoint: imagine that this matrix defines the connections between nodes. This may make it a little bit easier to understand. For reference, here's a link that discusses this. http://www.visualab.org/index.php/what-is-an-entropy-of-graph-is-it-related-to-concept-of-entropy-in-information-theory – Christopher Krapu Jul 09 '15 at 23:26

1 Answers1

4

The results you are referring to can be replicated using the following code:

https://github.com/cosmoharrigan/matrix-entropy

This code generates the visualizations and includes the calculation of the "profile" (a list of the entropies) of the set of scaled filtered matrices. Note that the specific entropy values have been updated in the original answer.

Cosmo Harrigan
  • 147
  • 1
  • 7