  We introduce the first provably efficient algorithm to check if a finitely
generated subgroup of an almost simple semi-simple group over the rationals is
Zariski-dense. We reduce this question to one of computing Galois groups, and
to this end we describe efficient algorithms to check if the Galois group of a
polynomial $p$ with integer coefficients is "generic" (which, for arbitrary
polynomials of degree $n$ means the full symmetric group $S_n,$ while for
reciprocal polynomials of degree $2n$ it means the hyperoctahedral group $C_2
\wr S_n.$). We give efficient algorithms to verify that a polynomial has Galois
group $S_n,$ and that a reciprocal polynomial has Galois group $C_2 \wr S_n.$
We show how these algorithms give efficient algorithms to check if a set of
matrices $\mathcal{G}$ in $\mathop{SL}(n, \mathbb{Z})$ or $\mathop{Sp}(2n,
\mathbb{Z})$ generate a \emph{Zariski dense} subgroup.
  The complexity of doing this in$\mathop{SL}(n, \mathbb{Z})$ is of order
$O(n^4 \log n \log \|\mathcal{G}\|)\log \epsilon$ and in $\mathop{Sp}(2n,
\mathbb{Z})$ the complexity is of order $O(n^8 \log n\log \|\mathcal{G}\|)\log
\epsilon$ In general semisimple groups we show that Zariski density can be
confirmed or denied in time of order $O(n^14 \log \|\mathcal{G}\|\log
\epsilon),$ where $\epsilon$ is the probability of a wrong "NO" answer, while
$\|\mathcal{G}\|$ is the measure of complexity of the input (the maximum of the
Frobenius norms of the generating matrices). The algorithms work essentially
without change over algebraic number fields, and in other semi-simple groups.
However, we restrict to the case of the special linear and symplectic groups
and rational coefficients in the interest of clarity.
