  This paper studies the Weil-Petersson measure on the moduli space of compact
hyperbolic surfaces of genus $g$. We define "volume functions" associated with
arbitrary topological types of closed geodesics, generalising the "volume
polynomials" studied by M. Mirzakhani for simple closed geodesics. Our
programme is to study the structure of these functions, focusing on their
behaviour in the limit $g \to +\infty$. Motivated by J. Friedman's work on
random graphs, we prove that volume functions admit asymptotic expansions to
any order in powers of $1/g$, and claim that the coefficients in these
expansions belong to a newly-introduced class of functions called
"Friedman-Ramanujan functions". We prove the claim for closed geodesics filling
a surface of Euler characteristic 0 and -1. This result is then applied to
prove that a random hyperbolic surface has spectral gap $> 2/9 - \epsilon$ with
high probability as $g \to +\infty$, using the trace method and cancellation
properties of Friedman-Ramanujan functions.
