Computes Entropy of a given distribution.