Counting satisfying assignments of a DNF formula: #DNF #
SharpDNF φ is the number of satisfying assignments of a formula φ in disjunctive normal form
over variables numbered by ℕ: the assignments of the variables occurring in φ that satisfy it
(Cslib.Logic.PL.DNF.modelCount). Deciding whether a formula in disjunctive normal form is
satisfiable is easy, but counting its satisfying assignments exactly is #P-complete
Valiant. It nevertheless has a fully polynomial randomized approximation scheme,
the estimator of Karp, Luby and Madras Karp, Luby and Madras,
Mitzenmacher and Upfal, Section 11.2
(Cslib.Complexity.SharpDNF.mem_FPRAS).
Main definitions #
Cslib.Complexity.SharpDNF: the number of satisfying assignments.
Main results #
Cslib.Complexity.KarpLubyMadras.isFPRAS: the Karp–Luby–Madras estimator is a fully polynomial randomized approximation scheme for#DNF.Cslib.Complexity.SharpDNF.mem_FPRAS:#DNFhas a fully polynomial randomized approximation scheme.Cslib.Complexity.KarpLubyMadras.approx_estimate: the guarantee for real relative error and failure probability.
References #
#DNF: the number of satisfying assignments of a formula in disjunctive normal form over
variables numbered by ℕ, counting assignments of the variables occurring in the formula.
The Karp–Luby–Madras estimator is an FPRAS for #DNF Karp, Luby and
Madras: on a formula with m terms, it runs dyadicSize m * 3 (t + 1) p ^ 2
trials and its estimate is within relative error 1 / p of the number of models with probability
at least 1 - (1 / 2) ^ t.
The guarantee for real parameters: run with p = ⌈1 / ε⌉ and t = ⌈log₂ ⌈1 / δ⌉⌉, the
Karp–Luby–Madras estimator is within relative error ε of the number of models with probability
at least 1 - δ.
#DNF has a fully polynomial randomized approximation scheme Karp, Luby and Madras.