  For the Erd\H{o}s-R\'enyi random graph G(n,p), we give a precise asymptotic
formula for the size of a largest vertex subset in G(n,p) that induces a
subgraph with average degree at most t, provided that p = p(n) is not too small
and t = t(n) is not too large. In the case of fixed t and p, we find that this
value is asymptotically almost surely concentrated on at most two explicitly
given points. This generalises a result on the independence number of random
graphs. For both the upper and lower bounds, we rely on large deviations
inequalities for the binomial distribution.
