import math


def get_max_entropy(n):
  """ Calculate the maximum entropy in a sample of size n """
  sum = 0.0
  p = 1/float(n)
  for i in range(1,n+1):
    sum += p*math.log(p,2)
  max_entropy = -sum
  return max_entropy