Draft:Karp-Luby algorithm

The Karp Luby algorithm, also known as Karp Luby Madras algorithm (or KLM algorithm for short) is a Monte-Carlo algorithm that can be used to estimate the size of a union of sets. The approach is particularly interesting because it only assumes that the membership and sampling queries are tractable to estimate the size of the union of sets efficiently.

In particular, the Karp Luby Madras algorithm can be applied to design an FPRAS estimating the number of solutions of a DNF formula, a problem that is known to be #P-complete to solve exactly.

Problem statement
The Karp Luby algorithm adresses the following problem: Given sets $$S_1, \dots, S_m \subseteq U$$, return a value $$\tilde{N}$$ that is a good approximation of $$N:=|\bigcup_{i=1}^m S_i|$$ with high probability.

It makes the following assumptions for each $$i \leq m$$:
 * The cardinality of $$S_i$$, denoted by $$|S_i|$$, is given.
 * One can test membership in $$S_i$$ in polynomial time, that is, given $$u \in U$$, one can decide whether $$u \in S_i$$ (referred to as a membership query).
 * One can uniformly sample elements from $$S_i$$ in polynomial time (referred to as a sampling query).

Under these assumptions, given $$\varepsilon>0, \delta>0$$, the Karp Luby algorithm returns a value $$\tilde{N}$$ such that $$Pr(|N-\tilde{N}| > \varepsilon) < \delta^{-1}$$ by doing a polynomial number (in $$m, \varepsilon^{-1}$$ and $$\log(\delta^{-1})$$) of sampling and membership queries.

Intuition and first version
As its core, the KLM algorithm is a Monte-Carlo algorithm. It works by sampling