Randomized black-box group algorithm for fixed-class nilpotency testing

Facts

 * Fixed-class tuple fraction is bounded away from one for groups not of that class

Idea and outline
The idea is simple: pick a random tuple of elements $$x_1,x_2,\dots,x_{c+1} \in G$$ and compute the left-normed iterated commutator $$\dots [x_1,x_2],\dots,x_c],x_{c+1}]$. If $G$ has class at most $c$, this equals the identity element. Otherwise, by the fact that [[fixed-class tuple fraction is bounded away from one for groups not of that class, the probability of this being equal to the identity element is at most $$1 - (3/2^{c+2})$$.

If the test is done $$r$$ times, the probability that a group not of class at most $$c$$ will fool the test all times is at most:

$$\left( 1 - \frac{3}{2^{c+2}}\right)^r$$

If we want to bring this probability down to less than a given number $$\alpha$$, choose $$r$$ greater than:

$$\frac{\ln \alpha}{\ln\left( 1 - \frac{3}{2^{c+2}}\right)}$$

Analysis of running time
Each step involves a selection of random elements, which, due to lookup and recording costs, takes $$O(c \log_2N)$$ time. Then, it involves the group multiplication and equality checking, done $$O(c)$$ times.

The number of steps that we need to perform depends on $$c$$. As noted above, if we want an error probability of at most $$\alpha$$, we need to choose the number of times as:

$$\frac{\ln \alpha}{\ln\left( 1 - \frac{3}{2^{c+2}}\right)}$$

This is $$O(2^c)$$.