Water-hammer equations (WHE) are routinely used to interpret leak detection tests in pipe networks. Assimilation of pressure data into model predictions is typically done within the probabilistic framework, which treats uncertain model parameters (e.g., initial and boundary conditions, location and intensity of a leak) as random variables so that solutions of the WHE are given in terms of probability density functions (PDFs) of fluid pressure and velocity. These are usually approximated with computationally expensive Monte Carlo simulations (MCS). We use the method of distributions to derive a deterministic equation for the (joint) PDFs of the pressure and flow rate governed by the WHE. This PDF equation employs a closure approximation that ensures the self-consistency in terms of the mean and variance of the state variables. Our numerical experiments demonstrate the agreement between solutions of the PDF equation and MCS, and the computational efficiency of the former relative to the latter.