  We prove that, in a finitely generated residually finite group of
subexponential growth, the proportion of commuting pairs is positive if and
only if the group is virtually abelian. In particular, this covers the case
where the group has polynomial growth (i.e., virtually nilpotent groups, where
the hypothesis of residual finiteness is always satisfied). We also show that,
for non-elementary hyperbolic groups, the proportion of commuting pairs is
always zero.
