# Counting solutions of Monotone-2CNF formulas

A Monotone-2CNF formula is a CNF formula where each clause is composed by exactly 2 positive literals.

Now, I have a Monotone-2CNF formula $F$. Let $S$ be the set of $F$'s satisfying assignments. I also have an oracle $O$ which is able to give the following information:

1. The cardinality of the set $S$ (i.e. the number of solutions of $F$).
2. Given a variable $x$:
• The number of solutions in $S$ containing the positive literal $x$.
• The number of solutions in $S$ containing the negative literal $\lnot x$.
3. Given 2 variables $x_1$ and $x_2$:
• The number of solutions in $S$ containing $x_1 \land x_2$.
• The number of solutions in $S$ containing $x_1 \land \lnot x_2$.
• The number of solutions in $S$ containing $\lnot x_1 \land x_2$.
• The number of solutions in $S$ containing $\lnot x_1 \land \lnot x_2$.

Note that the oracle $O$ is "limited": it works only on $F$, it can't be used on a formula $F' \neq F$.

Question:

Given 3 variables $x_1$, $x_2$, $x_3$ is it possible to determine the number of solutions in $S$ containing $\lnot x_1 \land \lnot x_2 \land \lnot x_3$ in polynomial time, using $F$ and the information provided by $O$?

Note:

You can replace $\lnot x_1 \land \lnot x_2 \land \lnot x_3$ in the question with whatever else of the 8 possible combinations of $x_1$, $x_2$, $x_3$. The problem would remain the same.

Empirical fact:

I came across the following empirical fact one week ago. Let $S_{\lnot x_1 \land \lnot x_2} \subset S$ be the set of those solutions containing $\lnot x_1 \land \lnot x_2$, and let $S_{\lnot x_1 \land \lnot x_2 \land x_3} \subset S$ be the set of those solutions containing $\lnot x_1 \land \lnot x_2 \land x_3$. Now, it seems to be the case that, if condition $C$ holds, this relationship also holds:

$\frac{|S_{\lnot x_1 \land \lnot x_2}|}{|S_{\lnot x_1 \land \lnot x_2 \land x_3}|} \simeq \phi$

where $\phi = 1.618033...$ is the golden ratio. Condition $C$ seems to be the following: "$x_1$, $x_2$, $x_3$ are mentioned in $F$ almost the same number of times".

• When you say "solutions containing the negative literal -x" -- do you mean "solutions with x=0"?
– Noam
Oct 11, 2010 at 9:33
• @Noam: Yes, exactly. Oct 11, 2010 at 9:42
• Easy observation: since the number of possible questions to the oracle O is polynomially bounded, without loss of generality you can query all questions at the beginning of an algorithm. Therefore, we can replace the oracle by additional input, with a promise that those numbers are correct. I think that this promise formulation is slightly simpler than considering it as an oracle. Oct 11, 2010 at 10:31
• @Tsuyoshi: Yes, I agree with you. Oct 11, 2010 at 12:00
• @vzn: The decision version of 2CNF is in $P$. This is the counting version of the monotone case (given a monotone 2CNF formula $F$, you have to compute how many satisfying assignments it has). Mar 18, 2012 at 8:43

To use that empirical fact you really want to know whether approximate numbers can give others approximate numbers. But for the exact case, I think there may be a straightforward way to show this is hard. Here's a sketch.

First note that satisfying assignments correspond to independent sets in a graph. I'll use the phrase "S-projections of I(G)" to describe the function mapping $T \subset S$ to the number of independent sets I with $I \cap S = T$. The "k-projections" are the S-projections for all subsets S of V with $|S|=k$.

Proof outline:

1. If 2-projections give 3-projections, they also give k-projections in polytime for each k.
2. If 2-projections give 4-projections, then the number of independent sets of a graph is in FP, so FP=#P.

(1) Let $k\geq 3$ such that (k-1)-projections give k-projections. Given a graph, its k-projections, and $x_1,...,x_k,v \in G$, we will compute the projections onto ${x_1,...,x_k,v}$.

Define the graph $G'$ by attaching a fresh vertex to v. This can be seen as weighting v. The (k-1)-projections of $G'$ can be computed because we know the k-projections of G. So then we have the k-projections of $G'$. And this gives ${x_1,...,x_k,v}$-projections of G.

(2) Given a graph, order the edges ${e_1,...,e_m}$ and define $G_k$ to have edges ${e_1,...,e_k}$. The 2-projections of $G_{k+1}$ can be computed from the 4-projections of $G_k$. The number of independent sets in $G_0$ is $2^{|G|}$. Iteratively the 4-projections of G can be computed in polynomial time.

• I would prefer not to use that empirical fact! I prefer the exact count of course. But incidentally I noticed that fact while trying to determine the exact count. Oct 12, 2010 at 9:36
• Thanks for your answer. Yes, it's hard: as you say, a positive answer to this question would imply #P = FP. Oct 12, 2010 at 9:48

Some observations, not an answer.

Further to the note to the question, any combination of 3 literals can be expressed in terms of any other combination of literals on the same variables, together with a small number of terms that the oracle can provide. This follows from looking at the Venn diagram of 3 intersecting sets, and expressing each of the 8 regions in terms of the other regions. Note that this does not require the formula to be either monotone or 2CNF.

It is also clear that the number of solutions satisfying any 3-literal conjunct can be expressed as the sum of $2^{n-3}$ terms, each of which is either 0 or 1, expressing a particular assignment to all variables. Each of these can be evaluated in linear time, but there are exponentially many terms to evaluate, so this doesn't satisfy the requirements.

Hence the question is really about whether it is possible to exploit the property of being monotone 2CNF to compress this exponential-size expression to polynomial size.

I tried to look at a simpler question, restricting the oracle to just an advice string with the number of solutions, when the counts for single or pairwise literal combinations are not available. I cannot see any way to exploit knowledge of the number of solutions to obtain a quick calculation of the number of solutions with respect to any single literal.

Is there something about monotone 2CNF that would allow the number of solutions in $S$ containing $x_1$ to be obtained quickly, if one knew $|S|$?

• Indeed, the given information needs to be powerful enough to defeat the underlying hardness. It is known that there is no fpras for solutions to monotone 2-SAT unless NP = RP.
– mhum
Oct 12, 2010 at 1:12
• @Andras: What here is called "oracle" is just some sort of dictionary $D$. It seems the case that such dictionary $D$ can be constructed incrementally, by updating it each time a new clause is added to $F$. The problem is that, in order to correctly update $D$, I have to answer this question. Oct 12, 2010 at 7:25
• @Walter: Yes, I understand that. My point is that even a much simpler case is not clear: going from the total number of solutions to the number of solutions containing a single literal. Oct 12, 2010 at 7:29
• It could be that your formula is essentially linear: independent sets in a path follow the Fibonacci sequence. One way to see this is that the partition function (1 1; 1 0) has phi as an eigenvalue. Oct 12, 2010 at 14:01
• I happened to find some slides discussing a more rigorous result: isid.ac.in/~antar/Talks/Counting-Hard-Core_KBS_slides.pdf (see page 11) Oct 15, 2010 at 11:22