1 Introduction
The motivation for this paper is to obtain a better understanding of randomized approximate counting inside #P.
The class #P [1] is the class of functions that count the number of solutions to problems in NP, e.g. #SAT is the function that on input a formula returns the number of satisfying assignments of
Equivalently, functions in #P count accepting paths of nondeterministic polynomial time Turing machines (NPTMs).
NPcomplete problems are hard to count, but it is not the case that problems in P are easy to count as well. When we consider counting, nontrivial facts hold. First of all there exist #Pcomplete problems, that have decision version in P, e.g. #DNF. Moreover, some of them can be approximated, e.g. the Permanent [2] and #DNF [3], while other can not, e.g. #IS [4].
Regarding approximability, counting versions of NPcomplete problems do not admit f.p.r.a.s. unless NP = RP. So we have to concentrate on problems whose decision version is not NPcomplete. There are two subclasses of #P that concern our study, because they have easy decision version; TotP and #PE [5]. #PE contains all counting problems in #P with decision version in P, and TotP contains functions that count all paths of NPTMs, and it is also proven to contain all selfreducible problems in #PE [6].
It is observed that all problems in #P known to admit f.p.r.a.s., belong to TotP. This observation lead to some questions. Which counting problems admit f.p.r.a.s. from a structural complexity perspective? Does FPRAS TotP hold? (In this paper we denote FPRAS the class of problems in #P that admit an f.p.r.a.s.) Is there an alternative characterization of FPRAS, in terms of counting paths of NPTMs, like the respective definitions of #P and TotP?
In this article we introduce two counting classes, #RP1 and #RP2, that can both be considered as counting versions of problems with decision version in RP. We show that FPRAS lies between them. We also show that these two classes are not equal, unless NP=RP.
Moreover we show that if FPRAS TotP, then RP=P. So we don’t resolve the question of FPRAS vs TotP, but it turns out that if the above inclusion holds, then it is more difficult to prove it, than proving RP=P. Note that for the opposite direction, i.e. TotP FPRAS, it is known that it holds iff NP=RP.
We further explore inclusions between all the above mentioned classes, i.e. #P, #PE, #RP1, #RP2, TotP and FPRAS, and we present all possible worlds with respect to NP vs RP, and RP vs P.
We present our results in section 3 and we discuss them in section 5. The rest of the paper is organized as follows. Section 2 contains definitions, lemmas and known results used in our proofs. Section 4 contains our proofs. Section 6 provides briefly some related work, and conclusions are given in section 7.
2 Preleminaries
Let be an NPTM. If returns or we denote (accepting paths of on input ). We denote the polynomial bounding the number of nondeterministic choices made by
Definition 1
[1] is the class of functions for which there exists a polynomialtime decidable binary relation and a polynomial such that , . Equivalently,
Definition 2
FP is the class of functions in #P computable in polynomial time.
Definition 3
The decision version of a function in #P is the language .
Definition 4
[7] .
Definition 5
[5] , where all computation paths of on input .
TotP contains all selfreducible problems in #P, with decision version in P.
Intuitively, selfreducibility means that counting the number of solutions to an instance of a problem, can be performed recursively by computing the number of solutions of some other instances of the same problem. For example #SAT is self reducible: the number of satisfying assignments of a formula is equal to the sum of the number of satisfying assignments of and , where is with its first variable fixed to .
The most general notion of self reducibility, that TotP can capture, is given in [6]. The following is known.
Theorem 1
[6]
(a) FP TotP . The inclusions are proper unless .
(b) TotP is the Karp closure of selfreducible functions.
We consider FPRAS to be the class of functions in #P that admit f.p.r.a.s.
Definition 6
Let . if there exists a randomized algorithm that on input returns a value s.t.
in time poly().
Theorem 2
(a) If NPRP then there are functions in TotP, that are not in FPRAS.
(b) If NP=RP then .
Proof. #IS (i.e. given a graph, count all independent sets, of all sizes) belongs to TotP, and does not admit f.p.r.a.s. unless NP=RP [4]. The second assertion derives from a Stockmeyer’s well known theorem [8], see Appendix for a proof sketch.
Now we introduce two classes, having decision version in RP. For that, we need to define the set of Turing Machines associated to problems in RP.
Definition 7
Let be an NPTM. We denote the polynomial s.t. on inputs of size , makes nondeterministic choices.
NPTM either or
Definition 8
#RP1 = s.t.
Definition 9
#RP2 =
For our proofs we will need the following lemma.
Lemma 1
Unbiased estimator. Let be two finite sets, and let . Suppose we take samples from uniformly at random, and let a be the number of them that belong to . Then is an unbiased estimator of , and it suffices in order to have
3 Results
We first present unconditional inclusions between the above mentioned classes. These inclusions together with those already known by theorem 1 can be summarised in the following diagram.
Then we explore more inclusions between these counting classes, with respect to NP vs RP and RP vs P. The results can be summarized in the figures of theorem 5.
The most important corollaries of this investigation are that FPRAS is not all contained in TotP unless RP=P, and #RP1 does not coincide with #RP2 unless NP=RP.
4 Proofs
4.1 Unconditional inclusions
Theorem 3
Also
Proof. Let . We will show . We will construct an NPTM s.t. on input . Let . computes . Then it computes s.t. . makes nondeterministic choices . Each such determines a path, in particular, corresponds to the path (since is the first path). returns yes iff , so . Since
The other inclusions are immediate by definitions.
Theorem 4
Proof. For the first inclusion, let Let . There exists a s.t. Let be the number of nondeterministic choices of Let . We can compute an estimate of by choosing paths uniformly at random. Then we can compute .
If then If , then so by the unbiased estimator lemma 1, satisfies the definition of f.p.r.a.s.
For the second inclusion, let , we will show that the decision version of , i.e. deciding if , is in RP. On input we run the f.p.r.a.s. for with e.g. We return yes iff
If the the f.p.r.a.s. returns
, so we return yes with probability
. If , then with probability at least , so we return yes with the same probability.Corollary 1
If then RP=P.
Proof. If FPRAS TotP, then #RP1 TotP, and then for all P. So if then , and thus P. Thus RP=P.
Corollary 2
If then NP=RP.
Proof. If then they are both equal to FPRAS, thus TotP FPRAS, thus NP=RP from theorem 2.
4.2 The four possible worlds
Now we will explore further relationships between the above mentioned classes, and we will present all four possible worlds inside #P, with respect to NP vs RP vs P.
Theorem 5
The following figures hold.
In the figures, means , means , and means .
Proof. First of all, intersections between any of the above classes are nonempty, because FP is a subclass of all of them. For the rest inclusions, we have the following.
#P#RP2 NP=RP (by definitions).
#RP2 #PE RP=P (by definitions).
#P TotP NP=P (by theorem 1). Also NP=P #SAT TotP, because #SAT is selfreducible, and it would have easy decision. Thus #P TotP, because TotP is the Karpclosure of self reducible problems with easy decision, and #SAT is #Pcomplete under Karp reductions. So we get #P = #PE = TotP P=NP.
TotP FPRAS NP=RP (by theorem 2).
#RP2 FPRAS TotP FPRAS NP=RP.
#RP2=#RP1 NP=RP (by corollary 2).
#P FPRAS NP=RP (by theorem 2).
#PE FPRAS TotP FPRAS NP=RP.
#PE #RP1 #PE FPRAS NP=RP.
#RP1 #PE RP=P (same proof as corollary 1).
FPRAS #PE #RP1 #PE RP=P.
FPRAS TotP RP=P (corollary 1).
TotP #RP1 TotP FPRAS NP=RP.
#RP1 TotP RP=P (same proof as corollary 1).
#RP1 FP #RP1 TotP RP=P.
TotP FP NP=P (by theorem 1).
5 Discussion and Further Research
Regarding the question of whether FPRAS TotP, Corollary 1 means that it does not hold unless P=RP, and if it holds, then it is more difficult to prove it, than proving RP=P.
Determining if RP=P implies FPRAS TotP, is an open question, interesting on its own. Morover, if it holds, then the (FPRAS TotP?) question would be an equivalent formulation of the RP vs P question. Note that we already know that the (TotP FPRAS?) question is an equivalent formulation of NP vs RP.
Corollary 2 means that although #RP1 and #RP2 are natural counting counterparts of RP, they can’t be equal unless NP=RP. This happens because when we consider functions in #P as functions that count the number of solutions to some decision problem, then in the first class the accepting random choices are in 11 correspondence with the solutions we want to count, while in the second class, random choices and solutions do not necessarily coincide.
It is interesting that regarding decision, the two analogue definitions of RP are equivalent, i.e. for every problem in RP, there exists an NPTM in deciding the problem, and vice versa. But for the counting versions, this can’t hold any more, unless NP=RP.
Regarding the possibility of characterizing FPRAS in terms of counting paths of Turing machines, Corollary 2 implies such a characterization, if the two classes coincide. However, in this case, as we saw, FPRAS would also be equal to #P, which of course is a much simpler characterization.
On the other hand, without any assumptions, theorem 4 means that the characterization of FPRAS that we are looking for, is something between the two definitions of #RP1 and #RP2, a relaxation of the first and a restriction of the second. However it might be not very elegant.
It is an open question whether FPRAS is in #RP1. It seems that both a negative and a positive answer are compatible with all four worlds. If the answer is positive, then #RP1 would be an equivalent characterization of FPRAS.
6 Related work
There is an enormous literature on approximation algorithms and inapproximability results for individual problems in #P, e.g. [1, 2, 3, 4, 9].
From a unifying point of view, the most important results regarding approximability are the following. Every function in #P either admits a f.p.r.a.s., or is inapproximable to within a polynomial factor [10]. For selfreducible problems in #P, f.p.r.a.s. is equivalent to almost uniform sampling [10]. With respect to approximation preserving reductions, there are three main classes of functions in #P: (a) the class of functions that admit an f.p.r.a.s., (b) the class of fuctions that are interreducible with #SAT under approximation preserving reductions, and (c) the class of problems that are interreducible with #BIS under approximation preserving reductions [11]. Problems in the second class are inapproximable unless NP=RP, while the approximability status of the third class is unknown.
7 Conclusions
In this paper we refined the picture of counting complexity inside #P, in particular with regard to approximate counting.
We have introduced two subclasses of #P: #RP1 and #RP2, that both can be considered as counting versions of RP. We showed that FPRAS lies between them, and that these classes do not coincide unless NP=RP. With the help of these classes we also proved that FPRAS cannot be contained in TotP, unless RP=P.
Finally we studied the implications of randomized decision complexity, i.e. RP vs NP, and RP vs P, to the relationships between some counting classes inside #P, that have decision version either in P or in RP.
Further research could be the study of the relationships between the new introduced classes with other known subclasses of #P, as mentioned in the related work section 6.
Appendix
Theorem 6
(folklore) If NP=RP then all problems in #P admit an f.p.r.a.s.
Proof. (sketch) In [8] Stockmeyer has proven that an f.p.r.a.s., with access to a oracle, exists for any problem in #P. If NP=RP then . Finally it is easy to see that an f.p.r.a.s. with access to a BPP oracle, can be replaced by another f.p.r.a.s., that simulates the oracle calls itself.
References
 [1] Leslie G. Valiant: The Complexity of Computing the Permanent. Theor. Comput. Sci. 8: 189201 (1979)

[2]
M. Jerrum and A. Sinclair: The Markov chain MonteCarlo method: an approach to approximate counting and integration. In Approximation Algorithms for NPhard Problems (Dorit Hochbaum, ed.), PWS, pp. 482– 520 (1996)
 [3] Richard M. Karp, Michael Luby, Neal Madras: MonteCarlo Approximation Algorithms for Enumeration Problems. J. Algorithms 10(3): 429448 (1989)
 [4] Martin E. Dyer, Alan M. Frieze, Mark Jerrum: On Counting Independent Sets in Sparse Graphs. SIAM J. Comput. 31(5): 15271541 (2002)
 [5] Aggelos Kiayias, Aris Pagourtzis, Kiron Sharma, Stathis Zachos: AcceptorDefinable Counting Classes. Panhellenic Conference on Informatics 2001: 453463.
 [6] Aris Pagourtzis, Stathis Zachos: The Complexity of Counting Functions with Easy Decision Version. MFCS 2006: 741752
 [7] A. Pagourtzis. On the complexity of hard counting problems with easy decision version. In Proceedings of the 3rd Panhellenic Logic Symposium, Anogia, Crete, 2001.
 [8] Larry J. Stockmeyer: On Approximation Algorithms for #P. SIAM J. Comput. 14(4): 849861 (1985)
 [9] Dror Weitz: Counting independent sets up to the tree threshold. STOC 2006: 140149
 [10] Alistair Sinclair, Mark Jerrum: Approximate Counting, Uniform Generation and Rapidly Mixing Markov Chains. Inf. Comput. 82(1): 93133 (1989)
 [11] Martin E. Dyer, Leslie Ann Goldberg, Catherine S. Greenhill, Mark Jerrum: The Relative Complexity of Approximate Counting Problems. Algorithmica 38(3): 471500 (2004)
 [12] Evangelos Bampas, AndreasNikolas Göbel, Aris Pagourtzis, Aris Tentes: On the connection between interval size functions and path counting. Computational Complexity 26(2): 421467 (2017)
 [13] Lane A. Hemaspaandra, Christopher M. Homan, Sven Kosub, Klaus W. Wagner: The Complexity of Computing the Size of an Interval. SIAM J. Comput. 36(5): 12641300 (2007)
 [14] Carme Alvarez, Birgit Jenner: A Very Hard logSpace Counting Class. Theor. Comput. Sci. 107(1): 330 (1993)
 [15] Sanjeev Saluja, K. V. Subrahmanyam, Madhukar N. Thakur: Descriptive Complexity of #P Functions. J. Comput. Syst. Sci. 50(3): 493505 (1995)
 [16] Andrei A. Bulatov, Víctor Dalmau, Marc Thurley: Descriptive complexity of approximate counting CSPs. CSL 2013: 149164
 [17] Marcelo Arenas, Martin Muñoz, Cristian Riveros: Descriptive Complexity for counting complexity classes. LICS 2017: 112
 [18] Víctor Dalmau: Linear datalog and bounded path duality of relational structures. Logical Methods in Computer Science 1(1) (2005)
Comments
There are no comments yet.