# Two-Variable Word Equations

## Abstract

We consider languages expressed by word equations in two variables and give a complete characterization for their complexity functions, that is, the functions that give the number of words of a given length. Specifically, we prove that there are only five types of complexities: constant, linear, exponential, and two in between constant and linear. For the latter two, we give precise characterizations in terms of the number of solutions of Diophantine equations of certain types. There are several consequences of our study. First, we show that the linear upper bound on the non-exponential complexities by Karhumäki et al., cf. [KMP], is optimal. Second, we derive that both of the sets of all finite Sturmian words and of all finite Standard words are expressible by word equations. Third, we characterize the languages of non-exponential complexity which are expressible by two-variable word equations as finite unions of several simple parametric formulae and solutions of a two-variable word equation with a finite graph. Fourth, we find optimal upper bounds on the solutions of (solvable) two-variable word equations, namely, linear bound for one variable and quadratric for the other. From this, we obtain an \( \mathcal{O}(n^6 ) \) algorithm for testing the solvability of two-variable word equations.

## Keywords

word equation expressible language complexity function minimal solution solvability## Preview

Unable to display preview. Download preview PDF.

## References

- [An]Angluin, D., Finding patterns common to a set of strings,
*J. Comput. System Sci.***21**(1) (1980) 46–62.MATHCrossRefMathSciNetGoogle Scholar - [Be]Berstel, J., Recent results in Sturmian words, in J. Dassow, G. Rozenberg, A. Salomaa, eds.,
*Developments in Language Theory II*, 13–24, World Sci. Publishing, 1996.Google Scholar - [ChPa]Charatonik, W. and Pacholski, L., Word equations with two variables,
*Proc. of IWWERT’91*, H. Abdulrab, J. P. Pecuchet, eds., 43–57, LNCS 667, Springer, Berlin, 1991.Google Scholar - [ChKa]Choffrut, C. and Karhumäki, J., Combinatorics of words, in G. Rozenberg, A. Salomaa, eds.,
*Handbook of Formal Languages*, 329–438, Springer, Berlin, 1997.Google Scholar - [dLMi]de Luca, A. and Mignosi, F., Some combinatorial properties of sturmian words,
*Theoret. Comput. Sci.***136**361–385, 1994.MATHCrossRefMathSciNetGoogle Scholar - [OGM]Eyono Obono, S., Goralcik, P., and Maksimenko, M., Efficient solving of the word equations in one variable, in
*Proc. of MFCS’94*, 336–341, LNCS 841, Springer, Berlin, 1994.Google Scholar - [Hm]Hmelevskii, Yu. I., Equations in free semigroups,
*Trudy Mat. Inst. Steklov***107**1971. English transl.*Proc Steklov Inst. of Mathematics***107**(1971), Amer. Math. Soc., 1976.Google Scholar - [JSSY]Jiang, T., Salomaa, A., Salomaa, K., and Yu, S., Decision problems for patterns,
*J. Comput. System Sci.***50**(1) (1995) 53–63.MATHCrossRefMathSciNetGoogle Scholar - [KMP]Karhumäki, J., Mignosi, F., and Plandowski, W., The expressibility of languages and relations by word equations, in
*Proc. of ICALP’97*, 98–109, LNCS 1256, Springer, Berlin, 1997.Google Scholar - [KoPa]Koscielski, A. and Pacholski, L., Complexity of Makanin’s algorithm,
*Journal of the ACM*,**43**(4), 670–684, 1996.MATHCrossRefMathSciNetGoogle Scholar - [Lo]Lothaire, M.,
*Combinatorics on Words*, Addison-Wesley, Reading, Mass., 1983.MATHGoogle Scholar - [Ma]Makanin, G.S., The problem of solvability of equations in a free semigroup,
*Mat. Sb.***103**(145), 147–233, 1977. English transl. in*Math. U.S.S.R. Sb*.**32**, 1977.MathSciNetGoogle Scholar - [Ra]Rauzy, G., Mots infinis en arithmetique, in M. Nivat, D. Perrin, eds.,
*Automata on infinite words*, LNCS 192, Springer, Berlin, 1984.Google Scholar - [Raz1]Razborov, A., On systems of equations in a free group,
*Math. USSR Izvestija***25**(1), 115–162, 1985.CrossRefGoogle Scholar - [Raz2]Razborov, A., On systems of equations in a free group, Ph.D. Thesis, Moscow State University, 1987.Google Scholar
- [Si]Sierpinski, W.,
*Elementary Theory of Numbers*, Elseviers Science Publishers B.V., Amsterdam, and PWN-Polish Scientific Publishers, Warszawa, 1988.MATHGoogle Scholar