On this page
You make random choices and want none of a long list of things to go wrong. The union bound (add up the bad probabilities, hope the total is below 1) fails once there are many bad events. The Lovász local lemma does better when each bad event is unlikely and tangled up with only a few others. It was first published by Paul Erdős and László Lovász in 1975, as the Moser–Tardos paper in the Journal of the ACM records, and it is a standard tool of the probabilistic method.
What does the Lovász local lemma say?
Take bad events A1, …, An. Say each has probability at most p, and each is independent of all the others except at most d of them. The symmetric Lovász local lemma states that if e·p·(d + 1) ≤ 1, where e ≈ 2.718, then with positive probability none of the events happens (statement and versions of the lemma). This form with e, due to Lovász, was published by Joel Spencer in 197790044-9); the 1975 original used the weaker condition 4pd ≤ 1.
If a random choice avoids every bad event with probability above zero, at least one choice avoids them all. So the lemma proves an object exists without showing you which one.
Picture the dependency graph: one dot per bad event, a line between events that can influence each other, and d the most lines at any dot.
How is it different from the union bound?
The union bound needs n·p < 1, which gets harder as n grows. The local lemma replaces n with d + 1, the size of one event's neighbourhood, at the cost of a factor e. If you have used linearity of expectation with indicator variables, it is the same habit of looking at one small piece at a time.
Worked example: when is a k-SAT formula always satisfiable?
A k-SAT formula is a list of clauses, each an OR of k literals on distinct variables, such as (x1 ∨ ¬x4 ∨ x7) for k = 3. Can some true/false assignment make every clause true?
Pick the random experiment. Set each variable by its own fair coin.
Name the bad events. Ai is "clause i is false". A clause is false only if all k of its literals are false, so P(Ai) = 2^−k, and p = 2^−k.
Find d. Ai depends only on the coins of the variables in clause i, so it is independent of every set of clauses that share no variable with it. If every clause shares a variable with at most d other clauses, that is your d.
Check e·2^−k·(d + 1) ≤ 1, which is the same as d + 1 ≤ 2^k/e.
For k = 10: 2^10 = 1024 and 1024/e ≈ 376.7, so d ≤ 375 works. Check the edge: e × 376/1024 ≈ 0.998 ≤ 1, but e × 377/1024 ≈ 1.001 > 1.
So any 10-SAT formula in which each clause shares variables with at most 375 other clauses is satisfiable, however many clauses it has. A simpler test: if no variable appears in more than 38 clauses, each clause's 10 variables reach at most 10 × 37 = 370 other clauses, which is under 375. The union bound would have needed fewer than 1024 clauses in total.
How does the Moser–Tardos algorithm find the good assignment?
The probability the lemma guarantees can be tiny, so guessing at random is hopeless. József Beck gave the first constructive version in 1991 under more restrictive conditions, as the Journal of the ACM abstract notes. In that 2010 paper, Robin Moser and Gábor Tardos gave a method that makes almost all known applications of the general lemma algorithmic:
Give every variable a random value.
While some bad event happens, pick any one of them and re-randomise only the variables it depends on.
Stop when no bad event happens.
For k-SAT: find a false clause, flip fresh coins for its variables, repeat. Under the lemma's conditions this is a Las Vegas algorithm with expected polynomial running time. The paper won the 2020 Gödel Prize, whose citation notes that its resampling idea was later used in numerous other papers, including some not directly about the lemma.
How do you use the lemma on a new problem?
Build your object from independent random variables.
Write one bad event per thing that could go wrong.
Bound every bad event's probability by p.
Bound d: how many other events share a variable with one event.
Check e·p·(d + 1) ≤ 1. If it holds, the object exists and resampling finds it.
A classic first use is lower bounds for Ramsey numbers, the subject of Spencer's 1977 paper; our post on why six people always contain three friends or three strangers is a gentle way into that world.
If independence still feels shaky, the Fermi Concept Library covers every concept in mathematics. To practise, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning rather than printing an answer.



