CSE 525: Randomized Algorithms Fall 2026 Lecture 3: DNF Counting and Unreliability Lecturer: Shayan Oveis Gharan 04/02/2026 Scribe:
Disclaimer: These notes have not been subjected to the usual scrutiny reserved for formal publications.
3.1 Recap from CSE 521: Unbiased Estimators
We say a random variable is an unbiased estimator of if
It turns out the the number of samples is proportional to the relative variance of .
Definition 3.1 (Relative Variance).
Say is an unbiased estimator of , then, the relative variance of is defined as
| (3.1) |
where by is the variance of . We typically use to denote the relative variance.
The following theorem is the main result of this section.
Theorem 3.2.
Given , and an unbiased estimator of , . We can approximate within multiplicative factor using only independent samples of with probability .
Monte Carlo Simulation.
Suppose we want to estimate the size of a set . There is a generic approach called the Monte Carlo simulation. First, we find a univere that has the following two properties:
-
•
We know the size of
-
•
We can efficiently sample from .
We sample an element randomly from and test whether it belongs to . Let be the corresponding indicator random variable. It follows that is an unbiased estimator of with relative variance, . So, we can estimate within a multiplicative factor by generating many samples from .
3.2 FPRAS for DNF Counting
A DNF is conjunction of clauses where each of them is a disjunction of literals, e.g., . Consider a DNF with variables. Obviously the problem of finding a satisfying assignment for a DNF is in P. We want to count the number of satisfying assignment to a DNF. Here we prove the following theorem:
Theorem 3.3 ([KLM89]).
There is an FPRAS for the DNF counting problem.
Following the Monte Carlo sampling method, we can let be the set of satisfying assignments to the given DNF. If is the set of all truth assignments to the variables then it has the desired properties. So, by the discussion in the previous section we would need to generate many samples. So, this would work only if is within a polynomial factor of ; but what if it is exponentially smaller?
The ida of Karp, Luby and Madras [KLM89] is to choose the univese carefully such that is within a polynomial factor of . In fact, they consider a more general problem. Suppose we have sets of a ground set of elements and we want to estimate . First, of all observe that we always have
So, the idea is to construct an artificial universe of size . How can we do that? It is enough that for each ground element , and for every set where put a distinct copy of in :
By definition .
Now suppose we know the sizes of all ’s and we can sample a u.r. element from each efficiently. Then, we claim that is an ideal universe:
-
•
We can compute the size of exactly.
-
•
To sample an element uniformly at random from , we first sample with probability . Then, we sample a uniformly random element from .
Now, let and notice that . So, we need identify some of the elements of with ; in particular, for each element , let be the smallest index such that ; we identify with . So, to run the the Monte Carlo method, we first sample an element from and then we check whether by simply checking wether is the smallest index where contains .
In our DNF counting problem each corresponds to the set of assignments that satisfy the -th clause. Obviously if the -th clause has literals, , and we can sample efficiently from simply by fixing every literal that appears in to be true and choosing rest uniformly at random.
3.3 Network Unreliability
As an application we discuss an algorithm for the network unreliability problem. Given a network of vertices where each edge disappears independently with probability determine the probability that the surviving network is disconnected.
In this lecture for simplicity we assume that all ’s are equal to and we define to denote the failure probability of the whole network. We prove the following theorem of Karger [Kar95]. Also, see [Kar16] for a much faster algorithm.
Theorem 3.4 ([Kar95]).
There is an FPRAS for the network reliability problem. That is given , and the algorithm returns a multiplicative approximation to with probability .
Note that the success probability can be easily boosted up to by running independent copies of the algorithm and returning the median of the estimates.
First, let us discuss how the two problems are related. Suppose our graph have cuts, . Then, we can use the above algorithm to estimate the probability that all of the edges in one of these cuts fail. In particular, we write
where is the indicator (random variable) that edge fails. Then, every realization of failures that makes disconnected correspond to a satisfying assignment for the above DNF formula. So, we can use our FPRAS to get a approximation to the probability that at least one of the cuts fail.
Remark 3.5.
Note that there is a technical problem here, because each edge fails with probability whereas in the proof of Theorem 3.3 we assumed that every variable is true/false with 1/2 probability. We leave this as an exercise.
By the above discussion if has polynomially many cuts then we are already done. The problem is that has exponentially many cuts; i.e., we need to find the union of exponentially many sets. Karger’s idea is as follows: Let denote the size of the minimum cut of . Then, obviously,
| (3.2) |
Now, we consider two cases
Case 1:
In this case, we can simply use Monte Carlo method to obtain a approximation of using only many samples. In other words, we let be the universe of all realizations of .
Case 2:
As it will be clear we need to let be . Here the idea is to divide all cuts of into two groups: (i) Near minimum cuts and (ii) Large cuts. We use the following theorem of Karger to prove that there are only polynomialy many near minimum cut in any graph . So, we can use Theorem 3.3 to estimate the probability that at least one of these cuts fails. To deal with large cuts we also use the following theorem to argue that it is very unlikely that any of the large cuts fails.
Theorem 3.6 (Karger [Kar95]).
For any graph with vertices and with minimum cut , and for any , the number of cuts of size at most in is at most .
The above theorem can be proved by Karger’s contraction algorithm, see 521-Notes. Also, note that the statement of the above theorem is tight, as in a cycle of length there are cuts with edges.
Now, let be a parameter that we fix later. We want to show that with probability at most all cuts of size at least survive.
Lemma 3.7.
Let be all cuts of and let us sort them in the order of their size
For any , and we have
Proof.
Firstly, by Theorem 3.6, for any , we have . In other words,
| (3.3) |
By union bound can write
Say . We can write Therefore,
∎
So, to make sure that all large cuts survive it is enough to choose such that the above probability is at most . Observe that if we choose and making sure that we get , so
So, it is enough to solve the DNF counting problem for smallest cuts. These cuts can be found in polynomial time using Karger’s contraction algorithm.