Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
License: CC BY 4.0
arXiv:2401.09218v1 [math.GR] 17 Jan 2024

Complexity of some algorithmic problems in groups:
a survey

Vladimir Shpilrain Department of Mathematics, The City College of New York, New York, NY 10031 shpilrain@yahoo.com
Abstract.

In this survey, we address the worst-case, average-case, and generic-case time complexity of the word problem and some other algorithmic problems in several classes of groups and show that it is often the case that the average-case complexity of the word problem is linear with respect to the length of an input word, which is as good as it gets if one considers groups given by generators and defining relations. At the same time, there are other natural algorithmic problems, for instance, the geodesic (decision) problem or Whitehead’s automorphism problem, where the average-case time complexity can be sublinear, even constant.

1. Introduction

Algorithmic problems for infinite groups have received a lot of attention over the last 100+ years, since Dehn’s work back in 1911. More recently, with the increasing interest in computational complexity, many algorithmic problems of group theory have been reexamined with regard to efficiency.

The worst-case complexity of group-theoretic algorithms has been studied probably since small cancellation groups were introduced and it was noticed that the word problem in these groups admits an efficient solution by Dehn’s algorithm, see e.g. [26]. Time complexity of Dehn’s algorithm was eventually shown to be linear (with respect to the “length” of the input). The interest in complexity of group-theoretic algorithms was afterwards gradually increasing over the rest of the 20th century, and then experienced explosive growth in the 21st century, in part due to input from theoretical computer science (notably the Knuth-Morris-Pratt algorithm and the Master theorem for divide-and-conquer recurrences), and in part due to the introduction of the generic-case and the average-case complexity into group theory about 20 years ago.

Genericity of group-theoretic properties and generic-case complexity of group-theoretic algorithms were introduced in [2] and [19]. Average-case complexity, formally introduced in [24] (although informally considered before in [23]), was addressed in the context of group theory for the first time in [20]. Specifically, the authors of [20] addressed the average-case complexity of the word and subgroup membership problems in non-amenable groups and showed that this complexity was often linear. The fact that the considered groups were non-amenable played an essential role in computing the average-case complexity due to the fact that the cogrowth rate of any non-amenable group is strictly smaller than the growth rate of the ambient free group, see [11], [12]. In contrast, most groups considered in a recent paper [32] are amenable. The case of amenable groups is more difficult; general tricks of [20] are not applicable in this case, and one has to actually investigate the structure of groups in question.

There are several ways to define the average-case time complexity of a group-theoretic algorithm 𝒜𝒜\mathcal{A}caligraphic_A that takes words as inputs; below is one of the natural ways. Let Wnsubscript𝑊𝑛W_{n}italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT denote the set of all words of length n𝑛nitalic_n in a finite group alphabet. For a word wWn𝑤subscript𝑊𝑛w\in W_{n}italic_w ∈ italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT, let T(w)𝑇𝑤T(w)italic_T ( italic_w ) denote the time that the algorithm 𝒜𝒜\mathcal{A}caligraphic_A (for a classical Turing machine) works on input w𝑤witalic_w.

One can then define the average-case time complexity of the algorithm 𝒜𝒜\mathcal{A}caligraphic_A on inputs of length n𝑛nitalic_n as

(1) 1|Wn|wWnT(w).1subscript𝑊𝑛subscript𝑤subscript𝑊𝑛𝑇𝑤\frac{1}{|W_{n}|}\sum_{w\in W_{n}}T(w).divide start_ARG 1 end_ARG start_ARG | italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT | end_ARG ∑ start_POSTSUBSCRIPT italic_w ∈ italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT end_POSTSUBSCRIPT italic_T ( italic_w ) .

1.1. Why the average-case complexity is often strictly lower than the worst-case complexity

On the intuitive level, the reason is that inputs wWn𝑤subscript𝑊𝑛w\in W_{n}italic_w ∈ italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT for which T(w)𝑇𝑤T(w)italic_T ( italic_w ) is high are “sparse”. If one is able to quantify this “sparsity”, then one can try to split Wnsubscript𝑊𝑛W_{n}italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT in a disjoint union Wn=jVn(j)subscript𝑊𝑛subscript𝑗superscriptsubscript𝑉𝑛𝑗W_{n}=\cup_{j}V_{n}^{(j)}italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = ∪ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT of sets Vn(j)superscriptsubscript𝑉𝑛𝑗V_{n}^{(j)}italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT, so that the formula (1) is stratified as

(2) 1|Wn|j|Vn(j)|T(wVn(j))=j|Vn(j)||Wn|T(wVn(j)).1subscript𝑊𝑛subscript𝑗superscriptsubscript𝑉𝑛𝑗𝑇𝑤superscriptsubscript𝑉𝑛𝑗subscript𝑗superscriptsubscript𝑉𝑛𝑗subscript𝑊𝑛𝑇𝑤superscriptsubscript𝑉𝑛𝑗\frac{1}{|W_{n}|}\sum_{j}|V_{n}^{(j)}|\cdot T(w\in V_{n}^{(j)})=\sum_{j}\frac{% |V_{n}^{(j)}|}{|W_{n}|}\cdot T(w\in V_{n}^{(j)}).divide start_ARG 1 end_ARG start_ARG | italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT | end_ARG ∑ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT | italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT | ⋅ italic_T ( italic_w ∈ italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT ) = ∑ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT divide start_ARG | italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT | end_ARG start_ARG | italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT | end_ARG ⋅ italic_T ( italic_w ∈ italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT ) .

This formula is not very practical though because the number of summands may be too large. Keeping in mind that our goal is typically reduced to finding an upper bound for the average-case complexity rather than its precise value, we will use a slightly different stratification that is more practical. Denote by T¯(wVn(j))¯𝑇𝑤superscriptsubscript𝑉𝑛𝑗\overline{T}(w\in V_{n}^{(j)})over¯ start_ARG italic_T end_ARG ( italic_w ∈ italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT ) an upper bound on T(w)𝑇𝑤T(w)italic_T ( italic_w ) for wVn(j)𝑤superscriptsubscript𝑉𝑛𝑗w\in V_{n}^{(j)}italic_w ∈ italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT and use the following sum instead of (2):

(3) j|Vn(j)||Wn|T¯(wVn(j)).subscript𝑗superscriptsubscript𝑉𝑛𝑗subscript𝑊𝑛¯𝑇𝑤superscriptsubscript𝑉𝑛𝑗\sum_{j}\frac{|V_{n}^{(j)}|}{|W_{n}|}\cdot\overline{T}(w\in V_{n}^{(j)}).∑ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT divide start_ARG | italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT | end_ARG start_ARG | italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT | end_ARG ⋅ over¯ start_ARG italic_T end_ARG ( italic_w ∈ italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT ) .

In this sum, the number of summands can be rather small (typically 2 or 3, although it can be larger in some cases), depending on an upper bound on the average-case complexity one would like to establish.

Thus, our strategy will be to find suitable upper bounds on |Vn(j)||Wn|superscriptsubscript𝑉𝑛𝑗subscript𝑊𝑛\frac{|V_{n}^{(j)}|}{|W_{n}|}divide start_ARG | italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT | end_ARG start_ARG | italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT | end_ARG for those Vn(j)superscriptsubscript𝑉𝑛𝑗V_{n}^{(j)}italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT where T¯(wVn(j))¯𝑇𝑤superscriptsubscript𝑉𝑛𝑗\overline{T}(w\in V_{n}^{(j)})over¯ start_ARG italic_T end_ARG ( italic_w ∈ italic_V start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ( italic_j ) end_POSTSUPERSCRIPT ) is high.

An alternative strategy (used in [20] and in [39], say) is, for a given input, to run two algorithms in parallel. One algorithm, call it honest, always terminates in finite time and gives a correct result. The other algorithm, a Las Vegas algorithm, is a fast randomized algorithm that never gives an incorrect result; that is, it either produces the correct result or informs about the failure to obtain any result. (In contrast, a Monte Carlo algorithm is a randomized algorithm whose output may be incorrect with some (typically small) probability.)

A Las Vegas algorithm can improve the time complexity of an honest, “hard-working”, algorithm that always gives a correct answer but is slow. Specifically, by running a fast Las Vegas algorithm and a slow honest algorithm in parallel, one often gets an algorithm that always terminates with a correct answer and whose average-case complexity is somewhere in between. This idea was used in [20] where it was shown, in particular, that if a group G𝐺Gitalic_G has the word problem solvable in subexponential time and if G𝐺Gitalic_G has a non-amenable factor group where the word problem is solvable in a complexity class 𝒞𝒞\mathcal{C}caligraphic_C, then there is an honest algorithm that solves the word problem in G𝐺Gitalic_G with average-case complexity in 𝒞𝒞\mathcal{C}caligraphic_C.

2. Background

Bibliography on the worst-case complexity of various group-theoretic problems (the word problem, conjugacy problem, subgroup membership problem, geodesic problem, equations in groups) includes hundreds of papers, so a survey on those would take a hefty monograph. Perhaps just as a few milestones, we can mention here papers [5], [6], [28], [33], [37] and the monograph [25].

The shift of the interest, in the last 20 years or so, from the worst-case to the generic-case and average-case complexity is in part due to applications of non-abelian groups in information security, see [29], [30], [17], [18] and, more generally, due to emerging connections between group theory and theoretical computer science (see e.g. [3] for a general overview).

Some ideas in the spirit of the average-complexity in group theory were actually put forward by Gromov in his essay [13]. Specifically, he proposed to consider the averaged Dehn function instead of the usual Dehn function and suggested that the former might be asymptotically smaller than the latter. Relevance of the averaged Dehn function to the average-case complexity of the word problem was pointed out by Young [46]: the averaged Dehn function represents the complexity of verifying that an element of a group represents the identity, while the technique of [20] established low average-case complexity in many (non-amenable) groups by showing that in those groups, most elements are not the identity.

We also mention here an earlier paper by Wang [43] with “average-case complexity” in the title. However, Wang’s approach is very different in substance: in his approach the set of instances of a problem involves all finite presentations of a group, rather than just a fixed one.

Below we first briefly survey the approach of [20] applicable to non-amenable groups, and then focus on a more difficult case of amenable groups.

2.1. Non-amenable groups

The basic idea of [20] is very straightforward and is often used in practice. If we have a total algorithm Ω1subscriptΩ1\Omega_{1}roman_Ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT solving a decision problem 𝒟𝒟\mathcal{D}caligraphic_D whose worst-case complexity is “not too high” and we also have a partial algorithm Ω2subscriptΩ2\Omega_{2}roman_Ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT solving the problem with “very low” generic-case complexity, then by running Ω1subscriptΩ1\Omega_{1}roman_Ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT and Ω2subscriptΩ2\Omega_{2}roman_Ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT in parallel we get a total algorithm Ω1||Ω2\Omega_{1}||\Omega_{2}roman_Ω start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT | | roman_Ω start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT for which we can often prove to have low average-case complexity.

To formalize this idea, let us start with a definition. Below X*superscript𝑋X^{*}italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT denotes the set of all group words in the alphabet X𝑋Xitalic_X.

Definition 1.

Let X𝑋Xitalic_X be a finite alphabet with k2𝑘2k\geq 2italic_k ≥ 2 elements. A discrete probability measure on X*superscript𝑋X^{*}italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT is a function μ:X*[0,1]normal-:𝜇normal-→superscript𝑋01\mu:X^{*}\to[0,1]italic_μ : italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT → [ 0 , 1 ] such that wX*μ(w)=1subscript𝑤superscript𝑋𝜇𝑤1\sum_{w\in X^{*}}\mu(w)=1∑ start_POSTSUBSCRIPT italic_w ∈ italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT end_POSTSUBSCRIPT italic_μ ( italic_w ) = 1.

We say that μ𝜇\muitalic_μ is length-invariant if for any words w,wX*𝑤superscript𝑤normal-′superscript𝑋w,w^{\prime}\in X^{*}italic_w , italic_w start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ∈ italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT with |w|=|w|𝑤superscript𝑤normal-′|w|=|w^{\prime}|| italic_w | = | italic_w start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT | we have μ(w)=μ(w)𝜇𝑤𝜇superscript𝑤normal-′\mu(w)=\mu(w^{\prime})italic_μ ( italic_w ) = italic_μ ( italic_w start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ).

We say that a measure μ:X*[0,1]normal-:𝜇normal-→superscript𝑋01\mu:X^{*}\to[0,1]italic_μ : italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT → [ 0 , 1 ] is tame if there exists a subexponential function g(n)0𝑔𝑛0g(n)\geq 0italic_g ( italic_n ) ≥ 0 such that for any wX*𝑤superscript𝑋w\in X^{*}italic_w ∈ italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT we have μ(w)g(|w|)k|w|𝜇𝑤𝑔𝑤superscript𝑘𝑤\mu(w)\leq\frac{g(|w|)}{k^{|w|}}italic_μ ( italic_w ) ≤ divide start_ARG italic_g ( | italic_w | ) end_ARG start_ARG italic_k start_POSTSUPERSCRIPT | italic_w | end_POSTSUPERSCRIPT end_ARG.

Then the main result of [20] is

Theorem 2.1.

Let G𝐺Gitalic_G be a finitely presented group where the word problem is in 𝒮ubExp𝒮𝑢𝑏𝐸𝑥𝑝\mathcal{S}ubExpcaligraphic_S italic_u italic_b italic_E italic_x italic_p (i.e., is solvable in subexponential time). Suppose G𝐺Gitalic_G has a subgroup of finite index which has a non-amenable quotient group G¯1subscriptnormal-¯𝐺1\overline{G}_{1}over¯ start_ARG italic_G end_ARG start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT whose word problem is solvable in a complexity class 𝒞𝒞\mathcal{C}caligraphic_C, where 𝒞𝒮ubExp𝒞𝒮𝑢𝑏𝐸𝑥𝑝\mathcal{C}\subseteq\mathcal{S}ubExpcaligraphic_C ⊆ caligraphic_S italic_u italic_b italic_E italic_x italic_p.

Then the word problem in G𝐺Gitalic_G is solvable with average-case complexity in 𝒞𝒞\mathcal{C}caligraphic_C, uniformly relative to the family of all length-invariant discrete probability measures μ:X*[0,1]normal-:𝜇normal-→superscript𝑋01\mu:X^{*}\to[0,1]italic_μ : italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT → [ 0 , 1 ].

Moreover, for any tame discrete probability measure μ𝜇\muitalic_μ on X*superscript𝑋X^{*}italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT the word problem in G𝐺Gitalic_G is solvable with average-case complexity in 𝒞𝒞\mathcal{C}caligraphic_C relative to μ𝜇\muitalic_μ.

Theorem 2.1 applies to a surprisingly wide range of examples, although the idea behind the proof of this theorem is quite simple. We run in parallel the total subexponential algorithm for the word problem of G𝐺Gitalic_G and the partial generic algorithm provided by the quotient group G¯1subscript¯𝐺1\overline{G}_{1}over¯ start_ARG italic_G end_ARG start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT. If the image of an element of g𝑔gitalic_g is nontrivial in G¯1subscript¯𝐺1\overline{G}_{1}over¯ start_ARG italic_G end_ARG start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT, then the element g𝑔gitalic_g is obviously nontrivial in G𝐺Gitalic_G. On all but an exponentially negligible set of inputs this partial algorithm will actually terminate within the complexity bound 𝒞𝒞\mathcal{C}caligraphic_C and it turns out that the average-case complexity of the combined algorithm is in 𝒞𝒞\mathcal{C}caligraphic_C.

Below are some more concrete corollaries of Theorem 2.1.

Corollary 1.

Let G𝐺Gitalic_G be a finitely presented group where the word problem is solvable in subexponential time. Let A𝐴Aitalic_A be a generating set of G𝐺Gitalic_G and let X=AA1𝑋𝐴superscript𝐴1X=A\cup A^{-1}italic_X = italic_A ∪ italic_A start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT. Let \Reroman_ℜ be the family of all length-invariant discrete probability measures μ:X*[0,1]normal-:𝜇normal-→superscript𝑋01\mu:X^{*}\to[0,1]italic_μ : italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT → [ 0 , 1 ].

  1. (1)

    Suppose that G𝐺Gitalic_G has a subgroup of finite index that has a non-elementary word-hyperbolic quotient group. Then the word problem in G𝐺Gitalic_G is solvable with linear time average-case complexity uniformly relative to \Reroman_ℜ.

    Moreover, for any tame discrete probability measure μ𝜇\muitalic_μ on X*superscript𝑋X^{*}italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT the word problem in G𝐺Gitalic_G is solvable with linear time average-case complexity relative to μ𝜇\muitalic_μ.

  2. (2)

    Suppose that G𝐺Gitalic_G has a subgroup of finite index that has a non-amenable automatic quotient group. Then the word problem in G𝐺Gitalic_G is solvable with quadratic time average-case complexity uniformly relative to \Reroman_ℜ.

    Moreover, for any tame discrete probability measure μ𝜇\muitalic_μ on X*superscript𝑋X^{*}italic_X start_POSTSUPERSCRIPT * end_POSTSUPERSCRIPT the word problem in G𝐺Gitalic_G is solvable with quadratic time average-case complexity relative to μ𝜇\muitalic_μ.

This corollary applies, in particular, to braid groups Bnsubscript𝐵𝑛B_{n}italic_B start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT since Bnsubscript𝐵𝑛B_{n}italic_B start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT has a subgroup of finite index, the pure braid group Pnsubscript𝑃𝑛P_{n}italic_P start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT, that admits a homomorphism onto the free group F2subscript𝐹2F_{2}italic_F start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT. Since the word problem for Bnsubscript𝐵𝑛B_{n}italic_B start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT is solvable in quadratic time (see e.g. [6]), Corollary 1 implies that the word problem in Bnsubscript𝐵𝑛B_{n}italic_B start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT has linear time average-case complexity.

Another application is to Artin groups of extra large type. An Artin group G𝐺Gitalic_G has a presentation

G=a1,,at|uij=uji, for 1i<jtG=\langle a_{1},\dots,a_{t}\,|u_{ij}=u_{ji},\text{ for }1\leq i<j\leq t\rangleitalic_G = ⟨ italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT | italic_u start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT = italic_u start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT , for 1 ≤ italic_i < italic_j ≤ italic_t ⟩

where for ij𝑖𝑗i\neq jitalic_i ≠ italic_j

uij:=aiajaimij terms assignsubscript𝑢𝑖𝑗subscriptsubscript𝑎𝑖subscript𝑎𝑗subscript𝑎𝑖subscript𝑚𝑖𝑗 terms u_{ij}:=\underbrace{a_{i}a_{j}a_{i}\dots}_{m_{ij}\text{ terms }}italic_u start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT := under⏟ start_ARG italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT … end_ARG start_POSTSUBSCRIPT italic_m start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT terms end_POSTSUBSCRIPT

and where mij=mjisubscript𝑚𝑖𝑗subscript𝑚𝑗𝑖m_{ij}=m_{ji}italic_m start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT = italic_m start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT for each i<j𝑖𝑗i<jitalic_i < italic_j. We allow mij=subscript𝑚𝑖𝑗m_{ij}=\inftyitalic_m start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT = ∞ in which case the relation uij=ujisubscript𝑢𝑖𝑗subscript𝑢𝑗𝑖u_{ij}=u_{ji}italic_u start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT = italic_u start_POSTSUBSCRIPT italic_j italic_i end_POSTSUBSCRIPT is omitted from the above presentation. G𝐺Gitalic_G is of extra large type if t3𝑡3t\geq 3italic_t ≥ 3 and all mij4subscript𝑚𝑖𝑗4m_{ij}\geq 4italic_m start_POSTSUBSCRIPT italic_i italic_j end_POSTSUBSCRIPT ≥ 4. Peifer [34] proved that all such groups are automatic and therefore have the word problem solvable in quadratic time. An Artin group G𝐺Gitalic_G has an associated Coxeter group G1subscript𝐺1G_{1}italic_G start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT which is the quotient group obtained by setting the squares of the generators aisubscript𝑎𝑖a_{i}italic_a start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT equal to the identity. If G𝐺Gitalic_G is of extra large type then so is its Coxeter quotient

G1=G/nclG(a12,,at2).subscript𝐺1𝐺𝑛𝑐subscript𝑙𝐺superscriptsubscript𝑎12superscriptsubscript𝑎𝑡2G_{1}=G/ncl_{G}(a_{1}^{2},\dots,a_{t}^{2}).italic_G start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT = italic_G / italic_n italic_c italic_l start_POSTSUBSCRIPT italic_G end_POSTSUBSCRIPT ( italic_a start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT , … , italic_a start_POSTSUBSCRIPT italic_t end_POSTSUBSCRIPT start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) .

This G1subscript𝐺1G_{1}italic_G start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT is known to be a nonelementary word-hyperbolic group if t>2𝑡2t>2italic_t > 2. Thus, by Corollary 1, the word problem in any Artin group G𝐺Gitalic_G of extra large type is solvable in linear time on average.

2.2. Amenable groups

For amenable groups, the trick used in the proof of Theorem 2.1 may not work, as we have explained in the Introduction. Below we mention several results obtained by using different approaches.

In [32], it was shown that in several classes of (amenable) groups, as well as in a large class of groups that are free products, the average-case complexity of the word problem is linear. More specifically, the following results were established:

  • 1.

    The average-case time complexity of the word problem in groups of matrices over integers (or rationals) is often linear; in particular, this is the case in all polycyclic groups. These results apply, in particular, to finitely generated nilpotent groups. It is also noteworthy that the worst-case complexity of the word problem in these groups is O(nlog2n)𝑂𝑛superscript2𝑛O(n\cdot\log^{2}n)italic_O ( italic_n ⋅ roman_log start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_n ), where n𝑛nitalic_n is the length of the input (as a word in the generating matrices). The proof uses a recent result [15] on fast multiplication of integers.

    For finitely generated nilpotent groups, the worst-case time complexity of the word problem is, in fact, O(nlog(k)n)𝑂𝑛superscript𝑘𝑛O(n\cdot\log^{(k)}n)italic_O ( italic_n ⋅ roman_log start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT italic_n ) for any integer k1𝑘1k\geq 1italic_k ≥ 1, where log(k)nsuperscript𝑘𝑛\log^{(k)}nroman_log start_POSTSUPERSCRIPT ( italic_k ) end_POSTSUPERSCRIPT italic_n denotes the function loglogn𝑛\log\ldots\log nroman_log … roman_log italic_n, with k𝑘kitalic_k logarithms.

  • 2.

    If a finitely generated group G𝐺Gitalic_G has polynomial-time worst-case complexity of the word problem and maps onto a (generalized) lamplighter group (the wreath product of psubscript𝑝\mathbb{Z}_{p}blackboard_Z start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT and \mathbb{Z}blackboard_Z), then the average-case time complexity of the word problem in G𝐺Gitalic_G is linear. This applies, in particular, to free solvable groups.

  • 3.

    In popular groups like solvable Baumslag-Solitar groups BS(1,n)𝐵𝑆1𝑛BS(1,n)italic_B italic_S ( 1 , italic_n ) and Thompson’s group F𝐹Fitalic_F, the average-case time complexity of the word problem is linear.

    We recall that the group BS(1,n)𝐵𝑆1𝑛BS(1,n)italic_B italic_S ( 1 , italic_n ) has a presentation BS(1,n)=a,b|bab1=an.𝐵𝑆1𝑛inner-product𝑎𝑏𝑏𝑎superscript𝑏1superscript𝑎𝑛BS(1,n)=\langle a,b\,|\,bab^{-1}=a^{n}\rangle.italic_B italic_S ( 1 , italic_n ) = ⟨ italic_a , italic_b | italic_b italic_a italic_b start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT = italic_a start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ⟩ . We also note, in passing, that it is a major open problem whether or not Thompson’s group F𝐹Fitalic_F is amenable, see [14] for a survey of work done on this problem.

  • 4.

    If a finitely generated group G𝐺Gitalic_G is a free product of nontrivial groups A𝐴Aitalic_A and B𝐵Bitalic_B, both having polynomial-time worst-case complexity of the word problem, then G𝐺Gitalic_G has linear average-case time complexity of the word problem.

  • 5.

    If a finitely generated group G𝐺Gitalic_G is a free product of nontrivial groups A𝐴Aitalic_A and B𝐵Bitalic_B, both having polynomial-time worst-case time complexity of the subgroup membership problem, then G𝐺Gitalic_G has linear average-case time complexity of the subgroup membership problem. All subgroups in question should be finitely generated.

We also mention that the problem in some sense dual to finding the average-case complexity of the word problem in a given group G𝐺Gitalic_G is finding “non-cooperative” words w𝑤witalic_w for which deciding whether or not w=1𝑤1w=1italic_w = 1 in G𝐺Gitalic_G is as computationally hard as it gets; these words are “responsible” for a high worst-case complexity of the word problem in G𝐺Gitalic_G. This is relevant to properties of the Dehn function of G𝐺Gitalic_G, see e.g. [5], [31], [46] and references therein.

The word and subgroup membership problems are not the only group-theoretic problems whose average-case complexity can be significantly lower than the worst-case complexity. In [39], we showed that the average-case complexity of the problem of detecting a primitive element in a free group has constant time complexity (with respect to the length of the input) if the input is a cyclically reduced word. The same idea was later used in [36] to design an algorithm, with constant average-case complexity, for detecting relatively primitive elements, i.e., elements that are primitive in a given subgroup of a free group.

3. Directions of research

In this section, we mention several interesting (in our opinion) problems relevant to the average-case time complexity of the word problem in several classes of groups. We emphasize that it is often the case that the average-case complexity of the word problem is linear with respect to the length of an input word, which is as good as it gets if one considers groups given by generators and defining relations, see e.g. [38].

With some other problems, e.g. the geodesic (decision) problem, it can be the case for some groups that the average-case complexity is sublinear, even constant.

More specifically, we suggest the following directions of research. Some of them come from the “Open problems” section of [32].

Direction 1. Prove that the average-case time complexity of the word problem in any finitely generated metabelian group is linear.

We note that in [22], the authors showed that there are finitely generated solvable groups of derived length 3 (even residually finite ones) with super-exponential worst-case complexity of the word problem. The average-case time complexity of the word problem in such groups cannot be polynomial since the super-exponential runtime, even on a very small set of words, will dominate everything else.

With metabelian groups, the situation is different since it is known that, unlike in solvable groups of derived length 3absent3\geq 3≥ 3 [21], the word problem in any finitely presented metabelian group is solvable. This follows from the fact that these groups are residually finite, but the first explicit algorithm was offered in [42].

The question of the worst-case complexity of the word problem in metabelian groups is a problem of independent interest that would have to addressed along the way. Here we just note that the worst-case complexity of the word problem in a finitely generated free metabelian groups was shown to be O(nlogn)𝑂𝑛𝑛O(n\log n)italic_O ( italic_n roman_log italic_n ), i.e., it is quasilinear in the length n𝑛nitalic_n of the input [28].

Direction 2. Prove that the average-case time complexity of the word problem in any finitely generated group of matrices over \mathbb{Q}blackboard_Q is linear.

This is a natural direction prompted by the results of [32] about complexity of the word problem in matrix groups mentioned in Section 2 of this survey.

We also note that attacking this problem will probably involve estimating the generic-case complexity of matrix multiplication. Since the latter is a problem of independent interest, we single it out as Direction 5 below.

Direction 3. Let G𝐺Gitalic_G be a finitely generated (or even a finitely presented) group where the average-case time complexity of the word problem is linear. We plan to address the following question: is it necessarily the case that the generic-case time complexity (i.e., complexity on “most” inputs) of the word problem in G𝐺Gitalic_G is linear, too?

We note that the converse is not true, see the comment to the Direction 1 above. We also note that if the sums in the formula (1) are bounded by a linear function of n𝑛nitalic_n, then for any superlinear function f(n)𝑓𝑛f(n)italic_f ( italic_n ) the densities of subsets of G𝐺Gitalic_G where T(w)>f(n)𝑇𝑤𝑓𝑛T(w)>f(n)italic_T ( italic_w ) > italic_f ( italic_n ) (for wWn𝑤subscript𝑊𝑛w\in W_{n}italic_w ∈ italic_W start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT) are approaching 0 when n𝑛nitalic_n goes to infinity. This means that if the average-case time complexity of the word problem in G𝐺Gitalic_G is linear, then the generic-case time complexity of the word problem in G𝐺Gitalic_G can be bounded by any superlinear function.

A similar argument shows that if the average-case time complexity of the word problem in G𝐺Gitalic_G is polynomial, then the generic-case time complexity of the word problem in G𝐺Gitalic_G is polynomial, too, although the degree of a polynomial may be a little higher. More accurately, if the average-case complexity is O(nd)𝑂superscript𝑛𝑑O(n^{d})italic_O ( italic_n start_POSTSUPERSCRIPT italic_d end_POSTSUPERSCRIPT ), then the generic-case complexity is O(nd+ε)𝑂superscript𝑛𝑑𝜀O(n^{d+\varepsilon})italic_O ( italic_n start_POSTSUPERSCRIPT italic_d + italic_ε end_POSTSUPERSCRIPT ) for any ε>0𝜀0\varepsilon>0italic_ε > 0.

Another implication that we can mention in this context is that the exponential time average-case time complexity of the word problem in G𝐺Gitalic_G implies the exponential time (as opposed to super-exponential time) worst-case complexity of the word problem in G𝐺Gitalic_G. This is because super-exponential complexity of the word problem even on just a single input will dominate everything else, so the average-case complexity would be super-exponential as well.

Direction 4. This direction is somewhat informal. Prompted by a result of [39] mentioned at the end of Section 1, look for other algorithmic problems where the result of [10] on exponentially negligible proportion of words with “forbidden subwords” can lead to the constant-time average-case complexity.

One way to generalize the result of [39] about fast (on average) detection of primitive elements of a free group Frsubscript𝐹𝑟F_{r}italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT would be finding other “orbit-blocking” words, see [4, Problem (F40)]. In case that problem has a positive answer for a particular word u𝑢uitalic_u, the following restricted version of Whitehead’s automorphism problem will have constant-time average-case complexity (with respect to the length of the input word v𝑣vitalic_v): given a cyclically reduced word v𝑣vitalic_v, find out if v=α(u)𝑣𝛼𝑢v=\alpha(u)italic_v = italic_α ( italic_u ) for some αAut(Fr)𝛼𝐴𝑢𝑡subscript𝐹𝑟\alpha\in Aut(F_{r})italic_α ∈ italic_A italic_u italic_t ( italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT ).

Another problems of that kind is the geodesic (decision) problem: given a finitely presented group G𝐺Gitalic_G and a word w𝑤witalic_w in the generators of G𝐺Gitalic_G, find out whether or not there is a shorter word that represents the same element of G𝐺Gitalic_G. “Forbidden subwords” in this case are subwords of w𝑤witalic_w that are longer subwords of defining relators of G𝐺Gitalic_G. By a “longer subword” of r𝑟ritalic_r we mean a subword whose length is more than half of the length of r𝑟ritalic_r (in particular, any defining relator is such a “forbidden subword”). If w𝑤witalic_w has such a subword, then w𝑤witalic_w is not a geodesic word.

Based on this simple observation, one can show, in particular, that the average-case time complexity of the geodesic problem in any hyperbolic group is constant (with respect to the length of the input word). This is because the worst-case time complexity of this problem in any hyperbolic group is at most quadratic. In fact, if the geodesic (decision) problem in a group G𝐺Gitalic_G is solvable in subexponential time in the worst case, then the average-case complexity of this problem in G𝐺Gitalic_G is linear-time.

One can look for other algorithmic problems where the presence of “forbidden subwords” can quickly lead to a decision, and then use this to bound the average-case complexity.

Direction 5. This direction is relevant to Direction 2, but is also of independent interest because of connections to Cayley hash functions, see [8]. More specifically, it is relevant to a well-known problem of estimating the girth of the Cayley graph of some special 2-generator groups of matrices over psubscript𝑝\mathbb{Z}_{p}blackboard_Z start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT; the latter problem has received a lot of attention over the last 15 years or so, see e.g. [1], [7], [8], [16].

The problem to consider here is as follows. Let A𝐴Aitalic_A and B𝐵Bitalic_B be 2×2222\times 22 × 2 matrices over \mathbb{Z}blackboard_Z that generate a free group. Let w(A,B)𝑤𝐴𝐵w(A,B)italic_w ( italic_A , italic_B ) be a freely reduced (semi)group word of length n𝑛nitalic_n. After evaluating w(A,B)𝑤𝐴𝐵w(A,B)italic_w ( italic_A , italic_B ) as a product of matrices, we get a 2×2222\times 22 × 2 matrix, call it W𝑊Witalic_W. What is the largest (by the absolute value) possible entry of W𝑊Witalic_W, over all w(A,B)𝑤𝐴𝐵w(A,B)italic_w ( italic_A , italic_B ) of length n𝑛nitalic_n, as a function of n𝑛nitalic_n? The latter function is usually (although not always) exponential, so we are looking for an answer in the form O(sn)𝑂superscript𝑠𝑛O(s^{n})italic_O ( italic_s start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ), i.e., we are looking for the base s𝑠sitalic_s of the exponent.

The relevance of this problem to the problem of estimating the girth of the Cayley graph of 2-generator (semi)groups of matrices over psubscript𝑝\mathbb{Z}_{p}blackboard_Z start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT is almost obvious. If A𝐴Aitalic_A and B𝐵Bitalic_B generate a free sub(semi)group of SL2()𝑆subscript𝐿2SL_{2}(\mathbb{Z})italic_S italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( blackboard_Z ), then there cannot be any relations of the form u(A,B)=v(A,B)𝑢𝐴𝐵𝑣𝐴𝐵u(A,B)=v(A,B)italic_u ( italic_A , italic_B ) = italic_v ( italic_A , italic_B ) in SL2(p)𝑆subscript𝐿2subscript𝑝SL_{2}(\mathbb{Z}_{p})italic_S italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( blackboard_Z start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ) unless at least one of the entries of the matrix u(A,B)𝑢𝐴𝐵u(A,B)italic_u ( italic_A , italic_B ) or v(A,B)𝑣𝐴𝐵v(A,B)italic_v ( italic_A , italic_B ) is at least p𝑝pitalic_p. Thus, if the largest entry in a product of n𝑛nitalic_n matrices is of the size O(sn)𝑂superscript𝑠𝑛O(s^{n})italic_O ( italic_s start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ), then the girth of the Cayley graph of our sub(semi)group of SL2(p)𝑆subscript𝐿2subscript𝑝SL_{2}(\mathbb{Z}_{p})italic_S italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( blackboard_Z start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ) is O(logsp)𝑂subscript𝑠𝑝O(\log_{s}p)italic_O ( roman_log start_POSTSUBSCRIPT italic_s end_POSTSUBSCRIPT italic_p ).

A more difficult problem is to estimate the growth of a “random” product of n𝑛nitalic_n matrices, each of which is A𝐴Aitalic_A or B𝐵Bitalic_B. That is, each matrix in such a product is either A𝐴Aitalic_A or B𝐵Bitalic_B, with probability 1212\frac{1}{2}divide start_ARG 1 end_ARG start_ARG 2 end_ARG. This is relevant to Direction 2, specifically to the generic-case complexity of matrix multiplication and therefore to the generic-case complexity of the word problem in (two-generator) groups of matrices. We discuss an approach to this problem at the end of Section 4.

4. Some possible approaches

In this section, we describe what we believe are promising approaches along some of the research avenues mentioned in Section 3.

In Direction 1, one will first need to address the worst-case complexity of the word problem in finitely generated metabelian groups. There is an explicit algorithm, due to Timoshenko [42], for solving this problem, but the worst-case complexity of this algorithm is unknown. Perhaps it was discouraging that Timoshenko’s algorithm employed Gröbner bases (in Laurent polynomial rings), and these are not known to be efficiently constructible. However, constructing relevant Gröbner bases is not part of solving the word problem for a given input word. These bases can be precomputed and then used for any input word w𝑤witalic_w. With this in mind, it is quite likely that the worst-case time complexity of the word problem in finitely generated metabelian groups is polynomial.

If this is the case, then for the average-case complexity one can use an approach from [32] based on the following

Theorem 4.1.

[45, Theorem 15.8a] Let G𝐺Gitalic_G be a polycyclic group, and suppose that all words of length n𝑛nitalic_n (in the given generators of G𝐺Gitalic_G) are sampled with equal probability. Then one has the following alternative:

(a) G𝐺Gitalic_G has polynomial growth with degree d𝑑ditalic_d and for a random word w𝑤witalic_w of length n𝑛nitalic_n, the probability of the event w=1𝑤1w=1italic_w = 1 is O(1nd/2)𝑂1superscript𝑛𝑑2O(\frac{1}{n^{d/2}})italic_O ( divide start_ARG 1 end_ARG start_ARG italic_n start_POSTSUPERSCRIPT italic_d / 2 end_POSTSUPERSCRIPT end_ARG ).

(b) G𝐺Gitalic_G has exponential growth and the probability of the event w=1𝑤1w=1italic_w = 1 is O(exp(cn13))𝑂𝑐superscript𝑛13O(\exp(-c\cdot n^{\frac{1}{3}}))italic_O ( roman_exp ( - italic_c ⋅ italic_n start_POSTSUPERSCRIPT divide start_ARG 1 end_ARG start_ARG 3 end_ARG end_POSTSUPERSCRIPT ) ) for some constant c>0𝑐0c>0italic_c > 0.

As an example of using this result, we show below how one can establish that in any polycyclic group, the average-case complexity of the word problem is linear. Let G𝐺Gitalic_G be an infinite polycyclic group. It has a factor group H=G/N𝐻𝐺𝑁H=G/Nitalic_H = italic_G / italic_N that is virtually free abelian of rank r1𝑟1r\geq 1italic_r ≥ 1. Thus, we first check if an input word w𝑤witalic_w is equal to 1 modulo N𝑁Nitalic_N; this takes linear time in n𝑛nitalic_n, the length of w𝑤witalic_w. Indeed, let w=g1gn𝑤subscript𝑔1subscript𝑔𝑛w=g_{1}\cdots g_{n}italic_w = italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ⋯ italic_g start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT and let K𝐾Kitalic_K be an abelian normal subgroup of H𝐻Hitalic_H such that H/K𝐻𝐾H/Kitalic_H / italic_K is finite. Then first check if w=1𝑤1w=1italic_w = 1 in H/K𝐻𝐾H/Kitalic_H / italic_K; this can be done in linear time. If wK𝑤𝐾w\in Kitalic_w ∈ italic_K, then rewrite w𝑤witalic_w in generators of K𝐾Kitalic_K using the Reidemeister-Schreier procedure. This, too, takes linear time. Indeed, if we already have a Schreier representative for a product g1gi1subscript𝑔1subscript𝑔𝑖1g_{1}\cdots g_{i-1}italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ⋯ italic_g start_POSTSUBSCRIPT italic_i - 1 end_POSTSUBSCRIPT, then we multiply its image in the factor group H/K𝐻𝐾H/Kitalic_H / italic_K by the image of gisubscript𝑔𝑖g_{i}italic_g start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT and get a representative for g1gisubscript𝑔1subscript𝑔𝑖g_{1}\cdots g_{i}italic_g start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT ⋯ italic_g start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT. This step is performed in time bounded by a constant since the group H/K𝐻𝐾H/Kitalic_H / italic_K is finite. Therefore, the whole rewriting takes linear time in n𝑛nitalic_n.

The obtained word wsuperscript𝑤w^{\prime}italic_w start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT should have length nabsent𝑛\leq n≤ italic_n in generators of K𝐾Kitalic_K. Then we solve the word problem for wsuperscript𝑤w^{\prime}italic_w start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT in the abelian group K𝐾Kitalic_K, which can be done in linear time in the length of wsuperscript𝑤w^{\prime}italic_w start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT, and therefore the whole solution takes linear time in n𝑛nitalic_n.

If w=1𝑤1w=1italic_w = 1 modulo N𝑁Nitalic_N, then we apply an algorithm for solving the word problem in N𝑁Nitalic_N with the worst-case complexity O(nlog2n)𝑂𝑛superscript2𝑛O(n\log^{2}n)italic_O ( italic_n roman_log start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_n ); such an algorithm exists by a result of [32] mentioned in Section 2. (Recall that polycyclic groups are representable by matrices over integers.) The probability that w=1𝑤1w=1italic_w = 1 modulo N𝑁Nitalic_N is O(1n1/2)𝑂1superscript𝑛12O(\frac{1}{n^{1/2}})italic_O ( divide start_ARG 1 end_ARG start_ARG italic_n start_POSTSUPERSCRIPT 1 / 2 end_POSTSUPERSCRIPT end_ARG ) by Theorem 4.1.

Therefore, the expected runtime of the combined algorithm is O(n)+O(1n1/2)O(nlog2n)=O(n)𝑂𝑛𝑂1superscript𝑛12𝑂𝑛superscript2𝑛𝑂𝑛O(n)+O(\frac{1}{n^{1/2}})\cdot O(n\log^{2}n)=O(n)italic_O ( italic_n ) + italic_O ( divide start_ARG 1 end_ARG start_ARG italic_n start_POSTSUPERSCRIPT 1 / 2 end_POSTSUPERSCRIPT end_ARG ) ⋅ italic_O ( italic_n roman_log start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT italic_n ) = italic_O ( italic_n ).

Along the same lines, one can establish linear-time average-case complexity of the word problem in many groups G𝐺Gitalic_G that have an (infinite) abelian factor group. It is important however to have a polynomial bound on the worst-case time complexity of the word problem in G𝐺Gitalic_G. (In some cases, a subexponential bound may suffice.) In particular, this is how one can approach linear-time average-case complexity of the word problem in finitely generated metabelian groups, by first establishing a polynomial bound on the worst-case complexity.

4.1. Constant-time average-case complexity

One might find surprising the fact that the average-case complexity of some natural group-theoretic problems can be constant. Below we illustrate how this can happen by using a special case of the Whitehead problem for a free group. The idea of using “forbidden subwords” in estimating the average-case complexity can be fruitful in other situations as well.

Let Frsubscript𝐹𝑟F_{r}italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT be a free group with a free generating set x1,,xrsubscript𝑥1subscript𝑥𝑟x_{1},\ldots,x_{r}italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_x start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT and let w=w(x1,,xr)𝑤𝑤subscript𝑥1subscript𝑥𝑟w=w(x_{1},\ldots,x_{r})italic_w = italic_w ( italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_x start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT ). Call an element uFr𝑢subscript𝐹𝑟u\in F_{r}italic_u ∈ italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT primitive if there is an automorphism of Frsubscript𝐹𝑟F_{r}italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT that takes x1subscript𝑥1x_{1}italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT to u𝑢uitalic_u.

We will also need the definition of the Whitehead graph of an element wFr𝑤subscript𝐹𝑟w\in F_{r}italic_w ∈ italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT. The Whitehead graph Wh(w)𝑊𝑤Wh(w)italic_W italic_h ( italic_w ) of w𝑤witalic_w has 2r2𝑟2r2 italic_r vertices that correspond to x1,,xr,x11,,xr1subscript𝑥1subscript𝑥𝑟superscriptsubscript𝑥11superscriptsubscript𝑥𝑟1x_{1},\ldots,x_{r},x_{1}^{-1},\ldots,x_{r}^{-1}italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_x start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT , italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT , … , italic_x start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT. For each occurrence of a subword xixjsubscript𝑥𝑖subscript𝑥𝑗x_{i}x_{j}italic_x start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_x start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT in the word wFr𝑤subscript𝐹𝑟w\in F_{r}italic_w ∈ italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT, there is an edge in Wh(w)𝑊𝑤Wh(w)italic_W italic_h ( italic_w ) that connects the vertex xisubscript𝑥𝑖x_{i}italic_x start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT to the vertex xj1superscriptsubscript𝑥𝑗1x_{j}^{-1}italic_x start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT;  if w𝑤witalic_w has a subword xixj1subscript𝑥𝑖superscriptsubscript𝑥𝑗1x_{i}x_{j}^{-1}italic_x start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT italic_x start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT, then there is an edge connecting xisubscript𝑥𝑖x_{i}italic_x start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT to xjsubscript𝑥𝑗x_{j}italic_x start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT, etc.  There is one more edge (the external edge): this is the edge that connects the vertex corresponding to the last letter of w𝑤witalic_w to the vertex corresponding to the inverse of the first letter.

It was observed by Whitehead himself (see [44] or [26]) that the Whitehead graph of any cyclically reduced primitive element w𝑤witalic_w of length >2absent2>2> 2 has either an isolated edge or a cut vertex, i.e., a vertex that, having been removed from the graph together with all incident edges, increases the number of connected components of the graph.

Now call a group word w=w(x1,,xr)𝑤𝑤subscript𝑥1subscript𝑥𝑟w=w(x_{1},\ldots,x_{r})italic_w = italic_w ( italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_x start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT ) primitivity-blocking if it cannot be a subword of any cyclically reduced primitive element of Frsubscript𝐹𝑟F_{r}italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT. For example, if the Whitehead graph of w𝑤witalic_w (without the external edge) is complete (i.e., any two vertices are connected by at least one edge), then w𝑤witalic_w is primitivity-blocking because in this case, if w𝑤witalic_w is a subword of u𝑢uitalic_u, then the Whitehead graph of u𝑢uitalic_u, too, is complete and therefore does not have a cut vertex or an isolated edge. Examples of primitivity-blocking words are: x1nx2nxrnx1superscriptsubscript𝑥1𝑛superscriptsubscript𝑥2𝑛superscriptsubscript𝑥𝑟𝑛subscript𝑥1x_{1}^{n}x_{2}^{n}\cdots x_{r}^{n}x_{1}italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT italic_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ⋯ italic_x start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT (for any n2𝑛2n\geq 2italic_n ≥ 2), [x1,x2][x3,x4][xn1,xn]x11subscript𝑥1subscript𝑥2subscript𝑥3subscript𝑥4subscript𝑥𝑛1subscript𝑥𝑛superscriptsubscript𝑥11[x_{1},x_{2}][x_{3},x_{4}]\cdots[x_{n-1},x_{n}]x_{1}^{-1}[ italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , italic_x start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ] [ italic_x start_POSTSUBSCRIPT 3 end_POSTSUBSCRIPT , italic_x start_POSTSUBSCRIPT 4 end_POSTSUBSCRIPT ] ⋯ [ italic_x start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT , italic_x start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ] italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT (for an even n𝑛nitalic_n), etc. Here [x,y]𝑥𝑦[x,y][ italic_x , italic_y ] denotes x1y1xysuperscript𝑥1superscript𝑦1𝑥𝑦x^{-1}y^{-1}xyitalic_x start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT italic_y start_POSTSUPERSCRIPT - 1 end_POSTSUPERSCRIPT italic_x italic_y.

The usual algorithm for deciding whether or not a given element of Frsubscript𝐹𝑟F_{r}italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT is primitive is a special case of the general Whitehead algorithm that decides, given two elements u,vFr𝑢𝑣subscript𝐹𝑟u,v\in F_{r}italic_u , italic_v ∈ italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT, whether or not u𝑢uitalic_u can be taken to v𝑣vitalic_v by an automorphism of Frsubscript𝐹𝑟F_{r}italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT. If v=x1𝑣subscript𝑥1v=x_{1}italic_v = italic_x start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT, the worst-case complexity of the Whitehead algorithm is at most quadratic in max(|u|,|v|)=|u|𝑢𝑣𝑢\max(|u|,|v|)=|u|roman_max ( | italic_u | , | italic_v | ) = | italic_u |. Here we are going to address the average-case complexity of the Whitehead algorithm run in parallel with a “fast check” algorithm, when applied to recognizing primitive elements of Frsubscript𝐹𝑟F_{r}italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT.

A “fast check” algorithm 𝒯𝒯\mathcal{T}caligraphic_T to test primitivity of an input (cyclically reduced) word u𝑢uitalic_u would be as follows. Let n𝑛nitalic_n be the length of u𝑢uitalic_u. The algorithm 𝒯𝒯\mathcal{T}caligraphic_T would read the initial segments of u𝑢uitalic_u of length k𝑘kitalic_k, k=1,2,,𝑘12k=1,2,\ldots,italic_k = 1 , 2 , … , adding one letter at a time, and build the Whitehead graph of this segment, excluding the external edge. Then the algorithm would check if this graph is complete. If it is complete, then in particular it does not have a cut vertex or an isolated edge, so the input element is not primitive.

Note that the Whitehead graph always has 2r2𝑟2r2 italic_r vertices, so checking the property of such a graph to be complete takes constant time with respect to the length of u𝑢uitalic_u, although reading a segment of u𝑢uitalic_u of length k𝑘kitalic_k takes time O(k)𝑂𝑘O(k)italic_O ( italic_k ). If the Whitehead graph of u𝑢uitalic_u is complete, the algorithm returns “u𝑢uitalic_u is not primitive”. If it is not, the algorithm just stops.

Denote the “usual” Whitehead algorithm by 𝒲𝒲\mathcal{W}caligraphic_W. Now we are going to run the algorithms 𝒯𝒯\mathcal{T}caligraphic_T and 𝒲𝒲\mathcal{W}caligraphic_W in parallel; denote the composite algorithm by 𝒜𝒜\mathcal{A}caligraphic_A. Suppose that inputs of the algorithm 𝒜𝒜\mathcal{A}caligraphic_A are cyclically reduced words that are selected uniformly at random from the set of cyclically reduced words of length n𝑛nitalic_n. Then we claim that the average-case time complexity (a.k.a. expected runtime) of the algorithm 𝒜𝒜\mathcal{A}caligraphic_A, working on a classical Turing machine, is O(1)𝑂1O(1)italic_O ( 1 ), a constant that depends on r𝑟ritalic_r but not on n𝑛nitalic_n.

Indeed, for complexity of the algorithm 𝒯𝒯\mathcal{T}caligraphic_T we can use a result of [10] saying that the number of (freely reduced) words of length L𝐿Litalic_L with (any number of) forbidden subwords grows exponentially slower than the number of all freely reduced words of length L𝐿Litalic_L.

In our situation, if the Whitehead graph of a word w𝑤witalic_w is not complete, that means w𝑤witalic_w does not have at least one xi±1xj±1superscriptsubscript𝑥𝑖plus-or-minus1superscriptsubscript𝑥𝑗plus-or-minus1x_{i}^{\pm 1}x_{j}^{\pm 1}italic_x start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ± 1 end_POSTSUPERSCRIPT italic_x start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT start_POSTSUPERSCRIPT ± 1 end_POSTSUPERSCRIPT as a subword. Thus, if the Whitehead graph of any initial segment of the input word u𝑢uitalic_u is not complete, we have at least one forbidden subword. Therefore, the probability that the Whitehead graph of the initial segment of length k𝑘kitalic_k of the word u𝑢uitalic_u is not complete is bounded by sksuperscript𝑠𝑘s^{k}italic_s start_POSTSUPERSCRIPT italic_k end_POSTSUPERSCRIPT for some s,0<s<1𝑠0𝑠1s,~{}0<s<1italic_s , 0 < italic_s < 1. Thus, the average time complexity of the algorithm 𝒯𝒯\mathcal{T}caligraphic_T is

(4) k=1nksk,superscriptsubscript𝑘1𝑛𝑘superscript𝑠𝑘\sum_{k=1}^{n}k\cdot s^{k},∑ start_POSTSUBSCRIPT italic_k = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT italic_k ⋅ italic_s start_POSTSUPERSCRIPT italic_k end_POSTSUPERSCRIPT ,

which is bounded by a constant.

Now suppose that the Whitehead graph of the input word u𝑢uitalic_u of length n𝑛nitalic_n is not complete, so that we have to employ the Whitehead algorithm 𝒲𝒲\mathcal{W}caligraphic_W. The probability of this to happen is bounded by snsuperscript𝑠𝑛s^{n}italic_s start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT for some s,0<s<1𝑠0𝑠1s,~{}0<s<1italic_s , 0 < italic_s < 1, as was mentioned before.

Then, the worst-case complexity of the Whitehead algorithm for detecting primitivity of the input word is known to have time complexity O(n2)𝑂superscript𝑛2O(n^{2})italic_O ( italic_n start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ).

Thus, the average-case complexity of the composite algorithm 𝒜𝒜\mathcal{A}caligraphic_A is

(5) k=1nksk+O(n2)O(sn),superscriptsubscript𝑘1𝑛𝑘superscript𝑠𝑘𝑂superscript𝑛2𝑂superscript𝑠𝑛\sum_{k=1}^{n}k\cdot s^{k}+O(n^{2})\cdot O(s^{n}),∑ start_POSTSUBSCRIPT italic_k = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT italic_k ⋅ italic_s start_POSTSUPERSCRIPT italic_k end_POSTSUPERSCRIPT + italic_O ( italic_n start_POSTSUPERSCRIPT 2 end_POSTSUPERSCRIPT ) ⋅ italic_O ( italic_s start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ) ,

which is bounded by a constant.

These results may be generalized as follows. Call wFr𝑤subscript𝐹𝑟w\in F_{r}italic_w ∈ italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT an Orb(u)𝑂𝑟𝑏𝑢Orb(u)italic_O italic_r italic_b ( italic_u )-blocking word if it cannot be a subword of any cyclically reduced vOrb(u)𝑣𝑂𝑟𝑏𝑢v\in Orb(u)italic_v ∈ italic_O italic_r italic_b ( italic_u ). Suppose there are Orb(u)𝑂𝑟𝑏𝑢Orb(u)italic_O italic_r italic_b ( italic_u )-blocking words for a uFr𝑢subscript𝐹𝑟u\in F_{r}italic_u ∈ italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT (cf. [4], Problem (F40)). Then, by using the same kind of argument as above, one would be able to show that the average-case complexity (with respect to the length of the input word v𝑣vitalic_v) of the following problem is constant: given a cyclically reduced word v𝑣vitalic_v, find out if v=α(u)𝑣𝛼𝑢v=\alpha(u)italic_v = italic_α ( italic_u ) for some αAut(Fr)𝛼𝐴𝑢𝑡subscript𝐹𝑟\alpha\in Aut(F_{r})italic_α ∈ italic_A italic_u italic_t ( italic_F start_POSTSUBSCRIPT italic_r end_POSTSUBSCRIPT ).

4.2. Complexity of a product of n𝑛nitalic_n matrices

Finally, we comment on Direction 5 from Section 3. To begin, let A=A(2)=(1201),B=B(2)=(1021).formulae-sequence𝐴𝐴21201𝐵𝐵21021A=A(2)=\left(\begin{array}[]{cc}1&2\\ 0&1\end{array}\right),\hskip 5.69046ptB=B(2)=\left(\begin{array}[]{cc}1&0\\ 2&1\end{array}\right).italic_A = italic_A ( 2 ) = ( start_ARRAY start_ROW start_CELL 1 end_CELL start_CELL 2 end_CELL end_ROW start_ROW start_CELL 0 end_CELL start_CELL 1 end_CELL end_ROW end_ARRAY ) , italic_B = italic_B ( 2 ) = ( start_ARRAY start_ROW start_CELL 1 end_CELL start_CELL 0 end_CELL end_ROW start_ROW start_CELL 2 end_CELL start_CELL 1 end_CELL end_ROW end_ARRAY ) .

The largest entry in a product of n𝑛nitalic_n matrices each of which is A𝐴Aitalic_A or B𝐵Bitalic_B is O((1+2)n)𝑂superscript12𝑛O((1+\sqrt{2})^{n})italic_O ( ( 1 + square-root start_ARG 2 end_ARG ) start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ); this was proved in [8]. (In fact, there is given an explicit function f(n)𝑓𝑛f(n)italic_f ( italic_n ) for the largest entry.) The fastest growing largest entry in a product of n𝑛nitalic_n matrices is when such a product is of the form (AB)n2superscript𝐴𝐵𝑛2(AB)^{\frac{n}{2}}( italic_A italic_B ) start_POSTSUPERSCRIPT divide start_ARG italic_n end_ARG start_ARG 2 end_ARG end_POSTSUPERSCRIPT (assuming that n𝑛nitalic_n is even).

To estimate the average growth of entries in a random product of n𝑛nitalic_n matrices A𝐴Aitalic_A or B𝐵Bitalic_B (where each factor is either A𝐴Aitalic_A or B𝐵Bitalic_B with probability 1212\frac{1}{2}divide start_ARG 1 end_ARG start_ARG 2 end_ARG), one can try to solve the following pair of recurrence relations for, say, the entries in the first row of a 2×2222\times 22 × 2 matrix:

– with probability 1212\frac{1}{2}divide start_ARG 1 end_ARG start_ARG 2 end_ARG, an=an1subscript𝑎𝑛subscript𝑎𝑛1~{}a_{n}=a_{n-1}italic_a start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = italic_a start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT, bn=2an1+bn1subscript𝑏𝑛2subscript𝑎𝑛1subscript𝑏𝑛1~{}b_{n}=2a_{n-1}+b_{n-1}italic_b start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 2 italic_a start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT + italic_b start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT;
– with probability 1212\frac{1}{2}divide start_ARG 1 end_ARG start_ARG 2 end_ARG, an=an1+2bn1subscript𝑎𝑛subscript𝑎𝑛12subscript𝑏𝑛1~{}a_{n}=a_{n-1}+2b_{n-1}italic_a start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = italic_a start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT + 2 italic_b start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT, bn=bn1subscript𝑏𝑛subscript𝑏𝑛1~{}b_{n}=b_{n-1}italic_b start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = italic_b start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT.

One can compute the “expectation” of ansubscript𝑎𝑛a_{n}italic_a start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT as 12(an1+an1+2bn1)=an1+bn1.12subscript𝑎𝑛1subscript𝑎𝑛12subscript𝑏𝑛1subscript𝑎𝑛1subscript𝑏𝑛1\frac{1}{2}(a_{n-1}+a_{n-1}+2b_{n-1})=a_{n-1}+b_{n-1}.divide start_ARG 1 end_ARG start_ARG 2 end_ARG ( italic_a start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT + italic_a start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT + 2 italic_b start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT ) = italic_a start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT + italic_b start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT .

The same for the “expectation” of bn=12(2an1+bn1+bn1)=an1+bn1.subscript𝑏𝑛122subscript𝑎𝑛1subscript𝑏𝑛1subscript𝑏𝑛1subscript𝑎𝑛1subscript𝑏𝑛1b_{n}=\frac{1}{2}(2a_{n-1}+b_{n-1}+b_{n-1})=a_{n-1}+b_{n-1}.italic_b start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = divide start_ARG 1 end_ARG start_ARG 2 end_ARG ( 2 italic_a start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT + italic_b start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT + italic_b start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT ) = italic_a start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT + italic_b start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT .

Thus, “on average” an=bnsubscript𝑎𝑛subscript𝑏𝑛a_{n}=b_{n}italic_a start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = italic_b start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT, hence from the above, an=2an1subscript𝑎𝑛2subscript𝑎𝑛1a_{n}=2a_{n-1}italic_a start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT = 2 italic_a start_POSTSUBSCRIPT italic_n - 1 end_POSTSUBSCRIPT, whence ansubscript𝑎𝑛a_{n}italic_a start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT grows as 2nsuperscript2𝑛2^{n}2 start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT, and so does bnsubscript𝑏𝑛b_{n}italic_b start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT.

The variance, however, seems to be pretty large, as suggested by computer experiments. In particular, the largest entry in a product of 1000 random matrices ranges from 10273superscript1027310^{273}10 start_POSTSUPERSCRIPT 273 end_POSTSUPERSCRIPT to 10287superscript1028710^{287}10 start_POSTSUPERSCRIPT 287 end_POSTSUPERSCRIPT. The most popular largest entry is on the order of 10280superscript1028010^{280}10 start_POSTSUPERSCRIPT 280 end_POSTSUPERSCRIPT, which suggests that “generically”, the largest entry grows like O((1.905)n)𝑂superscript1.905𝑛O((1.905)^{n})italic_O ( ( 1.905 ) start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ).

If one has in mind applications to Cayley hash functions (see Section 3, Direction 5), then one wants the generic growth to be as slow as possible. To that end, one can consider a slightly different pair of matrices: A=A(2)=(1201),B=B(2)=(1021).formulae-sequence𝐴𝐴21201𝐵𝐵21021A=A(2)=\left(\begin{array}[]{cc}1&2\\ 0&1\end{array}\right),\hskip 5.69046ptB=B(-2)=\left(\begin{array}[]{cc}1&0\\ -2&1\end{array}\right).italic_A = italic_A ( 2 ) = ( start_ARRAY start_ROW start_CELL 1 end_CELL start_CELL 2 end_CELL end_ROW start_ROW start_CELL 0 end_CELL start_CELL 1 end_CELL end_ROW end_ARRAY ) , italic_B = italic_B ( - 2 ) = ( start_ARRAY start_ROW start_CELL 1 end_CELL start_CELL 0 end_CELL end_ROW start_ROW start_CELL - 2 end_CELL start_CELL 1 end_CELL end_ROW end_ARRAY ) .

With this pair, the largest entry in a product of n𝑛nitalic_n matrices A𝐴Aitalic_A or B𝐵Bitalic_B is when such a product is of the form (ABBA)n4superscript𝐴𝐵𝐵𝐴𝑛4(ABBA)^{\frac{n}{4}}( italic_A italic_B italic_B italic_A ) start_POSTSUPERSCRIPT divide start_ARG italic_n end_ARG start_ARG 4 end_ARG end_POSTSUPERSCRIPT (assuming that n𝑛nitalic_n is a multiple of 4). The growth rate of the largest entry in the matrix (ABBA)n4superscript𝐴𝐵𝐵𝐴𝑛4(ABBA)^{\frac{n}{4}}( italic_A italic_B italic_B italic_A ) start_POSTSUPERSCRIPT divide start_ARG italic_n end_ARG start_ARG 4 end_ARG end_POSTSUPERSCRIPT is O((2+3)n)𝑂superscript23𝑛O((\sqrt{2+\sqrt{3}})^{n})italic_O ( ( square-root start_ARG 2 + square-root start_ARG 3 end_ARG end_ARG ) start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ). Note that 2+31.93<1+22.41231.93122.41\sqrt{2+\sqrt{3}}\approx 1.93~{}<~{}1+\sqrt{2}\approx 2.41square-root start_ARG 2 + square-root start_ARG 3 end_ARG end_ARG ≈ 1.93 < 1 + square-root start_ARG 2 end_ARG ≈ 2.41.

We note in passing that, interestingly, entries of (AB)n2superscript𝐴𝐵𝑛2(AB)^{\frac{n}{2}}( italic_A italic_B ) start_POSTSUPERSCRIPT divide start_ARG italic_n end_ARG start_ARG 2 end_ARG end_POSTSUPERSCRIPT exhibit linear(!) growth in this case.

The average growth for the largest entry in a product of n𝑛nitalic_n matrices A𝐴Aitalic_A or B𝐵Bitalic_B in this case is O((2n)O(1.41n)O((\sqrt{2}^{n})\approx O(1.41^{n})italic_O ( ( square-root start_ARG 2 end_ARG start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ) ≈ italic_O ( 1.41 start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ), and in a generic product it is about O(1.68n)𝑂superscript1.68𝑛O(1.68^{n})italic_O ( 1.68 start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT ). We make a disclaimer that all these growth estimates for the pair (A(2),B(2))𝐴2𝐵2(A(2),B(-2))( italic_A ( 2 ) , italic_B ( - 2 ) ) are based just on computer experiments.

We also note that Pollicott [35] studied the (maximal) Lyapunov exponent λ𝜆\lambdaitalic_λ for random matrix products of strictly positive matrices. In our situation, the maximal Lyapunov exponent is the natural logarithm of the maximal base of the exponent in the growth rate of the entries in a random product of n𝑛nitalic_n matrices A𝐴Aitalic_A or B𝐵Bitalic_B. In [35], an algorithm is given for estimating λ𝜆\lambdaitalic_λ with any desired precision. However, our matrices A𝐴Aitalic_A and B𝐵Bitalic_B are not strictly positive, so this algorithm may not be applicable in our situation.

Finally, we note that it seems natural to use (for hashing purposes) pairs of matrices with smaller entries, like (A(1),B(1))𝐴1𝐵1(A(1),B(1))( italic_A ( 1 ) , italic_B ( 1 ) ) or (A(1),B(1))𝐴1𝐵1(A(1),B(-1))( italic_A ( 1 ) , italic_B ( - 1 ) ). However, the matrices (A(1),B(1))𝐴1𝐵1(A(1),B(-1))( italic_A ( 1 ) , italic_B ( - 1 ) ) do not generate a free semigroup (they satisfy the “braid relation” ABA=BAB𝐴𝐵𝐴𝐵𝐴𝐵ABA=BABitalic_A italic_B italic_A = italic_B italic_A italic_B), so our approach to collision resistance does not work in this case. The matrices (A(1),B(1))𝐴1𝐵1(A(1),B(1))( italic_A ( 1 ) , italic_B ( 1 ) ) do generate a free semigroup, but they generate the whole semigroup of matrices in SL2()𝑆subscript𝐿2SL_{2}(\mathbb{Z})italic_S italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( blackboard_Z ) with nonnegative entries. This property was used in [41] to arrange an attack that was successful in recovering a preimage of a hash, thereby showing that the corresponding Cayley hash function is not preimage resistant.

We leave it at that.

References

  • [1] G. Arzhantseva and A. Biswas, Logarithmic girth expander graphs of SLn(𝔽p)𝑆subscript𝐿𝑛subscript𝔽𝑝SL_{n}(\mathbb{F}_{p})italic_S italic_L start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ( blackboard_F start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ), J. Algebraic Combinatorics 56 (2022), 691–723.
  • [2] G. Arzhantseva and A. Olshanskii, Genericity of the class of groups in which subgroups with a lesser number of generators are free, (Russian) Mat. Zametki 59 (1996), no. 4, 489–496.
  • [3] F. Bassino, I. Kapovich, M. Lohrey, A. Myasnikov, C. Nicaud, A. Nikolaev, I. Rivin, V. Shpilrain, A. Ushakov, P. Weil, Complexity and Randomness in Group Theory: GAGTA Book 1. Walter de Gruyter, 2020.
  • [4] G. Baumslag, A. G. Myasnikov, V. Shpilrain, Open problems in combinatorial group theory,
    http://shpilrain.ccny.cuny.edu/gworld/problems/oproblems.html
  • [5] J.-C. Birget, A. Yu. Olshanskii, E. Rips, M. V. Sapir, Isoperimetric functions of groups and computational complexity of the word problem, Ann. of Math. (2) 156 (2002), 467–518.
  • [6] J. Birman, K. H. Ko, S. J. Lee, A new approach to the word and conjugacy problems in the braid groups, Adv. Math. 139 (1998), 322–353.
  • [7] J. Bourgain, A. Gamburd, Uniform expansion bounds for Cayley graphs of SL2(𝔽p)𝑆subscript𝐿2subscript𝔽𝑝SL_{2}({\mathbb{F}}_{p})italic_S italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( blackboard_F start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ). Ann. of Math. (2) 167 (2008), 625–642.
  • [8] L. Bromberg, V. Shpilrain, A. Vdovina, Navigating in the Cayley graph of SL2(𝔽p)𝑆subscript𝐿2subscript𝔽𝑝SL_{2}(\mathbb{F}_{p})italic_S italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( blackboard_F start_POSTSUBSCRIPT italic_p end_POSTSUBSCRIPT ) and applications to hashing, Semigroup Forum 94 (2017), 314–324.
  • [9] A. Carnevale, M. Cavaleri, Partial word and equality problems and Banach densities, Adv. Math. 368 (2020), 107133.
  • [10] T. Ceccherini-Silberstein, W. Woess, Growth and ergodicity of context-free languages, Trans. Amer. Math. Soc. 354 (2002), 4597–4625.
  • [11] J. M. Cohen, Cogrowth and amenability of discrete groups, J. Funct. Anal. 48 (1982), 301–309.
  • [12] R. I. Grigorchuk, Symmetrical random walks on discrete groups, in: Advances in Probability and Related Topics, Vol. 6, pp. 285–325, Marcel Dekker 1980.
  • [13] M. Gromov, Asymptotic invariants of infinite groups, Geometric group theory, Vol. 2 (Sussex, 1991), 1–295. London Math. Soc. Lecture Note Ser., 182 Cambridge University Press, Cambridge, 1993.
  • [14] V. Guba, Amenability problem for Thompson’s group F𝐹Fitalic_F: state of the art, Groups, Complexity, Cryptology 15 (2023.
  • [15] D. Harvey and J. van der Hoeven, Integer multiplication in time O(nlogn)𝑂𝑛𝑛O(n\log n)italic_O ( italic_n roman_log italic_n ), Ann. of Math. 193 (2021), 563–617.
  • [16] H. A. Helfgott,Growth and generation in SL2(/pSL_{2}(\mathbb{Z}/p\mathbb{Z}italic_S italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT ( blackboard_Z / italic_p blackboard_Z) Ann. of Math. (2) 167 (2008), 601–623.
  • [17] D. Kahrobaei, R. Flores, M. Noce, Group-based cryptography in the quantum era, Notices Amer. Math. Soc. 70 (2023), 752–763.
  • [18] D. Kahrobaei, R. Flores, M. Noce, M. Habeeb, C. Battarbee, Applications of Group Theory in Cryptography: Post-quantum Group-based Cryptography, Amer. Math. Soc. Surveys and Monographs, 2023, to appear.
  • [19] I. Kapovich, A. G. Myasnikov, P. Schupp, V. Shpilrain, Generic-case complexity, decision problems in group theory and random walks, J. Algebra 264 (2003), 665–694.
  • [20] I. Kapovich, A. G. Myasnikov, P. Schupp, V. Shpilrain, Average-case complexity and decision problems in group theory, Advances in Math. 190 (2005), 343–359.
  • [21] O. G. Kharlampovich, A finitely presented solvable group with unsolvable word problem. (Russian) Izv. Akad. Nauk SSSR Ser. Mat. 45 (1981), 852–873.
  • [22] O. G. Kharlampovich, A. G. Myasnikov, M. Sapir, Algorithmically complex residually finite groups, Bull. Math. Sci. 7 (2017), 309–352.
  • [23] D. E. Knuth, The analysis of algorithms. Actes du Congrès International des Mathématiciens (Nice, 1970), Tome 3, pp. 269–-274. Gauthier-Villars, Paris, 1971.
  • [24] L. Levin, Average case complete problems, SIAM J. Comput. 15 (1986), 285–286.
  • [25] M. Lohrey, The compressed word problem for groups, Springer Briefs Math., Springer, New York, 2014.
  • [26] R. Lyndon and P. Schupp, Combinatorial Group Theory, Springer-Verlag, 1977. Reprinted in the “Classics in mathematics” series, 2000.
  • [27] C. Mattes, A. Weiss, Improved Parallel Algorithms for Generalized Baumslag Groups, in: LATIN 2022: Theoretical Informatics, Lecture Notes in Comput. Sci. 13568 (2022), 658–675.
  • [28] A. G. Myasnikov, V. Roman’kov, A. Ushakov, and A. Vershik, The word and geodesic problems in free solvable groups, Trans. Amer. Math. Soc. 362 (2010), 4655–4682.
  • [29] A. G. Myasnikov, V. Shpilrain, and A. Ushakov, Group-based cryptography. Birkhäuser Verlag, Basel-Boston-Berlin, 2008.
  • [30] A. G. Myasnikov, V. Shpilrain, and A. Ushakov, Non-commutative cryptography and complexity of group-theoretic problems. Amer. Math. Soc. Surveys and Monographs, 2011.
  • [31] A. G. Miasnikov, A. Ushakov, Random van Kampen diagrams and algorithmic problems in groups, Groups Complex. Cryptol. 3 (2011), 121–185.
  • [32] A. Olshanskii, V. Shpilrain, Linear average-case complexity of algorithmic problems in groups, preprint.
  • [33] M. S. Paterson, A. A. Razborov, The set of minimal braids is co-NP-complete, J. Algorithms 12 (1991), 393–408.
  • [34] D. Peifer, Artin groups of extra-large type are biautomatic, J. Pure Appl. Algebra 110 (1996), 15–56.
  • [35] M. Pollicott, Maximal Lyapunov exponents for random matrix products, Invent. Math. 181 (2010), 209–226.
  • [36] M. Roy, E. Ventura, P. Weil, The central tree property and algorithmic problems on subgroups of free groups, J. Group Theory, to appear.
  • [37] S. Schleimer, Polynomial-time word problems, Comment. Math. Helv. 83 (2008), 741–765.
  • [38] V. Shpilrain, Sublinear time algorithms in the theory of groups and semigroups, Illinois J. Math. 54 (2011), 187–197.
  • [39] V. Shpilrain, Average-case complexity of the Whitehead problem for free groups, Comm. Algebra 51 (2023), 799–806.
  • [40] A. Sisto, Tracking rates of random walks, Israel J. Math. 220 (2017), 1–28.
  • [41] J.-P. Tillich and G. Zémor, Group-theoretic hash functions, in Proceedings of the First French-Israeli Workshop on Algebraic Coding, Lecture notes Comp. Sci. 781 (1993), 90–110.
  • [42] E. I. Timoshenko, Certain algorithmic questions for metabelian groups, Algebra and Logic 12 (1973), 132–137.
  • [43] J. Wang, Average-case completeness of a word problem in groups, Proc. of the 27-th Annual Symposium on Theory of Computing, ACM Press, New York, 1995, 325–334.
  • [44] J. H. C. Whitehead, On equivalent sets of elements in free groups, Ann. of Math. 37 (1936), 782–800.
  • [45] W. Woess, Random walks on infinite graphs and groups, Cambridge Tracts in Mathematics, 138. Cambridge University Press, Cambridge, 2000.
  • [46] R. Young, Averaged Dehn functions for nilpotent groups, Topology 47 (2008), 351–367.