# Counting, selecting, and sorting by query-bounded machines

## Abstract

We study the query-complexity of counting, selecting, and sorting functions. That is, for a given set *A* and a positive integer *k*, we ask, how many queries to an arbitrary oracle does a polynomial-time machine on input (*x*_{1}, *x*_{2},..., *x*_{ k }) need to determine how many strings of the input are in *A.* We also ask how many queries are necessary to select a string in *A* from the input (*x*_{1}, *x*_{2},..., *x*_{ k }) if such a string exists and to sort the input (*x*_{1}, *x*_{2},..., *x*_{ k }) with respect to the ordering *x* ≼ *y* if and only if *x ∈ A* ⇒ *y ∈ A.* We obtain optimal query-bounds for these problems, and show that sets for which these functions have a low query-complexity must be easy in some sense. For such sets we obtain optimal placements in the extended low hierarchy. We also show that in the case of NP-complete sets the lower bounds for counting and selecting hold unless P=NP. Finally, we relate these notions to cheatability and p-superterseness. Our results yield as corollaries extensions of previously know results.

## Keywords

Selector Function Query Tree Pruning Step Sorting Function SlAM Journal## Preview

Unable to display preview. Download preview PDF.

## References

- [ABG90]A. Amir, R. Beigel, and W. Gasarch. Some connections between bounded query classes and non-uniform complexity. In
*Proceedings 5th Structure in Complexity Theory Conference*, pages 232–243. IEEE Computer Society Press, 1990.Google Scholar - [AG88]A. Amir and W. Gasarch. Polynomial terse sets.
*Information and Computation*, 77:37–55, 1988.Google Scholar - [BBS86]J. Balcázar, R. Book, and U. Schöning. Sparse sets, lowness, and highness.
*SIAM Journal on Computing*, 15:739–747, 1986.Google Scholar - [BDG88]J. Balcázar, J. Díaz, and J. Gabarró.
*Structural Complexity I*. Springer Verlag, 1988.Google Scholar - [Bei87]R. Beigel. A structural theorem that depends quantitavely on the complexity of SAT. In
*Proceedings 2nd Structure in Complexity Theory Conference*, pages 28–32. IEEE Computer Society Press, 1987.Google Scholar - [Bei88]R. Beigel. NP-hard sets are p-superterse unless R=NP. Technical Report 88-04, Johns Hopkins University, Baltimore, MD, USA, 1988.Google Scholar
- [Bei91]R. Beigel. Bounded queries to SAT and the boolean hierachy.
*Theoretical Computer Science*, 84(2):199–224, 1991.Google Scholar - [CGH+88]J. Cai, T. Gundermann, J. Hartmanis, L. Hemachandra, V. Sewelson, K. Wagner, and G. Wechsung. The boolean hierarchy I: Structural properties.
*SIAM Journal on Computing*, 17(6):1232–1252, 1988.Google Scholar - [Cha89]R. Chang. On the structure of bounded queries to arbitrary NP sets. In
*Proceedings 4th Structure in Complexity Theory Conference*, pages 250–258. IEEE Computer Society Press, 1989.Google Scholar - [Dil50]R. P. Dilworth. A decomposition theorem for partially ordered sets.
*Ann. of Math.*, 51:161–166, 1950.Google Scholar - [Gas91]W. Gasarch. Bounded queries in recursion theory: A survey. In
*Proceedings 6th Structure in Complexity Theory Conference*, pages 62–78. IEEE Computer Society Press, 1991.Google Scholar - [GHH]W. Gasarch, L. Hemachandra, and A. Hoene. On checking versus evaluating multiple queries.
*Information and Computation*. To appear.Google Scholar - [Hem89]L. Hemachandra. The strong exponential hierarchy collapses.
*Journal of Computer and System Sciences*, 39(3):299–322, 1989.Google Scholar - [Imm88]N. Immerman. Nondeterministic space is closed under complementation.
*SIAM Journal on Computing*, 17:935–938, 1988.Google Scholar - [Kad89]J. Kadin. P
^{NP[log n]}and sparse Turing complete sets for NP.*Journal of Computer and System Sciences*, 39:282–298, 1989.Google Scholar - [Knu73]D. Knuth.
*The Art of Computer Programming III*. Addison Wesley, second edition, 1973.Google Scholar - [Kre88]M. Krentel. The complexity of optimization problems.
*Journal of Computer and System Sciences*, 36:490–509, 1988.Google Scholar - [Mah82]S. Mahaney. Sparse complete sets for NP: solution to a conjecture of Berman and Hartmanis.
*Journal of Computer and System Sciences*, 25:130–143, 1982.Google Scholar - [PZ83]C. Papadimitriou and S. Zachos. Two remarks on the power of counting. In
*Proceedings 6th GI Conference on Theoretical Computer Science*, pages 269–276. Springer-Verlag Lecture Notes in Computer Science #145, 1983.Google Scholar - [Sch83]U. Schöning. A low and a high hierarchy in NP.
*Journal of Computer and system sciences*, 27:14–28, 1983.Google Scholar - [Sel81]A. Selman. Some observations on NP real numbers and P-selective sets.
*Journal of Computer and System Sciences*, 23:326–332, 1981.Google Scholar - [Sel82]A. Selman. Analogues of semirecursive sets and effective reducibilities to the study of NP complexity.
*Information and Control*, 1:36–51, 1982.Google Scholar - [Sze88]R. Szelepcsényi. The method of forced enumeration for nondeterministic automata.
*Acta Informatica*, 26:279–284, 1988.Google Scholar - [Wag90]K. Wagner. Bounded query classes.
*SIAM Journal on Computing*, 19(5):833–846, 1990.Google Scholar