4
$\begingroup$

I have the following data set, and wish to track the evolution of the entropy of each element within the set. I have evaluated the entropy for some elements, but how does one evaluate the entropy of each element, going from the first to the last, and display the evolution of the entropy with time. This should be done for any general data for any number of elements. The time here is in fact the position of each element.

Data1 = {{1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, 
       {1, 1, 0, 0, 0, 0}, {1, 1, 0, 0, 0, 0}, 
       {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 1}, 
       {1, 1, 1, 0, 0, 1}, {1, 1, 1, 0, 0, 0}, 
       {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, 
       {0, 1, 1, 0, 0, 0}, {0, 1, 1, 0, 0, 0}, 
       {0, 0, 1, 0, 0, 0}, {0, 0, 1, 0, 0, 0}, 
       {0, 0, 0, 0, 0, 0}}; 

N[Entropy[{1, 1, 1, 0, 0, 0}]]

N[Entropy[{1, 1, 1, 0, 0, 0}]]

N[Entropy[{1, 1, 0, 0, 0, 0}]]

N[Entropy[{0, 0, 0, 0, 0, 0}]]

(* 0.673012, 0.673012, 0.636514, 0 *)

$\endgroup$
  • 3
    $\begingroup$ N[Entropy /@ Data1]? $\endgroup$ – kglr Mar 16 '15 at 5:08
7
$\begingroup$

Just for fun:

d = {{1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {1, 1, 0, 0, 0, 0}, {1, 
    1, 0, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 1}, {1, 1, 1, 
    0, 0, 1}, {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 0}, {1, 1, 1, 0, 0, 
    0}, {0, 1, 1, 0, 0, 0}, {0, 1, 1, 0, 0, 0}, {0, 0, 1, 0, 0, 
    0}, {0, 0, 1, 0, 0, 0}, {0, 0, 0, 0, 0, 0}};
en = N[Entropy/@ d]

yields:{0.693147, 0.693147, 0.636514, 0.636514, 0.693147, 0.636514, \ 0.636514, 0.693147, 0.693147, 0.693147, 0.636514, 0.636514, 0.450561, \ 0.450561, 0.}

A visualization:

Show[MatrixPlot[d, Mesh -> All],
 ListPlot[Thread[{7 + Reverse@en, Range[15] - 0.5}], Joined -> True, 
  PlotMarkers -> Automatic], GridLines -> {{7}, None}]

enter image description here

The blue line showing entropy...relative to axis

$\endgroup$
3
$\begingroup$

I believe this is what you seek:

ListPlot[Entropy /@ Data1]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.