TITLE: Is there a 0-1 law for the theory of groups?
QUESTION [67 upvotes]: Several months ago, Dominik asked the question Is there a 0-1 law for the theory of groups? on mathstackexchange, but although his question received attention there is still no answer. By asking the question here, I hope to find some result solving partially the problem or motivating a possible answer.
For convenience, I paste the complete question below.

For each first order sentence $\phi$ in the language of groups, define :
$$p_N(\phi)=\frac{\text{number of nonisomorphic groups $G$ of order} \le N\text{ such that } \phi \text{ is valid in } G}{\text{number of nonisomorphic groups of order} \le N}$$
Thus, $p_N(\phi)$ can be regarded as the probability that $\phi$ is valid in a randomly chosen group of order $\le N$.
Now define $$p(\phi)=\lim_{N \to \infty}p_N(\phi)$$
if this limit exists.
We say that the theory of groups fulfills a first order zero-one law if for every sentence $\phi$, $p(\phi)$ exists and equals either $0$ or $1$. I'm asking myself whether this 0-1 law holds indeed in group theory.
Since it is conjectured that "almost every group is a 2-group", statements like $\exists x: x\ne 1 \wedge x^2=1 \wedge \forall y:xy=yx$ (meaning $2|Z(G)$) or $\forall x: x^3=1 \to x=1$ (no element has order 3) should have probability $1$ and I don't see any possibility to construct any sentence with $p\not \in \{0,1\}$. Am I missing an obvious counterexample, or can you show (under the condition that almost every group is indeed a 2-group) that the theory of finite groups fulfills this 0-1 law?

REPLY [8 votes]: Here is a proposal for a possible sentence with probability that doesn't converge. Actually proving it should be hard, and I'm not sure how confident I should be in it but I thought I'd put it out there:
$$\exists_{w_1,w_2} \forall_{x_1, y_1, x_2, y_2} \exists_{z} \ w_1 z w_1^{-1} z^{-1} = x_1 y_1 x_1^{-1} y_1^{-1} \ \mbox{and} \  w_2 z w_2^{-1} z^{-1} = x_2 y_2 x_2^{-1} y_2^{-1} \quad (\ast)$$
As discussed in comments, it is thought that almost all groups are $2$-groups. The number of groups of order $p^n$ is $p^{(2/27) n^3 + O(n^{8/3})}$. (If we write $N = p^n$, this is $\exp ( (2/27) (\log N)^3/(\log p)^2 + \cdots)$, so $2$-groups overwhelm $p$ groups for other $p$.) This is a theorem of Sims. 
Let's understand where the $(2/27) n^3$ comes from. Look at central extensions
$$0 \to C_p^{n-r} \to G \to C_p^r \to 0.$$
If we look at isomorphism classes of extensions, this is classified by an $H^2$ group of dimension $f(r):= \binom{r}{2} (n-r) + r(n-r)$; Sims writes this down explicitly near the start of his paper. If we maximize $f(r)$ as a function of $r$, it is optimized at
$$r = \begin{cases} 2m & n=3m \\ 2m \ \mbox{and} \  2m+1 & n=3m+1 \\2m+1 & n=3m+2 \\ \end{cases}$$
and, at those values, it is $\approx (2/27) n^3$. Moreover, this maxima are sharply peaked: The value of $f(r)$ for any other $r$ is something like $n$ lower. So, if we were to choose $r$ in proportion to $\left| H^2(C_p^r, C_p^{n-r}) \right| = p^{f(r)}$, we would be choosing the values above with probability $1$.
In particular, if we were choosing $r$ in proportion to $|H^2|$, the probability that $r \geq 2(n-r)$ would approach $1$ for $n \equiv 0 \bmod 3$, would approach $1/2$ for $n \equiv 1 \bmod 3$ and would approach $0$ for $n \equiv 2 \bmod 3$.
For fixed $w_1$ and $w_2 \in C_p^r$, the map $z \mapsto (w_1 z w_1^{-1} z^{-1}, w_2 z w_2^{-1} z^{-1})$ gives a linear map $C_p^r \to C_p^{2(n-r)}$. So, if $r<2(n-r)$, then this map can't possibly be surjective and $(\ast)$ must fail. (Actually, it only fails if commutators generate $C_p^{n-r}$. That feels like a probability $1$ statement, but the issue should be checked.) On the other hand, if $r \geq 2(n-r)$, I see no reason that $(\ast)$ shouldn't be true.
This leaves two questions

In the model where we select $r$ proportional to $\left| H^2(C_p^r, C_p^{n-r}) \right|$ and then select a random extension, how likely is condition $(\ast)$ in the cases where $r \geq 2(n-r)$?
A much more difficult question: How close is the random $H^2$ model to the original question? Higman  and Sims prove some results along those lines, but they are very far from as strong as we'd want. Can we say heuristically whether we should expect the real situation to be as strongly peaked at a few values of $r$ as the toy model is?