A novel characterization of the complexity class Θ P k based on counting and comparison

The complexity class Θ P2 , which is the class of languages recognizable by deterministic Turing machines in polynomial time with at most logarithmic many calls to an NP oracle, received extensive attention in the literature. Its complete problems can be characterized by diﬀerent speciﬁc tasks, such as deciding whether the optimum solution of an NP problem is unique, or whether it is in some sense “odd” (e.g., whether its size is an odd number). In this paper, we introduce a new characterization of this class and its generalization Θ P k to the k -th level of the polynomial hierarchy. We show that problems in Θ P k are also those whose solution involves deciding, for two given sets A and B of instances of two Σ P k − 1 -complete (or Π P k − 1 -complete) problems, whether the number of “yes”-instances in A is greater than those in B . Moreover, based on this new characterization, we provide a novel suﬃcient condition for Θ P k -hardness. We also deﬁne the general problem Comp-Valid k , which is proven here Θ P k +1 -complete. Comp-Valid k is the problem of deciding, given two sets A and B of quantiﬁed Boolean formulas with at most k alternating quantiﬁers, whether the number of valid formulas in A is greater than those in B . Notably, the problem Comp-Sat of deciding whether a set contains more satisﬁable Boolean formulas than another set, which is a particular case of Comp-Valid 1 , demonstrates itself as a very intuitive Θ P2 -complete problem. Nonetheless, to our knowledge, it eluded its formal deﬁnition to date. In fact, given its strict adherence to the count-and-compare semantics here introduced, Comp-Valid k is among the most suitable tools to prove Θ P k -hardness of problems involving the counting and comparison of the number of “yes”-instances in two sets. We support this by showing that the Θ P2 -hardness of the Max voting scheme over m CP-nets is easily obtained via the new characterization of Θ P k introduced in this paper.


Introduction
In the quest of characterizing the exact computational complexity of problems, many complexity classes have been defined, and hard problems for them have been, and are currently being, sought. Among these classes, the polynomial(-time) hierarchy (PH) [34] aims at accurately classifying problems whose complexity lies between the classes of languages recognizable by deterministic Turing machines in polynomial time and in polynomial space. To this end, the notion of computation with oracles [1] (introduced initially in [5] with the name of query machine) is used in [34] to analyze the complexity of problems that can be solved by a Turing machine in P or in NP with the aid of an oracle to decide, at unit cost, strings of languages belonging to PH. In particular, the classes ∆ P k , Σ P k , and Π P k , for k ≥ 0, constitute the hierarchy: ∆ P 0 = Σ P 0 = Π P 0 = P, and, for k ≥ 1, ∆ P k+1 = P Σ P k , Σ P k+1 = NP Σ P k , and Π P k+1 = co-Σ P k+1 (more details are given in Section 2). These classes have proven themselves to be useful tools to classify the complexity of numerous natural problems, which have been shown to be complete for some classes of PH. 1 This highlights the strong relevance that the concept of computation with oracles has in complexity theory.
After the introduction of PH, research in computational complexity theory individuated some problems whose complexity could not be precisely captured by the classes of PH. One of them is Odd-Clique [35], which is the problem of deciding whether the size of the largest cliques of a graph is odd. Clearly, Odd-Clique is in ∆ P 2 , because a P machine can decide Odd-Clique via a binary search aided by an oracle in NP. However, Odd-Clique is not ∆ P 2 -hard. In fact, only logarithmically many queries need to be issued to the oracle, and this could be a clue for Odd-Clique not being among the hardest problems of ∆ P 2 , which, instead, for their solution require P machines performing polynomially many calls to their NP oracles. Therefore, to precisely capture this kind of problems, the class of languages that can be recognized by a P machine issuing at most logarithmic many calls to an NP oracle, also denoted P NP[O(log n)] (where "[O(log n)]" denotes the logarithmic restriction on the maximum number of allowed oracle calls), was defined [27,23,21,37,4].
Unlike the nondeterministic levels Σ P k = NP Σ P k−1 of PH, for which bounding the allowed number of calls to the oracle do not impose any factual constraint on the computational power of the machine, i.e., NP Σ P k−1 [O(1)] = NP Σ P k−1 [O(log n)] = NP Σ P k−1 [37], for the deterministic levels of the hierarchy, this does not seem to be the case. In fact, clearly, P Σ P k−1 [O(1)] ⊆ P Σ P k−1 [O(log n)] ⊆ P Σ P k−1 , however, it is currently unknown whether the inclusion is strict. On the other hand, Odd-Clique was proven to be complete for the class Θ P 2 = P NP[O(log n)] [35]. This supported the widely accepted conjectures that Θ P 2 = ∆ P 2 and that, for all k ≥ 2, Θ P k = ∆ P k [37], where Θ P k = P Σ P k−1 [O(log n)] , which suggested to include the classes Θ P k as constitutional components of PH [36,37]. In recent years, many natural problems have been shown to be complete for Θ P 2 (see, e.g., [35,23,21,37,6,7,33] and references therein). 2 These Θ P 2 -complete problems are usually characterized by the task of: (1) deciding whether the optimum value (i.e., maximum or minimum value) of an NP problem belongs to a set of values (or intervals) given in input [35]; (2) deciding whether the optimum value of an NP problem is odd/even [35,21,4,23,33]; (3) deciding whether the optimum solution of an NP problem is unique [21]; (4) comparing the optimum solutions of two instances of NP-complete problems [33]; see also [6] for more references. Another characterization of a Θ P 2 -complete (resp., Θ P k -complete) problem is based on directed trees whose nodes are parametric queries to an NP (resp., Σ P k−1 ) oracle, where the directed tree encodes the dependence structure among the oracle queries [9]. Furthermore, Θ P 2 is captured by first-order logic extended by Henkin quantifiers [10].
More recently, also various problems in voting theory and computational social choice were shown to be complete for Θ P 2 [29,19,18,25]. These complexity results come as no surprise to us, since, as we will show in this paper, Θ P 2 is also the class of problems involving the task of counting "yes"-instances of NP sets, followed by a comparison of the counts (which is similar to what would be done in a voting procedure that requires counting (and comparing) ballots to determine the winner). 3 A result suggesting that problems in Θ P 2 can be characterized in this way appeared only in [33]. However, to our knowledge, in the literature, neither a single complete problem based on this idea has ever been shown (even in [33] itself there is no problem characterized in this way), nor this characterization has ever been pushed forward or extended to Θ P k . Note that this semantics of counting and comparing the number of "yes"-instances of two NP-complete problems is very different from (4) above. Indeed, deciding, given two graphs G and H, whether the smallest vertex covers of G are smaller than the smallest vertex covers in H (which is a problem analyzed in [33]) is very different from this paper's deciding, given two sets G = { G 1 , p 1 , . . . , G n , p n } and H = { H 1 , q 1 , . . . , H m , q m } of pairs graph, integer , whether the number of graphs G i having a vertex cover not bigger than p i is greater than the number of graphs H j having a vertex cover not bigger than q j .
Showing this "counting of yes-instances and comparison" characterization of Θ P k is exactly what we pursue in this paper. In particular, we will show that problems whose solution requires the comparison of the number of "yes"-instances of two sets containing instances of Σ P k−1 -complete or Π P k−1 -complete languages, are Θ P k -hard. To our knowledge, this characterization of Θ P k is new in the literature, and also its specialization to Θ P 2 , as already mentioned, has not been extensively investigated so far. Moreover, this result allows us to provide a new sufficient condition for a problem to be Θ P k -hard. Interestingly, we also show that problems requiring the comparison of the number of "yes"-instances of a set containing instances of a Σ P k−1 -complete problem and a set containing instances of a Π P k−1 -complete problem are computationally easier, since they can be solved in subclasses of Θ P k (more specifically, in Σ P k−1 or Π P k−1 ). Furthermore, by exploiting the characterization given in this paper, we also define the following general Θ P k+1 -complete problem Comp-Valid k (observe the different subscripts, k + 1 and k, respectively): given a pair A, B of sets of quantified Boolean formulas with at most k alternating quantifiers, decide whether the number of valid formulas in A is greater than those in B. To our knowledge, this is the first time that such a problem is proposed and shown to be Θ P k+1 -complete. In addition, Comp-Sat, which is a particular case of Comp-Valid 1 , is a very intuitive Θ P 2 -complete problem whose hardness lies in the difficulty of comparing the number of satisfiable Boolean formulas in two sets. Thus, it is a very good candidate for reductions to prove Θ P 2 -hardness of problems involving the comparison of the number of "yes"-instances of two sets containing instances of NP-complete problems. Comp-Sat is the first Θ P 2 -complete problem of this kind. In fact, it was successfully used to prove the Θ P 2 -hardness of a voting problem 2 Note that in the literature, Θ P 2 was proven to be equivalently characterized by different definitions (see, e.g., [6,37]), and thus Θ P 2 -complete problems are often shown to be complete for apparently different (but actually identical) classes. 3 Interestingly, several problems in computational game theory are complete for various classes of PH and ∆ P 2 in particular. Among them, there are a number of different tasks related to the solution concepts of coalitional games (see, e.g., [13,14,15,16]).
in [25], and, given its adherence to the counting-and-comparison semantics, this was fairly simple. In this respect, we actually believe that Comp-Valid k is the ideal problem when a reduction is needed for a Θ P k+1 -hard problem involving counting and comparison. In this paper, the Θ P 2 -completeness of Comp-Sat comes as an easy corollary of the Θ P k+1 -completeness of Comp-Valid k , and we do not need a tailored reduction as in [25]. The rest of this paper is organized as follows. Section 2 provides some preliminaries on complexity theory. In Section 3, after an overview of this paper's results, we analyze the new characterization of Θ P k , and we also prove that Comp-Valid k is Θ P k+1 -complete. In Section 4, we show how the results presented here can be easily applied to prove the Θ P 2 -hardness of the Max voting scheme over mCP-nets. Finally, Section 5 is devoted to conclusions.

Preliminaries
In this section, we briefly recall some basics from complexity theory on decision problems, the complexity classes of the polynomial hierarchy (PH), and their prototypical hard problems. For more on this, the reader is referred to any standard textbook on the topic, such as [26], or the survey [20].

Decision problems and complexity classes
Decision problems are maps from strings (encoding the input instance over a fixed alphabet, e.g., the binary alphabet {0, 1}) to the set {"yes", "no"}. For a decision problem (or, equivalently, a language) L, χ L denotes the characteristic function of L, which is the function that, for a string s, χ L (s) = 1, if s is a "yes"-instance of L, and χ L (s) = 0, if s is a "no"-instance of L. Deciding a language (or a problem) L means, for a given instance s, deciding whether s is a "yes"-instance of L or not. For a language L, L is the language complement to L if and only if all the "yes"-instances of L are "no"-instances of L, and all the "no"-instances of L are "yes"-instances of L.
A (deterministic) Turing machine M decides a language L, if M halts in an accepting state on an input string s if and only if χ L (s) = 1. Nondeterministic Turing machines are Turing machines that, at some points of their computation, may not have just one single next action to perform, but a choice between several possible next actions. A nondeterministic Turing machine M decides a problem L, if, on any input string s, (i) if χ L (s) = 1, there is at least one sequence of choices leading M to halt in an accepting state (such a sequence is called accepting computation path); and (ii) if χ L (s) = 0, all possible sequences of choices of M lead to a rejecting state.
A complexity class is a set of languages that can be decided by Turing machines of a specific sort (i.e., either deterministic or nondeterministic) within a given bound of computational resources. These computational resources characterizing complexity classes are essentially computation time, working space, and, as we will see later, the possibility to access to a computation oracle. For a complexity class C, co-C denotes the class of languages whose complements are in C. With a slight abuse of terminology, we say that a Turing machine M belongs to a complexity class C, if M is of the sort and uses the amount of computational resources characterizing the class C.
The class P is the set of decision problems that can be solved by a deterministic Turing machine in polynomial time with respect to the input size, i.e., with respect to the length of the string that encodes the input instance. For a given input string s, its size is usually denoted by s .
The class of decision problems that can be solved by nondeterministic Turing machines in polynomial time is denoted by NP. They enjoy a remarkable property: any "yes"-instance s has a certificate for being a "yes"-instance, which has polynomial length and can be checked in deterministic polynomial time (in s ). For example, deciding whether a Boolean formula φ(X) over the Boolean variables X = {x 1 , . . . , x n } is satisfiable, i.e., whether there exists some truth assignment to these variables making φ true, is a well-known problem in NP; in fact, any satisfying truth assignment for φ is clearly a certificate that φ is a "yes"-instance, i.e., that φ is satisfiable. On the other hand, the problem of deciding whether a Boolean formula φ is not satisfiable is in co-NP. Clearly, the class P is contained in both NP and co-NP, i.e., P ⊆ NP ∩ co-NP.
We will also refer to a type of computation called computation with oracles. Intuitively, oracles are subroutines that are supposed to have unit cost. A Turing machine M ? with oracle, is a Turing machine that during its computation can ask to its oracle to decide a string at unitary cost. The definition of the machine M ? is independent from its oracle, and the symbol "?" indicates that different oracles for different languages can be "attached" to M [26]. If A is a language, by M A we denote that the oracle attached to M ? decides A. If C is a (deterministic or a nondeterministic) time complexity class, and A is a language, C A denotes the class of languages that can be decided by Turing machines of the sort and the time bound of C that can moreover query an oracle for A. 4 By extension, for a time complexity class C, and a generic complexity class D, C D denotes the class of languages that can be decided by Turing machines of the sort and the time bound of C that can moreover query an oracle for a language in D. In the following, when we say that a Turing machine M queries an oracle in D, or a D oracle, we mean that M queries an oracle for a language in D.
The classes Σ P k , Π P k , and ∆ P k , forming the polynomial hierarchy (PH) [34], are defined as follows: Σ P 0 = Π P 0 = ∆ P 0 = P, and, for all k ≥ 1, Σ P k = NP Σ P k−1 , ∆ P k = P Σ P k−1 , and Π P k = co-Σ P k . Here, Σ P k (resp., ∆ P k ) is the class of languages recognizable by nondeterministic (resp., deterministic) polynomial-time Turing machines with an oracle to recognize, at unit cost, a language in Σ P k−1 . Note that Σ P 1 = NP Σ P 0 = NP P = NP, Π P 1 = co-Σ P 0 = co-NP, and ∆ P 1 = P Σ P 0 = P P = P. Sometimes, a bound is imposed on the number of the allowed oracle calls, highlighted in brackets besides the oracle class. For example, P Σ P k−1 [O(log n)] denotes the class of languages recognizable by a deterministic polynomial-time Turing machine that is allowed to query a Σ P k−1 oracle at most logarithmic many times (in the size of the input). In particular, classes Θ P k = P Σ P k−1 [O(log n)] were proposed to be included in the standard definition of the PH as well [36,37]. To this end, we pose Θ P 0 = P, and observe that Θ P 1 = P. Note that Θ P k and ∆ P k are deterministic classes, as the machine calling the oracle is deterministic. This implies that Θ P k and ∆ P k are closed under complement, i.e., Θ P k = co-Θ P k and ∆ P k = co-∆ P k . Given their definitions, for all k ≥ 1, the relationships among the mentioned classes are as follows (see, e.g., [36,37]):

Prototypical hard problems
We now recall the notion of reducibility among decision problems. A decision problem L 1 is (Karp) reducible to a decision problem L 2 , denoted by L 1 ≤ L 2 , if there is a computable function h (called reduction) such that, for every string s, h(s) is defined, and s is a "yes"-instance of L 1 if and only if h(s) is a "yes"-instance of L 2 , i.e., for all strings s, χ L1 (s) = χ L2 (h(s)). This type of reduction is called Karp reduction. A decision problem L 1 is polynomially (Karp) reducible to a decision problem L 2 , denoted by L 1 ≤ p L 2 , if there is a polynomial-time (Karp) reduction from L 1 to L 2 . In this paper we will consider only polynomial-time Karp reductions. A decision problem L is hard for a class C of the PH at any level k ≥ 1, i.e., beyond P, or C-hard, if every problem in C is polynomially reducible to L; if L is hard for C and belongs to C, then L is complete for C, or C-complete. Thus, problems that are complete for C are the most difficult problems in C. In particular, they cannot belong to some lower class in the hierarchy, unless some collapse of the hierarchy's levels occurs.
An n-ary Boolean function f is a mapping f : {true, false} n → {true, false} from the n-dimensional Boolean space to a Boolean value. A way to represent n-ary Boolean functions is through Boolean formulas φ(X) over the set of Boolean variables X = {x 1 , . . . , x n }. Boolean formulas are inductively constructed from Boolean variables via the unary Boolean operator ¬ and the binary Boolean operators ∧ and ∨. Boolean variables x 1 , . . . , x n and their negations ¬x 1 , . . . , ¬x n are called literals. A clause and a term are a disjunction and a conjunction of literals, respectively. A Boolean formula is in conjunctive normal form (or CNF ), if it is a conjunction of clauses, while it is in disjunctive normal form (or DNF ), if it is a disjunction of terms. For example, 5 A Boolean formula is in 3CNF (resp., 3DNF ), if the number of literals of each clause (resp., term) is exactly three.
Deciding the satisfiability of Boolean formulas is the prototypical NP-complete problem, which remains NP-hard even if only 3CNF formulas are considered [8,22]; we denote this problem by Sat. The complementary problem Unsat of deciding whether a given Boolean formula is not satisfiable is co-NP-complete. It remains co-NP-hard even if only 3CNF formulas are considered, and it is the equivalent to the problem Taut of deciding whether a 3DNF formula is a tautology.

A previous characterization of Θ P k
Wagner [35,37] analyzed extensively the properties of Θ P 2 and underlined that his results can be generalized to upper levels of the PH. In particular, we report below two key results of Wagner [37] in their generalized form to Θ P k .
A first result intuitively states that, for any language B ∈ Θ P k+1 , the task of deciding B can be faithfully transformed into the task of deciding, for a suitable language C ∈ Σ P k and a suitable sequence y 1 , . . . , y n of C's instances with χ C (y 1 ) ≥ . . . χ C (y n ), whether the maximum index i for which y i is a "yes"-instance of C is odd. The formulation of the following lemma results from a combination of the statements of the equivalent lemmas in [37,3,4].
Note that, in the statement of the previous lemma, p( x ) is a polynomial, because the function f is polynomial-time computable.
A second result gives a sufficient condition for the Θ P k+1 -hardness of a problem B. Intuitively, this result states that B is Θ P k+1 -hard, if there exists a reduction to B from the problem of deciding, for a given set k+1 -hardness of B remains proven even if sets X are assumed to be such that χ A (x 1 ) ≥ · · · ≥ χ A (x n ).

A new characterization of Θ P k and its hard problems
In this section, we provide a new characterization of Θ P k based on the counting-and-comparison semantics. In particular, we first give an overview of the results obtained, and then we look at the details of the proofs.

Overview of results
The first results that we obtain are the analogues of those that are reported in this paper as Lemmas 2.1 and 2.2, and are broad general theoretical results for the complexity classes Θ P k . In particular, on the one hand, we show that, for any language B ∈ Θ P k+1 , the task of deciding B can be faithfully transformed into the task of deciding, for two suitable languages C 1 , C 2 ∈ Σ P k and two suitable sequences y 1 , . . . , y n and z 1 , . . . , z m of C 1 's and C 2 's instances, respectively, with χ C1 (y 1 ) ≥ · · · ≥ χ C1 (y n ) and χ C2 (z 1 ) ≥ · · · ≥ χ C2 (z n ), whether the maximum index i for which y i is a "yes"-instance of C 1 is bigger than the maximum index j for which z j is a "yes"-instance of C 2 .
On the other hand, we show also that, a problem B is Θ P k+1 -hard, if there exists a reduction to B from the problem of deciding, for a given pair of sets X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y m } of instances of two (not necessarily distinct) problems A 1 and A 2 , respectively, being both of them either Σ P k -complete or Π P k -complete, whether the number of "yes"-instances of A 1 in X is greater than the number of "yes"-instances of A 2 in Y . Interestingly, the hardness holds even if sets X and Y are assumed to be such that The previous result is shown via an intermediate theorem stating that, if A 1 and A 2 are two (not necessarily distinct) Σ P k -complete (or Π P k -complete) problems, for any pair of sets X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y m } of instances of A 1 and A 2 , respectively, deciding whether the number of "yes"-instances of A 1 in X is greater than the number of "yes"-instances of A 2 in Y is Θ P k+1 -hard. Clearly, this problem is also in Θ P k+1 , and hence Θ P k+1 -complete. Therefore, problems in Θ P k+1 can actually be exactly characterized also by this semantics of counting and comparison. We also show that if A 1 and A 2 are one in Σ P k and the other in Π P k , then comparing the number of "yes"-instances of the two sets is actually a problem belonging to subclasses of Θ P k+1 . In particular, if A 1 is in Σ P k , and A 2 is in Π P k , then the comparison can be done in Σ P k . Symmetrically, if A 1 is in Π P k , and A 2 is in Σ P k , then the comparison can be done in Π P k . After these general results, we define the problem Comp-Valid k that is based on the idea of counting and comparison, and we prove it Θ P k+1 -complete. Comp-Valid k is defined as follows. Given a pair A, B of sets of QBFs with at most k alternating quantifiers, decide whether the number of valid formulas in A is greater than the number of valid formulas in B. We stress here that the formulas in A and B are neither restricted to have the same outermost quantifier, nor to have the same number of alternating quantifiers. To our knowledge, this is the first time in the literature that such a problem Comp-Valid k is defined and shown to be Θ P k+1 -complete. Furthermore, we also prove that the hardness of Comp-Valid k holds even if |A| = |B|, all formulas in A, B are instances of QBF CNF k,∃ (resp., QBF DNF k,∀ ), have the same number of clauses (resp., terms), and, for each 1 ≤ d ≤ k, quantifiers Q d of all formulas in A, B are defined on the very same set of variables. As it will emerge from the proof, the Θ P k+1 -hardness of Comp-Valid k requires that the number of formulas in the sets A and B with actually k alternating quantifiers is unbounded.
By combining the results of the theorems proven in this section, Figure 1 summarizes the complexity of Comp-Valid k , according to the various types of formulas contained in A and B. Figure 1: Summary of the complexity results for Comp-Valid k when specific types of formulas are in sets A and B. Comp-Valid k is actually complete for the respective complexity classes shown in the tables.

Formulas in
The problem Comp-Valid 1 , when all formulas are furthermore restricted to be instances of QBF CNF 1,∃ (i.e., Sat), is equivalent to the problem Comp-Sat introduced in [25], which is: Given a pair A, B of sets of 3CNF formulas, decide whether the number of satisfiable formulas in A is greater than the number of satisfiable formulas in B. By the results proven in this paper, Comp-Sat is Θ P 2 -complete, and it is Θ P 2 -hard even if all the formulas have the same number of clauses and are defined over the same set of variables.

Derivation of the general results
In this section, we prove the results anticipated above. In fact, besides the concepts of verification of optimum solutions, "oddity" of optimum solutions, uniqueness of optimum solutions, and comparison of optimum solutions (see, e.g., [35,21,6,33]), we show that a problem is Θ P k -hard if, for its solution, it is required to count the number of "yes"-instances of two sets A and B of instances of Σ P k -complete, or Π P k -complete, languages, and compare the computed numbers.
The following result is the analogue of Lemma 2.1 for the new characterization of Θ P k . Intuitively, it states that, for any language B ∈ Θ P k+1 , the task of deciding B can be faithfully transformed into the task of deciding, for two suitable languages C 1 , C 2 ∈ Σ P k and two suitable sequences y 1 , . . . , y n and z 1 , . . . , z m of C 1 's and C 2 's instances, respectively, with χ C1 (y 1 ) ≥ · · · ≥ χ C1 (y n ) and χ C2 (z 1 ) ≥ · · · ≥ χ C2 (z n ), whether the maximum index i for which y i is a "yes"-instance of C 1 is bigger than the maximum index j for which z j is a "yes"-instance of C 2 .
The idea behind the proof is the following. By Wagner's Lemma 2.1, since B ∈ Θ P k+1 , there is a language C ∈ Σ P k and a polynomial-time computable function f such that, for any instance x of B, f (x) is a sequence w 1 , . . . , w p of instances of C with χ C (w 1 ) ≥ · · · ≥ χ C (w p ), and x is a "yes"-instance of B if and only if the maximum index for which w is a "yes"-instance of C is odd. Essentially, what is done in the proof is "splitting" the sequence w 1 , . . . , w p into two new sequences y 1 , . . . , y n and z 1 , . . . , z m of instances of C 1 and C 2 , respectively. The first of the new sequences contains strings w with odd, while the second one contains strings w with even. Now, if the maximum index for which w is a "yes"-instance of C is odd, then that particular instance is in the first of the new sequences, and hence the maximum index i for which y i is a "yes"-instance of C 1 is bigger than the maximum index j for which z j is a "yes"-instance of C 2 (because, in this case, the maximum j would equal i − 1). Proof.
(⇒) Let us assume that B ∈ Θ P k+1 . By Lemma 2.1, there exist a problem C ∈ Σ P k and a polynomial-time computable function f such that, for all instances Now, consider languages C 1 and C 2 such that C 1 = C 2 = C (i.e., for any string x, χ C1 (x) = χ C2 (x) = χ C (x)). Clearly, since C ∈ Σ P k , C 1 and C 2 belong to Σ P k as well. Functions f 1 and f 2 are defined from f as follows. Assume that for an instance x of B, f (x) = w 1 , . . . , w p( x ) . On the one hand, function and z j = w 2j for all j. Intuitively, f 1 (x) produces the sequence of strings of f (x) with odd index, while f 2 (x) produces the sequence of strings of f (x) with even index. By their definition, f 1 and f 2 are polynomial-time computable, because f is polynomial-time computable. Moreover, since χ C (w 1 ) ≥ · · · ≥ χ C (w p( x ) ), χ C1 (y 1 ) ≥ · · · ≥ χ C1 (y p1( x ) ) and χ C2 (z 1 ) ≥ · · · ≥ χ C2 (z p2( x ) ), as well. Now, observe that (⇐) Let us now assume that there exist two problems C 1 , C 2 ∈ Σ P k and two polynomial-time computable functions f 1 and f 2 such that, for any instance x of B, f 1 We are going to show that B ∈ Θ P k+1 by exhibiting a Turing machine in P that can decide B by querying logarithmic many times an oracle in Σ P k . Consider a deterministic polynomial-time Turing machine M that can query an oracle in Σ P k for C 1 and C 2 . Observe that it is sufficient to devise a single oracle receiving in input also a variable which tells the oracle to decide either C 1 or C 2 . Given the existence of those specific problems, C 1 and C 2 , and functions, f 1 and f 2 , in order for M to decide whether an input string x is a "yes"-instance of B or not, it is sufficient to compute the max values max i and max j of i and j such that χ C1 (y i ) = 1 and χ C2 (z j ) = 1, respectively, and compare them. M can compute max i as follows. First, M computes f 1 (x) = y 1 , . . . , y p1( x ) . M can do so because f 1 is polynomial-time computable. Next, since χ C1 (y 1 ) ≥ · · · ≥ χ C1 (y p1( x ) ) (i.e., all the "yes"-instances of C 1 are at the beginning of the sequence), max i can be computed via a binary search. In fact, by asking to the oracle whether the various y i are "yes"-instances of C 1 , M can perform such a binary search in the range [1, p 1 ( x )] and compute max i . Observe that M needs to issue only a logarithmic number of calls to its oracle. Similarly, M can compute max j . Clearly, the overall procedure is feasible in P Σ P k [O(log n)] = Θ P k+1 . Note that, also in this case, in the statement of the previous lemma, p 1 ( x ) and p 2 ( x ) are polynomials, because functions f 1 and f 2 are polynomial-time computable.
From the theorem above, the next theorem follows, stating that, for two given sets X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y m } of instances of two (not necessarily distinct) Σ P k -complete problems A 1 and A 2 , respectively, deciding whether the number of "yes"-instances of A 1 in X is greater than the number of "yes"-instances of A 2 in Y is Θ P k+1 -hard. Interestingly, the hardness holds even if it is assumed that χ A1 (x 1 ) ≥ · · · ≥ χ A1 (x n ) and χ A2 (y 1 ) ≥ · · · ≥ χ A2 (y m ), and n = m.
The main idea behind the proof is the following. We know that, to prove the Θ P k+1 -hardness of a problem, we have to show that there exists a polynomial reduction from any problem D ∈ Θ P k+1 . If D is a problem belonging to Θ P k+1 , by Theorem 3.1, there exist two problems E 1 , E 2 ∈ Σ P k and two polynomial-time computable functions f 1 , f 2 such that, for all instances v of D, f 1 (v) = w 1 , . . . , w p1 is a sequence of E 1 's instances with χ E1 (w 1 ) ≥ · · · ≥ χ E1 (w p1 ), f 2 (v) = z 1 , . . . , z p2 is a sequence of E 2 's instances with χ E2 (z 1 ) ≥ · · · ≥ χ E2 (z p2 ), and v is a "yes"-instance of B if and only if max i , that is the maximum index i for which w i is a "yes"-instance of E 1 , is bigger than max j , that is the maximum index j for which z j is a "yes"-instance of E 2 . However, since χ E1 (w 1 ) ≥ · · · ≥ χ E1 (w p1 ) and χ E2 (z 1 ) ≥ · · · ≥ χ E2 (z p2 ), max i and max j are actually the number of "yes"-instances of E 1 and E 2 in w 1 , . . . , w p1 and z 1 , . . . , z p2 , respectively. Furthermore, by A 1 and A 2 being Σ P k -complete, there exist polynomial reductions h 1 and h 2 from E 1 to A 1 and from E 2 to A 2 , respectively. Intuitively, the composition of f 1 with h 1 and of f 2 with h 2 provides the reduction sought.
Proof. Let us denote by CC the task of counting and comparing the number of "yes"-instances in the sets X and Y . We are going to prove the hardness of CC by showing that any problem D in Θ P k+1 is polynomially reducible to CC . Let D be any problem in Θ P k+1 . By Theorem 3.1, there exist two problems E 1 , E 2 ∈ Σ P k and two polynomial-time computable function f 1 and f 2 such that, for all instances v of D, f 1 Furthermore, since E 1 , E 2 ∈ Σ P k , and A 1 and A 2 are Σ P k -complete, there exist polynomial reductions h 1 and h 2 such that χ E1 (w) = 1 ⇔ χ A1 (h 1 (w)) = 1 for all strings w, and χ E2 (z) = 1 ⇔ χ A2 (h 2 (z)) = 1 for all strings z.
Similarly, for two given sets X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y m } of instances of two (not necessarily distinct) Π P k -complete problems A 1 and A 2 , respectively, deciding whether the number of "yes"-instances of A 1 in X is greater than the number of "yes"-instances of A 2 in Y is Θ P k+1 -hard. Also in this case, the hardness holds even if it is assumed that χ A1 (x 1 ) ≥ · · · ≥ χ A1 (x n ) and χ A2 (y 1 ) ≥ · · · ≥ χ A2 (y m ), and n = m. The proof is based on the fact that Π P k -complete problems are the complement of Σ P k -complete ones. Therefore, sets X and Y can be rearranged so that Theorem 3.2 can be used.

Theorem 3.3. Let A 1 and A 2 be two (not necessarily distinct) Π P
k -complete problems. Then, for a given pair of sets X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y m } of instances of A 1 and A 2 , respectively, deciding whether Hardness holds even if the sets X and Y are assumed to be such that χ A1 (x 1 ) ≥ · · · ≥ χ A1 (x n ) and χ A2 (y 1 ) ≥ · · · ≥ χ A2 (y m ), and n = m.
Proof. Let us assume n = m, and remember that A 1 and A 2 denote the complement problems to A 1 and A 2 , respectively. Clearly, A 1 and A 2 are Σ P k -complete problems. Let us define, A 1 = A 2 , and A 2 = A 1 (note the inversion of the subscripts). Let X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y n } be two sets of instances of A 1 and A 2 , respectively, such that χ A 1 (x 1 ) ≥ · · · ≥ χ A 1 (x n ) and χ A 2 (y 1 ) ≥ · · · ≥ χ A 2 (y n ). From Theorem 3.2, we know that deciding whether |{x i : χ A 1 (x i ) = 1}| > |{y j : χ A 2 (y j ) = 1}| is Θ P k+1 -hard. Starting from X and Y , we define sets X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y n }, where x i = y n−i+1 , and y j = x n−j+1 . Intuitively, we put in X the elements of Y in inverted order, and we put in Y the elements of X in inverted order. By their definitions, X and Y are sets of instances of A 1 and A 2 , respectively, and χ A1 (x 1 ) ≥ · · · ≥ χ A1 (x n ) and χ A2 (y 1 ) ≥ · · · ≥ χ A2 (y n ). Observe that It is interesting to see that, for two given sets X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y m } of instances of problems A 1 and A 2 , respectively, if A 1 is in Σ P k , and A 2 is in Π P k , then deciding whether |{x i : χ A1 (x i ) = 1}| > |{y j : χ A2 (y j ) = 1}| is actually computationally easier than Θ P k+1 , in particular, it is in Σ P k . The intuition behind this simplification of the problem is the following. If there are p "yes"-instances in X, and q "no"-instances in Y , and p + q > |Y |, then |{x i : χ A1 (x i ) = 1}| > |{y j : χ A2 (y j ) = 1}|. Therefore, if this is the case, it suffices to guess the p "yes"-instances in X, and the q "no"-instances in Y . Guessing the p "yes"-instances in X is feasible by an NP machine, and guessing the q "no"-instances in Y is feasible in NP as well (because A 2 is in a "complement" class). Essentially, if A 1 ∈ Σ P k and A 2 ∈ Π P k , we do not need to actually count precisely the number of "yes"-instances in X and Y . Theorem 3.4. Let A 1 be a Σ P k -complete problem and A 2 be a Π P k -complete problem. Then, for a given pair  of sets {x 1 , . . . , x n } and {y 1 , . . . , y m } of instances of A 1 and A 2 , respectively, deciding whether |{x if and only if there are p "yes"-instances of A 1 in X and q "no"-instances of A 2 in Y such that p + q > |Y |.
On the other hand, for two given sets X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y m } of instances of problems A 1 and A 2 , respectively, if A 1 is in Π P k and A 2 is in Σ P k , then deciding whether |{x i : χ A1 (x i ) = 1}| > |{y j : χ A2 (y j ) = 1}| is in Π P k . The reason for the simplification of this task is similar to the previous. If there are p "no"-instances in X, and q "yes"-instances in Y , and p + q ≥ |X|, then |{x i : χ A1 (x i ) = 1}| ≤ |{y j : χ A2 (y j ) = 1}| (note the inversion of the relationship between the two terms). Therefore, if this is the case, it suffices to guess the p "no"-instances in X, and the q "yes"-instances in Y . Guessing the p "no"-instances in X is feasible by an NP machine (because A 1 is in a "complement" class), and guessing the q "yes"-instances in Y is feasible in NP as well. Essentially, to answer "no", if A 1 ∈ Π P k and A 2 ∈ Σ P k , we do not need to actually count precisely the number of "yes"-instances in X and Y . Theorem 3.5. Let A 1 be a Π P k -complete problem, and A 2 be a Σ P k -complete problem. Then, for a given pair of sets {x 1 , . . . , x n } and {y 1 , . . . , y m } of instances of A 1 and A 2 , respectively, deciding whether |{x i : Membership and hardness can be proven by a similar line of argumentation as in the proof of Theorem 3.4. We only have to prove, which is left to the reader, that |{x i : χ A1 (x i ) = 1}| ≤ |{y j : χ A2 (y j ) = 1}| (i.e., {x 1 , . . . , x n } and {y 1 , . . . , y m } are a "no"-instance) if and only if there are p "no"-instances of A 1 in {x 1 , . . . , x n } and q "yes"-instances of A 2 in {y 1 , . . . , y m } such that p + q ≥ |X|. By exploiting this property, it can be shown that deciding whether |{x i : χ A1 (x i ) = 1}| ≤ |{y j : χ A2 (y j ) = 1}| is feasible in Σ P k , and hence deciding |{x i : χ A1 (x i ) = 1}| > |{y j : χ A2 (y j ) = 1}| is feasible in Π P k . To conclude this part, we show the analogue of Lemma 2.2 for the new characterization of Θ P k , which directly descends from Theorems 3.2 and 3.3, and provides a new sufficient condition for the Θ P k+1 -hardness of a problem. Intuitively, it states that, a problem B is Θ P k+1 -hard, if there exists a reduction to B from the problem of deciding, for a given pair of sets X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y m } of instances of two (not necessarily distinct) Σ P k -complete (or, Π P k -complete) problems A 1 and A 2 , respectively, whether the number of "yes"-instances of A 1 in X is greater than the number of "yes"-instances of A 2 in Y . Similarly to Wagner's result, this result holds even if it is assumed that χ A1 (x 1 ) ≥ · · · ≥ χ A1 (x n ) and χ A2 (y 1 ) ≥ · · · ≥ χ A2 (y m ) (and n = m). Theorem 3.6. Let A 1 and A 2 be two Σ P k -complete (resp., Π P k -complete) problems, and let B be a problem. Then, B is Θ P k+1 -hard, if there exists a polynomial-time computable function f such that, for all pair of sets X = {x 1 , . . . , x n } and Y = {y 1 , . . . , y m } of instances of A 1 and A 2 , respectively, it holds that (|{x i : χ A1 (x i ) = 1}| > |{y j : χ A2 (y j ) = 1}|) ⇔ χ B (f (X, Y )) = 1. The Θ P k+1 -hardness of B remains proven even if sets X and Y are assumed to be such that χ A1 (x 1 ) ≥ · · · ≥ χ A1 (x n ) and χ A2 (y 1 ) ≥ · · · ≥ χ A2 (y m ), and n = m.

Complexity of Comp-Valid k
We now prove Comp-Valid k Θ P k+1 -complete. In the following, for a set S of QBFs, #val(S) denotes the number of valid formulas in S. To show Comp-Valid k 's membership in Θ P k+1 , we use two problems LBound-Valid k,∃ and UBound-Valid k,∀ defined as follows. A pair S, n , where S is a set of QBFs with at most k alternating quantifiers, whose outermost quantifier is ∃, and 0 ≤ n ≤ |S| is an integer, is a "yes"-instance of LBound-Valid k,∃ whenever #val(S) ≥ n. On the other hand, a pair S, n , where S is a set of QBFs with at most k alternating quantifiers, whose outermost quantifier is ∀, and 0 ≤ n ≤ |S| is an integer, is a "yes"-instance of UBound-Valid k,∀ whenever #val(S) ≤ n. We show that both these problems are feasible in Σ P k . Intuitively, this is the case, because, to decide LBound-Valid k,∃ , it is sufficient to guess n valid formulas in S (feasible in NP), and then ask to a Π P k−1 oracle that the guessed formulas are actually valid. A similar intuition is also behind the complexity of UBound-Valid k,∀ . Indeed, to decide UBound-Valid k,∀ , it is sufficient to guess |S| − n non-valid formulas in S (feasible in NP), and then ask a Π P k−1 oracle that the guessed formulas are actually non-valid. Proof. We first focus on LBound-Valid k,∃ . Let S, n be an instance of LBound-Valid k,∃ . Since all the . . , X i p ), with p ≤ k, we can guess the indices {j 1 , . . . , j n } of a set of n valid formulas, along with the complete assignments σ X 1 over X 1 , for each ∈ {j 1 , . . . , j n }, witnessing their validity. This guess is polynomial in size, and hence it can be carried out by an NP machine. Given such a guess, for each ∈ {j 1 , . . . , j n }, we can check the validity of Φ by checking the validity of Φ = (∀X 2 )(∃X 3 ) . . . (Q p X p )φ (X 1 /σ X 1 , X 2 , . . . , X p ) through a call to a Π P k−1 oracle (because p − 1 ≤ k − 1). Clearly, the overall procedure is feasible in Σ P k . For UBound-Valid k,∀ the proof is similar. Let S, n be an instance of UBound-Valid k,∀ . Since all the . . , X i p ), we can guess the indices {j 1 , . . . , j m } of a set of m = |S|−n non-valid formulas, along with the complete assignments σ X 1 over X 1 , for each ∈ {j 1 , . . . , j m }, witnessing the non-validity of the guessed formulas. Clearly, if there are |S| − n non-valid formulas in S, then there at most n valid formulas in S. Also this guess is polynomial in size, and hence it can be performed by an NP machine. Given such a guess, for each ∈ {j 1 , . . . , j m }, we can check that Φ is non-valid by checking that ¬Φ = (∀X 2 )(∃X 3 ) . . . (Q p X p )¬φ (X 1 /σ X 1 , X 2 , . . . , X p ) is valid through a call to a Π P k−1 oracle (because p − 1 ≤ k − 1). Also in this case, the overall procedure is feasible in Σ P k . We are now ready to show that Comp-Valid k is Θ P k+1 -complete. We first prove its membership in Θ P k+1 . Intuitively, Comp-Valid k is in Θ P k+1 because, for its solution, it is sufficient to count the number of valid formulas in the sets A and B. This can be done by a binary search exploiting two oracles for LBound-Valid k,∃ and UBound-Valid k,∀ , respectively. The former is needed to count valid quantified formulas whose outermost quantifier is ∃, while the latter is used to count valid quantified formulas whose outermost quantifier is ∀. We can partition A in two subsets A ∃ and A ∀ , containing the formulas whose outermost quantifier is ∃ and ∀, respectively. Clearly, |A| = |A ∃ | + |A ∀ |. We can count the number of valid formulas belonging to A ∃ and A ∀ , via a binary search in the range [0, |A|], by a Turing machine in P querying an oracle for LBound-Valid k,∃ and UBound-Valid k,∀ , respectively. Observe that it is sufficient to devise a single oracle with a variable in the input to ask the oracle to decide either LBound-Valid k,∃ or UBound-Valid k,∀ . The number of valid formulas of B can be computed similarly. Notice that the number of queries submitted to the oracle is logarithmic in the size of the input, and that LBound-Valid k,∃ and UBound-Valid k,∀ belong to Σ P k (see Lemma 3.7). Thus, the overall procedure is feasible in P Σ P k [O(log n)] = Θ P k+1 .
We next prove that Comp-Valid k is Θ P k+1 -hard. The reduction to show the Θ P k+1 -hardness of Comp-Valid k is a direct application of Theorems 3.2 and 3.3. In fact, counting and comparing the number of valid QBFs of two given sets is essentially counting and comparing the number of "yes"-instances in the two sets containing instances of the problems QBF CNF k,∃ (or QBF DNF k,∀ ). Furthermore, we also prove that the hardness of Comp-Valid k holds even if |A| = |B|, all formulas in A, B are instances of QBF CNF k,∃ (resp., QBF DNF k,∀ ), have the same number of clauses (resp., terms), and, for each 1 ≤ d ≤ k, quantifiers Q d of all formulas in A, B are defined on the very same set of variables. To prove that this restriction on the structure of the formulas does not influence the hardness of the problem, we show that a generic instance of Comp-Valid k can always be rewritten in polynomial time in an instance fulfilling the required constraints. Note that, in the following proof showing the Θ P k+1 -completeness of Comp-Valid k , for the hardness to hold, it is required that the number of formulas in the sets A and B with actually k alternating quantifiers is unbounded. Proof. We first show that hardness of Comp-Valid k holds even over the class I of instances A, B such that |A| = |B|, and all formulas in A and B are instances of QBF CNF k,∃ (resp., QBF DNF k,∀ ). In particular, for the class I, we neither restrict formulas of the instances in I to have the same number of clauses (resp., terms), nor their quantifiers to be defined on the same set of variables. We prove hardness by applying Theorems 3.2 and 3.3.
Consider now the special case in which formulas of the instances are restricted to have the same number of clauses (resp., terms), and their quantifiers are restricted to be defined over the same set of variables. We show that a generic instance of Comp-Valid k in I can be reduced in polynomial time to an instance satisfying these restrictions. The idea is to rewrite formulas considering first each quantifier in turn, from the outermost to the innermost, in order to have the quantifiers defined on the very same sets of variables. After the formulas are rewritten so that all quantifiers are defined over the same sets of variables, if necessary, the number of clauses (resp., terms) among the formulas is made equal. Note that there is no need to perform any "balancing of the number of quantifiers", since all formulas of the instances in I are instances of QBF CNF k,∃ (resp., QBF DNF k,∀ ), and hence all of them have the very same number of nested quantifiers. In the following, we assume that all QBFs are instances of QBF CNF k,∃ , i.e., all QBFs are of the form Φ = (Q 1 X 1 ) . . . (Q k X k )φ (X 1 , . . . , X k ) with Q k = ∃ and φ being in CNF. The case that all QBFs are instances of QBF DNF k,∀ can be proven in a similar way. First, let us consider the procedure to have the quantifiers defined over the same sets of variables. Quantifiers are processed from the outermost to the innermost, and exactly one quantifier is processed at a time. Assume that Q d is the currently considered quantifier.
If necessary, we balance the number of variables in the sets X d among the various formulas Φ . If there are Subsequently, we rewrite all formulas Φ with |X d | < max d by: (i) extending X d toX d by adding fresh variables, so that |X d | = max d ; (ii) adding to φ , for each variable x ∈X d \X d , dummy satisfiable clauses of three literals (x∨¬x∨x), so that the new variables appear in the non-quantified part. Since (∃x)(x ∨ ¬x ∨ x) and (∀x)(x ∨ ¬x ∨ x) are both always valid, adding clauses like (x ∨ ¬x ∨ x) does not alter the validity of the formulas, irrespective of the considered quantifier Q d being ∃ or ∀, or k being even or odd. At the end of this procedure, all quantifiers are defined over the same number of variables. Now, if necessary, we can rename the variables so that those sets contain the very same elements. We denote byφ the new non-quantified part of the formulas obtained after the rewriting, whileΦ denotes the new quantified formulas after the rewriting.
In a second phase, if necessary, we balance the number of clauses in the various formulas. If there are two formulasΦ i ,Φ j ∈ A ∪ B such that the number of clauses inφ i is different from the number of clauses inφ j , then we compute max cl = maxΦ ∈A∪B {number of clauses ofφ }. After this, we rewrite all formulasΦ whose formulaφ has less clauses than max cl by adding dummy satisfiable clauses of three literals (x ∨ ¬x ∨ x), where x is any variable of the formula. Again, note that adding clauses like (x ∨ ¬x ∨ x) does not alter the validity of the formulas, irrespective of the considered quantifier Q d being ∃ or ∀, or k being even or odd.
The just described rewriting of formulas in A and B is feasible in polynomial time.
It is interesting to note that, given the particular statements of Theorems 3.2 and 3.3, Comp-Valid k remains Θ P k+1 -hard even in the case in which the sets X = {Φ 1 , . . . , Φ n } and Y = {Ψ 1 , . . . , Ψ m } of the quantified formulas are assumed to be such that Φ 1 ⇐ · · · ⇐ Φ n and Ψ 1 ⇐ · · · ⇐ Ψ m , i.e., all the valid formulas are at the beginning of the lists (have the smallest indices in the sets).

Applications of the new characterization
In this section, we show that the new characterization for Θ P k (and, more specifically, for Θ P 2 ) introduced in this paper provides a powerful tool to prove Θ P k -hardness of problems whose semantics is tightly linked to the one of counting and comparison. In particular, we select a problem taken from the area of computational social choice. The selected problem is the Max voting scheme over mCP-nets, which are a tool to represent preferences in groups based on CP-nets. CP-nets [2] are a graphical preference model, and they are among the most studied preference models, as the vast literature on them demonstrates. In CP-nets, graph vertices represent features, and an edge from vertex A to vertex B models that A's value influences the choice of B's value. Intuitively, this model captures preferences like "given that the rest of the dinner does not change, with a fish dish (A's value), I prefer a white wine (B's value)". Intuitively, an outcome is a particular configuration of the features in the domain at hand, i.e., an outcome is an object assigning a value to every feature. For a CP-net N , β N α denotes that the outcome β is preferred to the outcome α according to the preferences modeled in N , and β N α denotes that β and α are incomparable in N .
In mCP-nets, a set of CP-nets is used to model the preferences of each agent in a group. Preferences for groups of agents in mCP-nets are defined through voting schemes. In particular, through their own individual CP-nets, each agent votes whether an outcome is preferred to another, and different ways of collecting votes (i.e., different voting schemes) give rise to different dominance semantics for mCP-nets. Various voting schemes were proposed for mCP-nets [28,24], and here we focus on the Max voting scheme [28].
More precisely, an mCP-net M is a collection N 1 , . . . , N m of m CP-nets defined over the same set of features which, in turn, have the same possible values. The "m" of an mCP-net stands for "multiple" agents and also indicates that the preferences of m agents are modeled in the net, so a 3CP-net is an mCP-net with m = 3. Note that, although the features of the individual CP-nets are the same, the graph structure of the individual nets may be different, i.e., the links between the features in the various individual CP-nets may vary.
Let M = N 1 , . . . , N m be an mCP-net, and let α, β be two outcomes. We define the sets S M (α, β) = {i | α Ni β}, S ≺ M (α, β) = {i | α ≺ Ni β}, and S M (α, β) = {i | α Ni β}, which are the sets of the agents of M preferring α to β, preferring β to α, and for which α and β are incomparable, respectively. The Max voting is defined as follows: the outcome β max dominates the outcome α, denoted by β max M α, if the group of the agents of M preferring β to α is the biggest, i.e., |S M (β, α)| > max(|S ≺ M (β, α)|, |S M (β, α)|). For any given outcome γ, it is possible to design a CP-net D(γ) for which γ is the optimum outcome [25]. For any 3CNF Boolean formula φ, it is possible to design two different CP-nets, F (φ) and F (φ), such that, for two specific outcomes α and β, β F(φ) α (resp., α F(φ) β) if and only if φ is satisfiable, and β F(φ) α (resp., α F(φ) β) if and only if φ is unsatisfiable [25]. Below, we will refer again to the outcomes α and β just mentioned. With these nets, it is possible to show that deciding Max dominance is Θ P 2 -hard. Consider a generic instance A, B of Comp-Sat, where A and B are two sets of 3CNF Boolean formulas defined over the very same set of variables, having the same number of clauses, and such that |A| = a and |B| = b. From A, B , it is possible to build a 3(a + b)CP-net M max ( A, B ) such that β max Mmax( A,B ) α if and only if A, B is a "yes"-instance of Comp-Sat. In particular, the agents of M max ( A, B ) are: • for each formula φ i ∈ A, there is an agent whose CP-net is N A,i = F (φ i ); • for each formula ϕ j ∈ B, there is an agent whose CP-net is N B,j = F (ϕ j ); • there are a + b agents whose preferences are encoded by the CP-net D(α); and • there are a + b agents whose preferences are encoded by the CP-net D(β). Given the above construction it is possible to show the following.

Conclusion
In this paper, we have introduced a new characterization for the class Θ P k in general and for Θ P 2 in particular. We have shown that problems belonging to Θ P k+1 are also those involving the task of counting and comparing the number of "yes"-instances of two sets A and B of Σ P k -complete (or Π P k -complete) problem instances. Moreover, we have also shown that this new characterization is sufficient to entail the Θ P k+1 -hardness of the problem at hand. In fact, if the problem involves the task of counting and comparing the number of "yes"-instances of two sets of Σ P k -complete (or Π P k -complete) problems instances, then the problem is Θ P k+1 -hard. On the other hand, we have proven that this problem becomes computationally easier when the instances of sets A and B are of a Σ P k -complete and of a Π P k -complete problem, respectively. We have complemented this work by providing also the Θ P k+1 -complete problem Comp-Valid k , which is deciding, given two sets A and B of quantified Boolean formulas with k alternating quantifiers, whether the number of valid formulas in A is greater than the number of the valid formulas in B. The results shown here prove that its specialization Comp-Valid 1 , when only existentially quantified CNF Boolean formulas are considered, (= Comp-Sat), which is the very natural and intuitive problem of deciding whether the number of satisfiable CNF Boolean formulas of a set is bigger than the number of satisfiable CNF Boolean formulas of another set, is Θ P 2 -complete. Comp-Valid k (resp., Comp-Sat) proves to be an ideal candidate when one needs a reduction to show Θ P k+1 -hardness (resp., Θ P 2 -hardness) of a problem involving the task of counting and comparison. In fact, the Θ P 2 -hardness of Comp-Sat is an easy corollary of the Θ P k+1 -hardness of Comp-Valid k , and it was successfully used to easily prove the Θ P 2 -hardness of a voting problem in [25].