entropy function

Calculate Shannon entropy