Docsity

Approximate Counting in CS880: Approximations Algorithms, Study notes of Approximation Algorithms

Toggle sidebar
bg1
CS880: Approximations Algorithms
Scribe: Matt Darnall Lecturer: Shuchi Chawla
Topic: Apporximate Counting Date: 4/12/07
24.1 Definitions
We will attempt to approximate a function that counts something. Typically, we are interested in
finding the number of solutions to an NP-Complete problem, which is of course harder than solving
the NP-Complete problem itself. So many such problems are # P-complete. An example of this is
the number of ways to satisfy a statement in disjunctive normal form. A good algorithm for ap-
proximating a function will be an FPRAS or Fully Polynomial Randomized Approximation Scheme.
An algorithm Ais a FPRAS for a function fif given an instance Xof the problem, for any
,
P r |A(X)−f(X)|
f(X)< <1/4
and the algorithm runs in time polynomial in the length of Xand 1/. The algorithm is just a
PRAS if it runs in time polynomial in the length of X, but not in 1/.
What we are looking for is an algorithm Asuch that:
P r [A(X)∈((1 −)f(X),(1 + )f(X))] <1−δ
where the runtime is polynomial in the size of X, 1/, and log(1/δ). By iterating, an FPRAS will
give this to us.
24.2 Disjuntive Normal Form Counting
The problem we shall look at is counting the number of truth assignments to variables xisuch that
the statement Dis satisfied. Dis forced to look like D1∨ · · · ∨ Dm, where each Diis a conjunction
of variables xi1∧ ·· · ∧ xik.
Let Ube the set of all assigments, Sbe the set of satisfying assignments. We shall approxi-
mate |S|by randomizing selecting elements of Uand testing for membership in S. Then, if we test
tsamples from Uand t0are from S, we know that:
|S|
|U|≈t0
t
so our estimate is |S|=t0|U|/t. If p=|S|/|U|is our probability of pulling a member of S, we get
by Chernoff bounds that:
P r |t0−pt|> pt< e 2pt
3
1
pf3

Partial preview of the text

Download Approximate Counting in CS880: Approximations Algorithms and more Study notes Approximation Algorithms in PDF only on Docsity!

CS880: Approximations Algorithms

Scribe: Matt Darnall Lecturer: Shuchi Chawla Topic: Apporximate Counting Date: 4/12/

24.1 Definitions

We will attempt to approximate a function that counts something. Typically, we are interested in finding the number of solutions to an NP-Complete problem, which is of course harder than solving the NP-Complete problem itself. So many such problems are # P-complete. An example of this is the number of ways to satisfy a statement in disjunctive normal form. A good algorithm for ap- proximating a function will be an FPRAS or Fully Polynomial Randomized Approximation Scheme.

An algorithm A is a FPRAS for a function f if given an instance X of the problem, for any ,

P r

[

|A(X) − f (X)| f (X)

]

and the algorithm runs in time polynomial in the length of X and 1/. The algorithm is just a PRAS if it runs in time polynomial in the length of X, but not in 1/.

What we are looking for is an algorithm A such that:

P r [A(X) ∈ ((1 − )f (X), (1 + )f (X))] < 1 − δ

where the runtime is polynomial in the size of X, 1/, and log(1/δ). By iterating, an FPRAS will give this to us.

24.2 Disjuntive Normal Form Counting

The problem we shall look at is counting the number of truth assignments to variables xi such that the statement D is satisfied. D is forced to look like D 1 ∨ · · · ∨ Dm, where each Di is a conjunction of variables xi 1 ∧ · · · ∧ xik.

Let U be the set of all assigments, S be the set of satisfying assignments. We shall approxi- mate |S| by randomizing selecting elements of U and testing for membership in S. Then, if we test t samples from U and t′^ are from S, we know that:

|S| |U |

t′ t

so our estimate is |S| = t′|U |/t. If p = |S|/|U | is our probability of pulling a member of S, we get by Chernoff bounds that:

P r

[

|t′^ − pt| > pt

]

< e

^2 pt 3

Thus, taking t = log(1 − δ)/(^2 p) will get us within 1 ±  of |S| with probability greater than 1 − δ. The only thing that can make this not polynomial time is if p is small. This means that |S| is small relative to |U |.

If we use Chebyshev’s inequality instead of Chernoff, we get that:

P r

[

|t′^ − pt| > pt

]

V ar(t′) ^2 p^2 t^2

Since V ar(t′) = p(1 − p)t, we need to take t = (1 − p)/(^2 pδ). In order to reduce the dependence on δ, we use the ”‘median of means”’ method. Now, if we let δ = 1/4, and we run the experiment with t = 4(1 − p)/(^2 p 2∆ + 1 times, we expect about (2∆ + 1)/4 of our trials to fall out of the (1 ± ) range of the actual solution. Specifically, the probability that the median of the 2∆ + 1 trials with t = 4(1 − p)/(^2 p falls outside the (1 ± ) range of the actual solution is less than the probability that ∆ + 1 of the trials falls out of the (1 ± ) range of the actual solution. This probability, by Chernoff, is less than (3/4)s. Thus, by running t trials O(log(1/δ)) times, and taking the median of these answers, we are within (1 ± ) of the acutal solution with probability 1 − δ.

24.3 Reducing U

It is evident when analyzing the value of t that making the ratio p = |S|/|U | small is crucial to limiting the runtime. We shall look at a method for reducing the universe U for our example of solutions to a DNF statement. Let the statement D be made up of m clauses Di that are con- juntions of the literals or their negation. Let the solutions of Di be Si. Notice that S is just the union of the Si and each Si has size 2n−ki^ , where there are ki literals in Di and n literals in total. Although we can easily estimate |Si|, it is hard to get an estimate of their union because of repitition.

Our new universe, U ′^ shall be the set of pairs (i, ai), i ≤ m where ai is an element of Si. No- tice that sampling from U ′^ at random is easy, we just pick a random i and then pick a random assignment to the variables not in Di. In order for this to be uniform, we pick i with probability proportional to |Si|, we we can do since cacluting |Si| is easy (just 2 to the power of the number of literals in Si). The variables in Di are fixed. We need a way to imbed the set S inside our new universe U ′^ and a quick way to test membership in S. To do this, let every assignment, s, of the variables that satisfies D be associated with the first Di that is satisfies. In other words, our embedded S′^ is the set of (i, s), where s ∈ S and i ≤ m is the first Di that s satisfies. Since it satisfies at least one of the Di, we know that this assignment is counted exactly once in the set U ′, so S′^ is of the same size as S. Importantly, since there are only m clauses, and each element in S′ is associated with a clause, |S′|/|U ′| is greater than 1/m. Thus, we have made p larger than the inverse of the size of the instance, and our number of trials t can be polynomial in the size of the instance.