# Tail Inequalities

When applying probabilistic analysis, we often want a bound in form of ${\displaystyle \Pr[X\geq t]<\epsilon }$ for some random variable ${\displaystyle X}$ (think that ${\displaystyle X}$ is a cost such as running time of a randomized algorithm). We call this a tail bound, or a tail inequality.

Besides directly computing the probability ${\displaystyle \Pr[X\geq t]}$, we want to have some general way of estimating tail probabilities from some measurable information regarding the random variables.

## Markov's Inequality

One of the most natural information about a random variable is its expectation, which is the first moment of the random variable. Markov's inequality draws a tail bound for a random variable from its expectation.

 Theorem (Markov's Inequality) Let ${\displaystyle X}$ be a random variable assuming only nonnegative values. Then, for all ${\displaystyle t>0}$, {\displaystyle {\begin{aligned}\Pr[X\geq t]\leq {\frac {\mathbf {E} [X]}{t}}.\end{aligned}}}
Proof.
 Let ${\displaystyle Y}$ be the indicator such that {\displaystyle {\begin{aligned}Y&={\begin{cases}1&{\mbox{if }}X\geq t,\\0&{\mbox{otherwise.}}\end{cases}}\end{aligned}}} It holds that ${\displaystyle Y\leq {\frac {X}{t}}}$. Since ${\displaystyle Y}$ is 0-1 valued, ${\displaystyle \mathbf {E} [Y]=\Pr[Y=1]=\Pr[X\geq t]}$. Therefore, ${\displaystyle \Pr[X\geq t]=\mathbf {E} [Y]\leq \mathbf {E} \left[{\frac {X}{t}}\right]={\frac {\mathbf {E} [X]}{t}}.}$
${\displaystyle \square }$

### Example (from Las Vegas to Monte Carlo)

Let ${\displaystyle A}$ be a Las Vegas randomized algorithm for a decision problem ${\displaystyle f}$, whose expected running time is within ${\displaystyle T(n)}$ on any input of size ${\displaystyle n}$. We transform ${\displaystyle A}$ to a Monte Carlo randomized algorithm ${\displaystyle B}$ with bounded one-sided error as follows:

${\displaystyle B(x)}$:
• Run ${\displaystyle A(x)}$ for ${\displaystyle 2T(n)}$ long where ${\displaystyle n}$ is the size of ${\displaystyle x}$.
• If ${\displaystyle A(x)}$ returned within ${\displaystyle 2T(n)}$ time, then return what ${\displaystyle A(x)}$ just returned, else return 1.

Since ${\displaystyle A}$ is Las Vegas, its output is always correct, thus ${\displaystyle B(x)}$ only errs when it returns 1, thus the error is one-sided. The error probability is bounded by the probability that ${\displaystyle A(x)}$ runs longer than ${\displaystyle 2T(n)}$. Since the expected running time of ${\displaystyle A(x)}$ is at most ${\displaystyle T(n)}$, due to Markov's inequality,

${\displaystyle \Pr[{\mbox{the running time of }}A(x)\geq 2T(n)]\leq {\frac {\mathbf {E} [{\mbox{running time of }}A(x)]}{2T(n)}}\leq {\frac {1}{2}},}$

thus the error probability is bounded.

### Generalization

For any random variable ${\displaystyle X}$, for an arbitrary non-negative real function ${\displaystyle h}$, the ${\displaystyle h(X)}$ is a non-negative random variable. Applying Markov's inequality, we directly have that

${\displaystyle \Pr[h(X)\geq t]\leq {\frac {\mathbf {E} [h(X)]}{t}}.}$

This trivial application of Markov's inequality gives us a powerful tool for proving tail inequalities. With the function ${\displaystyle h}$ which extracts more information about the random variable, we can prove sharper tail inequalities.

## Variance

 Definition (variance) The variance of a random variable ${\displaystyle X}$ is defined as {\displaystyle {\begin{aligned}\mathbf {Var} [X]=\mathbf {E} \left[(X-\mathbf {E} [X])^{2}\right]=\mathbf {E} \left[X^{2}\right]-(\mathbf {E} [X])^{2}.\end{aligned}}} The standard deviation of random variable ${\displaystyle X}$ is ${\displaystyle \delta [X]={\sqrt {\mathbf {Var} [X]}}.}$

We have seen that due to the linearity of expectations, the expectation of the sum of variable is the sum of the expectations of the variables. It is natural to ask whether this is true for variances. We find that the variance of sum has an extra term called covariance.

 Definition (covariance) The covariance of two random variables ${\displaystyle X}$ and ${\displaystyle Y}$ is {\displaystyle {\begin{aligned}\mathbf {Cov} (X,Y)=\mathbf {E} \left[(X-\mathbf {E} [X])(Y-\mathbf {E} [Y])\right].\end{aligned}}}

We have the following theorem for the variance of sum.

 Theorem For any two random variables ${\displaystyle X}$ and ${\displaystyle Y}$, {\displaystyle {\begin{aligned}\mathbf {Var} [X+Y]=\mathbf {Var} [X]+\mathbf {Var} [Y]+2\mathbf {Cov} (X,Y).\end{aligned}}} Generally, for any random variables ${\displaystyle X_{1},X_{2},\ldots ,X_{n}}$, {\displaystyle {\begin{aligned}\mathbf {Var} \left[\sum _{i=1}^{n}X_{i}\right]=\sum _{i=1}^{n}\mathbf {Var} [X_{i}]+\sum _{i\neq j}\mathbf {Cov} (X_{i},X_{j}).\end{aligned}}}
Proof.
 The equation for two variables is directly due to the definition of variance and covariance. The equation for ${\displaystyle n}$ variables can be deduced from the equation for two variables.
${\displaystyle \square }$

We will see that when random variables are independent, the variance of sum is equal to the sum of variances. To prove this, we first establish a very useful result regarding the expectation of multiplicity.

 Theorem For any two independent random variables ${\displaystyle X}$ and ${\displaystyle Y}$, {\displaystyle {\begin{aligned}\mathbf {E} [X\cdot Y]=\mathbf {E} [X]\cdot \mathbf {E} [Y].\end{aligned}}}
Proof.
 {\displaystyle {\begin{aligned}\mathbf {E} [X\cdot Y]&=\sum _{x,y}xy\Pr[X=x\wedge Y=y]\\&=\sum _{x,y}xy\Pr[X=x]\Pr[Y=y]\\&=\sum _{x}x\Pr[X=x]\sum _{y}y\Pr[Y=y]\\&=\mathbf {E} [X]\cdot \mathbf {E} [Y].\end{aligned}}}
${\displaystyle \square }$

With the above theorem, we can show that the covariance of two independent variables is always zero.

 Theorem For any two independent random variables ${\displaystyle X}$ and ${\displaystyle Y}$, {\displaystyle {\begin{aligned}\mathbf {Cov} (X,Y)=0.\end{aligned}}}
Proof.
 {\displaystyle {\begin{aligned}\mathbf {Cov} (X,Y)&=\mathbf {E} \left[(X-\mathbf {E} [X])(Y-\mathbf {E} [Y])\right]\\&=\mathbf {E} \left[X-\mathbf {E} [X]\right]\mathbf {E} \left[Y-\mathbf {E} [Y]\right]&\qquad ({\mbox{Independence}})\\&=0.\end{aligned}}}
${\displaystyle \square }$

We then have the following theorem for the variance of the sum of pairwise independent random variables.

 Theorem For pairwise independent random variables ${\displaystyle X_{1},X_{2},\ldots ,X_{n}}$, {\displaystyle {\begin{aligned}\mathbf {Var} \left[\sum _{i=1}^{n}X_{i}\right]=\sum _{i=1}^{n}\mathbf {Var} [X_{i}].\end{aligned}}}
Remark
The theorem holds for pairwise independent random variables, a much weaker independence requirement than the mutual independence. This makes the variance-based probability tools work even for weakly random cases. We will see what it exactly means in the future lectures.

### Variance of binomial distribution

For a Bernoulli trial with parameter ${\displaystyle p}$.

${\displaystyle X={\begin{cases}1&{\mbox{with probability }}p\\0&{\mbox{with probability }}1-p\end{cases}}}$

The variance is

${\displaystyle \mathbf {Var} [X]=\mathbf {E} [X^{2}]-(\mathbf {E} [X])^{2}=\mathbf {E} [X]-(\mathbf {E} [X])^{2}=p-p^{2}=p(1-p).}$

Let ${\displaystyle Y}$ be a binomial random variable with parameter ${\displaystyle n}$ and ${\displaystyle p}$, i.e. ${\displaystyle Y=\sum _{i=1}^{n}Y_{i}}$, where ${\displaystyle Y_{i}}$'s are i.i.d. Bernoulli trials with parameter ${\displaystyle p}$. The variance is

{\displaystyle {\begin{aligned}\mathbf {Var} [Y]&=\mathbf {Var} \left[\sum _{i=1}^{n}Y_{i}\right]\\&=\sum _{i=1}^{n}\mathbf {Var} \left[Y_{i}\right]&\qquad ({\mbox{Independence}})\\&=\sum _{i=1}^{n}p(1-p)&\qquad ({\mbox{Bernoulli}})\\&=p(1-p)n.\end{aligned}}}

## Chebyshev's inequality

With the information of the expectation and variance of a random variable, one can derive a stronger tail bound known as Chebyshev's Inequality.

 Theorem (Chebyshev's Inequality) For any ${\displaystyle t>0}$, {\displaystyle {\begin{aligned}\Pr \left[|X-\mathbf {E} [X]|\geq t\right]\leq {\frac {\mathbf {Var} [X]}{t^{2}}}.\end{aligned}}}
Proof.
 Observe that ${\displaystyle \Pr[|X-\mathbf {E} [X]|\geq t]=\Pr[(X-\mathbf {E} [X])^{2}\geq t^{2}].}$ Since ${\displaystyle (X-\mathbf {E} [X])^{2}}$ is a nonnegative random variable, we can apply Markov's inequality, such that ${\displaystyle \Pr[(X-\mathbf {E} [X])^{2}\geq t^{2}]\leq {\frac {\mathbf {E} [(X-\mathbf {E} [X])^{2}]}{t^{2}}}={\frac {\mathbf {Var} [X]}{t^{2}}}.}$
${\displaystyle \square }$

# Median Selection

The selection problem is the problem of finding the ${\displaystyle k}$th smallest element in a set ${\displaystyle S}$. A typical case of selection problem is finding the median.

 Definition The median of a set ${\displaystyle S}$ is the ${\displaystyle (\lceil n/2\rceil )}$th element in the sorted order of ${\displaystyle S}$.

The median can be found in ${\displaystyle O(n\log n)}$ time by sorting. There is a linear-time deterministic algorithm, "median of medians" algorithm, which is quite sophisticated. Here we introduce a much simpler randomized algorithm which also runs in linear time.

## The LazySelect algorithm

We introduce a randomized median selection algorithm called LazySelect, which is a variant on a randomized algorithm due to Floyd and Rivest

The idea of this algorithm is random sampling. For a set ${\displaystyle S}$, let ${\displaystyle m\in S}$ denote the median. We observe that if we can find two elements ${\displaystyle d,u\in S}$ satisfying the following properties:

1. The median is between ${\displaystyle d}$ and ${\displaystyle u}$ in the sorted order, i.e. ${\displaystyle d\leq m\leq u}$;
2. The total number of elements between ${\displaystyle d}$ and ${\displaystyle u}$ is small, specially for ${\displaystyle C=\{x\in S\mid d\leq x\leq u\}}$, ${\displaystyle |C|=o(n/\log n)}$.

Provided ${\displaystyle d}$ and ${\displaystyle u}$ with these two properties, within linear time, we can compute the ranks of ${\displaystyle d}$ and ${\displaystyle u}$ in ${\displaystyle S}$, construct ${\displaystyle C}$, and sort ${\displaystyle C}$. Therefore, the median ${\displaystyle m}$ of ${\displaystyle S}$ can be picked from ${\displaystyle C}$ in linear time.

So how can we select such elements ${\displaystyle d}$ and ${\displaystyle u}$ from ${\displaystyle S}$? Certainly sorting ${\displaystyle S}$ would give us the elements, but isn't that exactly what we want to avoid in the first place?

Observe that ${\displaystyle d}$ and ${\displaystyle u}$ are only asked to roughly satisfy some constraints. This hints us maybe we can construct a sketch of ${\displaystyle S}$ which is small enough to sort cheaply and roughly represents ${\displaystyle S}$, and then pick ${\displaystyle d}$ and ${\displaystyle u}$ from this sketch. We construct the sketch by randomly sampling a relatively small number of elements from ${\displaystyle S}$. Then the strategy of algorithm is outlined by:

• Sample a set ${\displaystyle R}$ of elements from ${\displaystyle S}$.
• Sort ${\displaystyle R}$ and choose ${\displaystyle d}$ and ${\displaystyle u}$ somewhere around the median of ${\displaystyle R}$.
• If ${\displaystyle d}$ and ${\displaystyle u}$ have the desirable properties, we can compute the median in linear time, or otherwise the algorithm fails.

The parameters to be fixed are: the size of ${\displaystyle R}$ (small enough to sort in linear time and large enough to contain sufficient information of ${\displaystyle S}$); and the order of ${\displaystyle d}$ and ${\displaystyle u}$ in ${\displaystyle R}$ (not too close to have ${\displaystyle m}$ between them, and not too far away to have ${\displaystyle C}$ sortable in linear time).

We choose the size of ${\displaystyle R}$ as ${\displaystyle n^{3/4}}$, and ${\displaystyle d}$ and ${\displaystyle u}$ are within ${\displaystyle {\sqrt {n}}}$ range around the median of ${\displaystyle R}$.

 LazySelect Input: a set ${\displaystyle S}$ of ${\displaystyle n}$ elements over totally ordered domain. Pick a multi-set ${\displaystyle R}$ of ${\displaystyle \left\lceil n^{3/4}\right\rceil }$ elements in ${\displaystyle S}$, chosen independently and uniformly at random with replacement, and sort ${\displaystyle R}$. Let ${\displaystyle d}$ be the ${\displaystyle \left\lfloor {\frac {1}{2}}n^{3/4}-{\sqrt {n}}\right\rfloor }$-th smallest element in ${\displaystyle R}$, and let ${\displaystyle u}$ be the ${\displaystyle \left\lceil {\frac {1}{2}}n^{3/4}+{\sqrt {n}}\right\rceil }$-th smallest element in ${\displaystyle R}$. Construct ${\displaystyle C=\{x\in S\mid d\leq x\leq u\}}$ and compute the ranks ${\displaystyle r_{d}=|\{x\in S\mid x and ${\displaystyle r_{u}=|\{x\in S\mid x. If ${\displaystyle r_{d}>{\frac {n}{2}}}$ or ${\displaystyle r_{u}<{\frac {n}{2}}}$ or ${\displaystyle |C|>4n^{3/4}}$ then return FAIL. Sort ${\displaystyle C}$ and return the ${\displaystyle \left(\left\lfloor {\frac {n}{2}}\right\rfloor -r_{d}+1\right)}$th element in the sorted order of ${\displaystyle C}$.

"Sample with replacement" (有放回采样) means that after sampling an element, we put the element back to the set. In this way, each sampled element is independently and identically distributed (i.i.d) (独立同分布). In the above algorithm, this is for our convenience of analysis.

## Analysis

The algorithm always terminates in linear time because each line of the algorithm costs at most linear time. The last three line guarantees that the algorithm returns the correct median if it does not fail.

We then only need to bound the probability that the algorithm returns a FAIL. Let ${\displaystyle m\in S}$ be the median of ${\displaystyle S}$. By Line 4, we know that the algorithm returns a FAIL if and only if at least one of the following events occurs:

• ${\displaystyle {\mathcal {E}}_{1}:Y=|\{x\in R\mid x\leq m\}|<{\frac {1}{2}}n^{3/4}-{\sqrt {n}}}$;
• ${\displaystyle {\mathcal {E}}_{2}:Z=|\{x\in R\mid x\geq m\}|<{\frac {1}{2}}n^{3/4}-{\sqrt {n}}}$;
• ${\displaystyle {\mathcal {E}}_{3}:|C|>4n^{3/4}}$.

${\displaystyle {\mathcal {E}}_{3}}$ directly follows the third condition in Line 4. ${\displaystyle {\mathcal {E}}_{1}}$ and ${\displaystyle {\mathcal {E}}_{2}}$ are a bit tricky. The first condition in Line 4 is that ${\displaystyle r_{d}>{\frac {n}{2}}}$, which looks not exactly the same as ${\displaystyle {\mathcal {E}}_{1}}$, but both ${\displaystyle {\mathcal {E}}_{1}}$ and that ${\displaystyle r_{d}>{\frac {n}{2}}}$ are equivalent to the same event: the ${\displaystyle \left\lfloor {\frac {1}{2}}n^{3/4}-{\sqrt {n}}\right\rfloor }$-th smallest element in ${\displaystyle R}$ is greater than ${\displaystyle m}$, thus they are actually equivalent. Similarly, ${\displaystyle {\mathcal {E}}_{2}}$ is equivalent to the second condition of Line 4.

We now bound the probabilities of these events one by one.

 Lemma 1 ${\displaystyle \Pr[{\mathcal {E}}_{1}]\leq {\frac {1}{4}}n^{-1/4}}$.
Proof.
 Let ${\displaystyle X_{i}}$ be the ${\displaystyle i}$th sampled element in Line 1 of the algorithm. Let ${\displaystyle Y_{i}}$ be a indicator random variable such that ${\displaystyle Y_{i}={\begin{cases}1&{\mbox{if }}X_{i}\leq m,\\0&{\mbox{otherwise.}}\end{cases}}}$ It is obvious that ${\displaystyle Y=\sum _{i=1}^{n^{3/4}}Y_{i}}$, where ${\displaystyle Y}$ is as defined in ${\displaystyle {\mathcal {E}}_{1}}$. For every ${\displaystyle X_{i}}$, there are ${\displaystyle \left\lceil {\frac {n}{2}}\right\rceil }$ elements in ${\displaystyle S}$ that are less than or equal to the median. The probability that ${\displaystyle Y_{i}=1}$ is ${\displaystyle p=\Pr[Y_{i}=1]=\Pr[X_{i}\leq m]={\frac {1}{n}}\left\lceil {\frac {n}{2}}\right\rceil ,}$ which is within the range of ${\displaystyle \left[{\frac {1}{2}},{\frac {1}{2}}+{\frac {1}{2n}}\right]}$. Thus ${\displaystyle \mathbf {E} [Y]=n^{3/4}p\geq {\frac {1}{2}}n^{3/4}.}$ The event ${\displaystyle {\mathcal {E}}_{1}}$ is defined as that ${\displaystyle Y<{\frac {1}{2}}n^{3/4}-{\sqrt {n}}}$. Note that ${\displaystyle Y_{i}}$'s are Bernoulli trials, and ${\displaystyle Y}$ is the sum of ${\displaystyle n^{3/4}}$ Bernoulli trials, which follows binomial distribution with parameters ${\displaystyle n^{3/4}}$ and ${\displaystyle p}$. Thus, the variance is ${\displaystyle \mathbf {Var} [Y]=n^{3/4}p(1-p)\leq {\frac {1}{4}}n^{3/4}.}$ Applying Chebyshev's inequality, {\displaystyle {\begin{aligned}\Pr[{\mathcal {E}}_{1}]&=\Pr \left[Y<{\frac {1}{2}}n^{3/4}-{\sqrt {n}}\right]\\&\leq \Pr \left[|Y-\mathbf {E} [Y]|>{\sqrt {n}}\right]\\&\leq {\frac {\mathbf {Var} [Y]}{n}}\\&\leq {\frac {1}{4}}n^{-1/4}.\end{aligned}}}
${\displaystyle \square }$

By a similar analysis, we can obtain the following bound for the event ${\displaystyle {\mathcal {E}}_{2}}$.

 Lemma 2 ${\displaystyle \Pr[{\mathcal {E}}_{2}]\leq {\frac {1}{4}}n^{-1/4}}$.

We now bound the probability of the event ${\displaystyle {\mathcal {E}}_{3}}$.

 Lemma 3 ${\displaystyle \Pr[{\mathcal {E}}_{3}]\leq {\frac {1}{2}}n^{-1/4}}$.
Proof.
 The event ${\displaystyle {\mathcal {E}}_{3}}$ is defined as that ${\displaystyle |C|>4n^{3/4}}$, which by the Pigeonhole Principle, implies that at leas one of the following must be true: ${\displaystyle {\mathcal {E}}_{3}'}$: at least ${\displaystyle 2n^{3/4}}$ elements of ${\displaystyle C}$ is greater than ${\displaystyle m}$; ${\displaystyle {\mathcal {E}}_{3}''}$: at least ${\displaystyle 2n^{3/4}}$ elements of ${\displaystyle C}$ is smaller than ${\displaystyle m}$. We bound the probability that ${\displaystyle {\mathcal {E}}_{3}'}$ occurs; the second will have the same bound by symmetry. Recall that ${\displaystyle C}$ is the region in ${\displaystyle S}$ between ${\displaystyle d}$ and ${\displaystyle u}$. If there are at least ${\displaystyle 2n^{3/4}}$ elements of ${\displaystyle C}$ greater than the median ${\displaystyle m}$ of ${\displaystyle S}$, then the rank of ${\displaystyle u}$ in the sorted order of ${\displaystyle S}$ must be at least ${\displaystyle {\frac {1}{2}}n+2n^{3/4}}$ and thus ${\displaystyle R}$ has at least ${\displaystyle {\frac {1}{2}}n^{3/4}-{\sqrt {n}}}$ samples among the ${\displaystyle {\frac {1}{2}}n-2n^{3/4}}$ largest elements in ${\displaystyle S}$. Let ${\displaystyle X_{i}\in \{0,1\}}$ indicate whether the ${\displaystyle i}$th sample is among the ${\displaystyle {\frac {1}{2}}n-2n^{3/4}}$ largest elements in ${\displaystyle S}$. Let ${\displaystyle X=\sum _{i=1}^{n^{3/4}}X_{i}}$ be the number of samples in ${\displaystyle R}$ among the ${\displaystyle {\frac {1}{2}}n-2n^{3/4}}$ largest elements in ${\displaystyle S}$. It holds that ${\displaystyle p=\Pr[X_{i}=1]={\frac {{\frac {1}{2}}n-2n^{3/4}}{n}}={\frac {1}{2}}-2n^{-1/4}}$. ${\displaystyle X}$ is a binomial random variable with ${\displaystyle \mathbf {E} [X]=n^{3/4}p={\frac {1}{2}}n^{3/4}-2{\sqrt {n}},}$ and ${\displaystyle \mathbf {Var} [X]=n^{3/4}p(1-p)={\frac {1}{4}}n^{3/4}-4n^{1/4}<{\frac {1}{4}}n^{3/4}.}$ Applying Chebyshev's inequality, {\displaystyle {\begin{aligned}\Pr[{\mathcal {E}}_{3}']&=\Pr \left[X\geq {\frac {1}{2}}n^{3/4}-{\sqrt {n}}\right]\\&\leq \Pr \left[|X-\mathbf {E} [X]|\geq {\sqrt {n}}\right]\\&\leq {\frac {\mathbf {Var} [X]}{n}}\\&\leq {\frac {1}{4}}n^{-1/4}.\end{aligned}}} Symmetrically, we have that ${\displaystyle \Pr[{\mathcal {E}}_{3}'']\leq {\frac {1}{4}}n^{-1/4}}$. Applying the union bound ${\displaystyle \Pr[{\mathcal {E}}_{3}]\leq \Pr[{\mathcal {E}}_{3}']+\Pr[{\mathcal {E}}_{3}'']\leq {\frac {1}{2}}n^{-1/4}.}$
${\displaystyle \square }$

Combining the three bounds. Applying the union bound to them, the probability that the algorithm returns a FAIL is at most

${\displaystyle \Pr[{\mathcal {E}}_{1}]+\Pr[{\mathcal {E}}_{2}]+\Pr[{\mathcal {E}}_{3}]\leq n^{-1/4}.}$

Therefore the algorithm always terminates in linear time and returns the correct median with high probability.

# Erdős–Rényi Random Graphs

Consider a graph ${\displaystyle G(V,E)}$ which is randomly generated as:

• ${\displaystyle |V|=n}$;
• ${\displaystyle \forall \{u,v\}\in {V \choose 2}}$, ${\displaystyle uv\in E}$ independently with probability ${\displaystyle p}$.

Such graph is denoted as ${\displaystyle G(n,p)}$. This is called the Erdős–Rényi model or ${\displaystyle G(n,p)}$ model for random graphs.

Informally, the presence of every edge of ${\displaystyle G(n,p)}$ is determined by an independent coin flipping (with probability of HEADs ${\displaystyle p}$).

## Monotone properties

A graph property is a predicate of graph which depends only on the structure of the graph.

 Definition Let ${\displaystyle {\mathcal {G}}_{n}=2^{V \choose 2}}$, where ${\displaystyle |V|=n}$, be the set of all possible graphs on ${\displaystyle n}$ vertices. A graph property is a boolean function ${\displaystyle P:{\mathcal {G}}_{n}\rightarrow \{0,1\}}$ which is invariant under permutation of vertices, i.e. ${\displaystyle P(G)=P(H)}$ whenever ${\displaystyle G}$ is isomorphic to ${\displaystyle H}$.

We are interested in the monotone properties, i.e., those properties that adding edges will not change a graph from having the property to not having the property.

 Definition A graph property ${\displaystyle P}$ is monotone if for any ${\displaystyle G\subseteq H}$, both on ${\displaystyle n}$ vertices, ${\displaystyle G}$ having property ${\displaystyle P}$ implies ${\displaystyle H}$ having property ${\displaystyle P}$.

By seeing the property as a function mapping a set of edges to a numerical value in ${\displaystyle \{0,1\}}$, a monotone property is just a monotonically increasing set function.

Some examples of monotone graph properties:

• Hamiltonian;
• ${\displaystyle k}$-clique;
• contains a subgraph isomorphic to some ${\displaystyle H}$;
• non-planar;
• chromatic number ${\displaystyle >k}$ (i.e., not ${\displaystyle k}$-colorable);
• girth ${\displaystyle <\ell }$.

From the last two properties, you can see another reason that the Erdős theorem is unintuitive.

Some examples of non-monotone graph properties:

• Eulerian;
• contains an induced subgraph isomorphic to some ${\displaystyle H}$;

For all monotone graph properties, we have the following theorem.

 Theorem Let ${\displaystyle P}$ be a monotone graph property. Suppose ${\displaystyle G_{1}=G(n,p_{1})}$, ${\displaystyle G_{2}=G(n,p_{2})}$, and ${\displaystyle 0\leq p_{1}\leq p_{2}\leq 1}$. Then ${\displaystyle \Pr[P(G_{1})]\leq \Pr[P(G_{2})]}$.

Although the statement in the theorem looks very natural, it is difficult to evaluate the probability that a random graph has some property. However, the theorem can be very easily proved by using the idea of coupling, a proof technique in probability theory which compare two unrelated random variables by forcing them to be related.

Proof.
 For any ${\displaystyle \{u,v\}\in {[n] \choose 2}}$, let ${\displaystyle X_{\{u,v\}}}$ be independently and uniformly distributed over the continuous interval ${\displaystyle [0,1]}$. Let ${\displaystyle uv\in G_{1}}$ if and only if ${\displaystyle X_{\{u,v\}}\in [0,p_{1}]}$ and let ${\displaystyle uv\in G_{2}}$ if and only if ${\displaystyle X_{\{u,v\}}\in [0,p_{2}]}$. It is obvious that ${\displaystyle G_{1}\sim G(n,p_{1})\,}$ and ${\displaystyle G_{2}\sim G(n,p_{2})\,}$. For any ${\displaystyle \{u,v\}}$, ${\displaystyle uv\in G_{1}}$ means that ${\displaystyle X_{\{u,v\}}\in [0,p_{1}]\subseteq [0,p_{2}]}$, which implies that ${\displaystyle uv\in G_{2}}$. Thus, ${\displaystyle G_{1}\subseteq G_{2}}$. Since ${\displaystyle P}$ is monotone, ${\displaystyle P(G_{1})=1}$ implies ${\displaystyle P(G_{2})}$. Thus, ${\displaystyle \Pr[P(G_{1})=1]\leq \Pr[P(G_{2})=1]}$.
${\displaystyle \square }$