TITLE: Counting  branched covers of the projective line and Spec Z
QUESTION [12 upvotes]: I've asked a question like this before, but now I'm more interested in counting the number of covers.
We suppose given the following data.

A positive integer  $d$ 
A finite set of closed points $B= ( b_1,\ldots,b_n )$ in $\mathbf{P}^1_\mathbf{C}$ 
Branch types $T_1,\ldots, T_n$.

Question. How many branched covers of $\mathbf{P}^1_\mathbf{C}$ exist which are branched only over $b_i$ (with branch type $T_i$ over each $b_i$)?
The answer lies within the Hurwitz number for $(T_1,\ldots,T_n)$. This translates the problem to combinatorial group theory.
Now, for my main question:
Q1. Can one ``count'' covers of $\textrm{Spec} \mathbf{Z}$ as above? That is, can one count the number of finite field extensions $$\mathbf{Q}\subset K$$ of given degree $d=[K:\mathbf{Q}]$ which are unramified outside a given set of prime numbers $p_1,\ldots,p_n$ with ramification types $T_1,\ldots,T_n$?
I know that one can use Minkowski's Geometry of Numbers to give some nontrivial bounds on the discriminant. Is this the best we can do?

REPLY [9 votes]: One thing to keep in mind is that the analogue of Spec Z is really P^1 over a finite field k, not P^1/C.  And here already one does not have a simple "Hurwitz-type formula" for the number of G-covers with given branching which are defined over k.
Just to give an example which may be illustrative; suppose that G = S_3, and you require that the inertia at the primes p_1, ... p_n is tame and maps to a transposition in G.  The extensions of Q of this kind are more or less in bijection with the etale Z/3Z covers of the quadratic field K = Q(sqrt(N)) where N = p_1....p_n.  (I am being careless about the real place here.)  In any event, to "count" the number of covers is in effect to compute the size of the 3-part of the class group of K.  There is not going to be a nice formula for this, and in particular it will depend unpredictably on the primes in question.  On the other hand, you can compute the average of this quantity over squarefree integers N, by Davenport-Heilbronn.
So I would say:
"No" to your Q1 as stated.
"Yes, for some choices of G," to your Q1 on average -- e.g. for G = S_3 (by Davenport-Heilbronn), for G = D_4 (Cohen-Diaz y Diaz-Olivier), for G = S_4, S_5 (by Bhargava, though perhaps some slight and presumably true refinement of Bhargava to squarefree discriminants is needed), for G = D_p when K is F_ell(T) by work of myself, Venkatesh and Westerland.