  This paper analyses the following question: let $\mathbf{A}_j$, $j=1,2,$ be
the Galerkin matrices corresponding to finite-element discretisations of the
exterior Dirichlet problem for the heterogeneous Helmholtz equations
$\nabla\cdot (A_j \nabla u_j) + k^2 n_j u_j= -f$. How small must $\|A_1
-A_2\|_{L^q}$ and $\|{n_1} - {n_2}\|_{L^q}$ be (in terms of $k$-dependence) for
GMRES applied to either $(\mathbf{A}_1)^{-1}\mathbf{A}_2$ or
$\mathbf{A}_2(\mathbf{A}_1)^{-1}$ to converge in a $k$-independent number of
iterations for arbitrarily large $k$? (In other words, for $\mathbf{A}_1$ to be
a good left- or right-preconditioner for $\mathbf{A}_2$?). We prove results
answering this question, give theoretical evidence for their sharpness, and
give numerical experiments supporting the estimates.
  Our motivation for tackling this question comes from calculating quantities
of interest for the Helmholtz equation with random coefficients $A$ and $n$.
Such a calculation may require the solution of many deterministic Helmholtz
problems, each with different $A$ and $n$, and the answer to the question above
dictates to what extent a previously-calculated inverse of one of the Galerkin
matrices can be used as a preconditioner for other Galerkin matrices.
