@hanno (not a statistician) for large N (N > 30), you can approximate the Hamming weight as a normal distribution with mean = n/2 and stddev = sqrt(n)/2 (see https://en.wikipedia.org/wiki/Binomial_distribution)

From that, you can get the probability that the weight sits between 0.4n and 0.6n by calculating the integral between these two points (erf function).

A good rule of thumb is knowing that there's a 68-95-99.7 probability that the actual value is 1-2-3 stddevs from the mean.

I don't know what to do for small N.