As required by ID3 algorithm, calculates entropy for attributes