entropy function

Calculate the entropy