  Consider integers $k,\ell$ such that $0\le \ell \le \binom{k}2$. Given a
large graph $G$, what is the fraction of $k$-vertex subsets of $G$ which span
exactly $\ell$ edges? When $G$ is empty or complete, and $\ell$ is zero or
$\binom{k}{2}$, this fraction can be exactly 1. On the other hand, if $\ell$ is
far from these extreme values, one might expect that this fraction is
substantially smaller than 1. This was recently proved by Alon, Hefetz,
Krivelevich and Tyomkyn who intiated the systematic study of this question and
proposed several natural conjectures.
  Let $\ell^{*}=\min\{\ell,\binom{k}{2}-\ell\}$. Our main result is that for
any $k$ and $\ell$, the fraction of $k$-vertex subsets that span $\ell$ edges
is at most $\log^{O\left(1\right)}\left(\ell^{*}/k\right)\sqrt{k/\ell^{*}}$,
which is best-possible up to the logarithmic factor. This improves on multiple
results of Alon, Hefetz, Krivelevich and Tyomkyn, and resolves one of their
conjectures. In addition, we also make some first steps towards some analogous
questions for hypergraphs.
  Our proofs involve some Ramsey-type arguments, and a number of different
probabilistic tools, such as polynomial anticoncentration inequalities,
hypercontractivity, and a coupling trick for random variables defined on a
"slice" of the Boolean hypercube.
