private static double estimateSize(byte[] Q, double alpha) {
    double E = 0.0;
    int count = 0;
    int q = Q.length;
    byte w = (byte)Math.round(Math.log(q)/LOG_2);
    for(byte b : Q) {
      if(b == (byte)0) {
        count++;
      }
      E += Math.pow(2.0, -1 * b);
    }
    E = alpha * Math.pow(q, 2) * (1.0/E);
    E = (E < 5*q) ? (E - estimateBias(E, w)) : E;
    double H = (count != 0) ? (q * Math.log(q/((double)count))) : E;
    return H <= thresholds[w - MIN_P] ? H : E;
  }