  General relativity predicts that a black hole that results from the merger of
two compact stars (either black holes or neutron stars) is initially highly
deformed but soon settles down to a quiescent state by emitting a superposition
of quasi-normal modes (QNMs). The QNMs are damped sinusoids with characteristic
frequencies and decay times that depend only on the mass and spin of the black
hole and no other parameter - a statement of the no-hair theorem. In this paper
we have examined the extent to which QNMs could be used to test the no-hair
theorem with future ground- and space-based gravitational-wave detectors. We
model departures from general relativity (GR) by introducing extra parameters
which change the mode frequencies or decay times from their general
relativistic values. With the aid of numerical simulations and Bayesian model
selection, we assess the extent to which the presence of such a parameter could
be inferred, and its value estimated. We find that it is harder to decipher the
departure of decay times from their GR value than it is with the mode
frequencies. Einstein Telescope (ET, a third generation ground-based detector)
could detect departures of <1% in the frequency of the dominant QNM mode of a
500 Msun black hole, out to a maximum range of 4 Gpc. In contrast, the New
Gravitational Observatory (NGO, an ESA space mission to detect gravitational
waves) can detect departures of ~ 0.1% in a 10^8 Msun black hole to a
luminosity distance of 30 Gpc (z = 3.5).
