# On the complexity of simple arithmetic expressions

## Abstract

Let E be the set of all simple arithmetic expressions of the form E(x)=xT_{1}...T_{k}, where x is a nonnegative integer variable and each T_{i} is a multiplication or integer division by a positive integer constant. We investigate the complexity of the inequivalence and the bounded inequivalence problems for expressions in E. (The bounded inequivalence problem is the problem of deciding for arbitrary expressions E_{1}(x) and E_{2}(x) and a positive integer x < ℓ whether or not E_{1}(x)≠E_{2}(x) for some non-negative integer x<ℓ. If ℓ=∞, i.e., there is no upper bound on x, the problem becomes the inequivalence problem.) We show that the inequivalence problem (or equivalently, the equivalence problem) for a large subclass of E is decidable in polynomial time. Whether or not the problem is decidable in polynomial time for the full class E remains open. We also show that the bounded inequivalence problem is NP-complete even if the divisors are restricted to be equal to 2. This last result can be used to sharpen some known NP-completeness results in the literature. Note that if division is rational division, all problems are trivially decidable in polynomial time.

## Keywords

Polynomial Time Polynomial Time Algorithm Equivalence Problem Conjunctive Normal Form Boolean Formula## References

- 1.Cook, S., The complexity of theorem proving procedures, Conference Record of the Third ACM Symposium on Theory of Computing, (1971), 151–158.Google Scholar
- 2.Gold, E., Complexity of automaton identification from given data, Information and Control, 37 (1968), 302–320.Google Scholar
- 3.Herstein, I., "Topics in Algebra," Xerox College Publishing, Lexington, MA, (1964).Google Scholar
- 4.Hopcroft, J. and Ullman, J., "Introduction to Automata Theory, Languages, and Computation," Addison-Wesley, Reading, Mass., 1979.Google Scholar
- 5.Hunt III, H., Constable, R., and Sahni, S., On the computational complexity of program scheme equivalence, SIAM Journal on Computing, 9(1980), 396–416.Google Scholar
- 6.Ibarra, O. and Leininger, B., The complexity of the equivalence problem for simple loop-free programs, to appear in SIAM Journal on Computing. (Also available as University of Minnesota Computer Science Department Tech. Report 79-23.)Google Scholar
- 7.Ibarra, O., Leininger, B., and Moran, S., On the Complexity of Simple Arithmetic Expressions, University of Minnesota Computer Science Tech. Report 80-3.Google Scholar
- 8.Manders, K. and Adleman, L., NP-complete decision problems for binary quadratics, Journal of Computer and System Sciences, 16(1978), 168–184.Google Scholar
- 9.Tsichritzis, D., The equivalence problem of simple programs, Journal of the Association for Computing Machinery, 17(1970), 729–738.Google Scholar