Я даже программу когда-то писала в духе "конформационной энтропии"
- приходилось формулой Шеннона пользоваться. double Shannon( double vl_layer[], int num_el)
// inpit params: array with num_el elements
// return entropy value
{ int i;
double sum_layer = 0;
for( int i=0; i < num_el; i++)
{ sum_layer += vl_layer[i]; // sum of data
}
if( sum_layer <= 0) return 0;
double entropy = 0;
for( i=0; i < num_el; i++)
{ double pb = vl_layer[i] / sum_layer; // probability
if( pb <= 0) continue;
entropy -= pb * log2( pb); // accumulate product
}
return entropy; }
https://360wiki.ru/wiki/Conformational_entropy