Each unordered triple of vertices is a triangle in a graph with probability . Consequently the triangle count in a binomial random graph satisfies . If , the Markov inequality gives . Hence
the sparse direction of the triangle-existence threshold in a binomial random graph.
For each vertex triple , let indicate that its three edges are present. Then and
Each variance is . Two distinct triples have independent indicators unless they share an edge; in that case their covariance is . There are unordered pairs sharing an edge. Therefore the triangle count in a binomial random graph has
If , Markov inequality gives . If , then and
The second term tends to zero since . Chebyshev inequality now gives , proving the stated threshold. Here the random-graph phrase “almost surely” means asymptotically almost surely, that is, with probability tending to one.
At , let count edges. Direct subtraction gives
Some graph has at least this expectation. Successively deleting one edge from each remaining triangle destroys all triangles with at most deletions, so a triangle-free graph remains with at least edges. This triangle deletion in the alteration method proves the requested existence bound.
It is not within a constant factor of the optimum. A balanced complete bipartite graph has edges and no triangle. Conversely, in a triangle-free graph each edge satisfies . Summing over edges gives , where is its edge count. Cauchy-Schwarz inequality gives , hence . The optimum is therefore , quadratic rather than the obtained bound.
Write and let be the triangle count in a binomial random graph. For every three-element set of vertices, let be the indicator random variable that its three edges are present. Then
For two distinct triples , their indicator random variables are independent random variables unless they share an edge. Sharing just one vertex still leaves the sets of relevant edges disjoint. If they share an edge, their union has five edges, and therefore
There are unordered pairs of distinct triangles in a graph sharing an edge: choose that edge, and then choose their two additional vertices. The variance of a sum consequently gives the exact formula
For sufficiently large , the hypothesis ensures , so . Dropping negative terms and simplifying the binomial coefficients,
Here as well. The event implies . Applying the Chebyshev inequality from part (i) gives the requested conclusion:
Thus the triangle count is concentrated around its expectation throughout this range of the binomial random graph.
For each unordered triple of distinct vertices, let be the indicator variable that its three edges are present. This is a binomial random graph, so edge independence gives . The triangle count in a binomial random graph is . There are such triples; all are triangles in the complete graph.
The combinatorial maximum and expectation are
The maximum is attainable with positive probability if ; for , the random variable is identically zero. The linearity of expectation requires no independence between different triangle indicators.
The Markov inequality states that for a nonnegative random variable and ,
Because is integer-valued, apply it with . With ,
Therefore
This is the first moment method: if the expected triangle count in a binomial random graph tends to zero, triangles occur with vanishing probability.
Chebyshev inequality states that, for a random variable of finite variance and any ,
Let count triangles, where ranges over the three-element vertex sets and is the corresponding indicator random variable. Then
Two distinct triangle indicators are independent unless their triangles share an edge. There are
unordered pairs sharing an edge, and each covariance is
Therefore
It follows that
when . Chebyshev's inequality now gives
Hence
as summarized by the triangle count in a binomial random graph.
Markov inequality says that a nonnegative random variable satisfies
Chebyshev inequality says that a random variable with finite variance satisfies
Let count triangles in . The triangle count in a binomial random graph calculation gives
Since ,
For sufficiently large , , and Chebyshev inequality gives
If , the triangle count in a binomial random graph has expectation at most , so the Markov inequality shows there are no triangles in a graph with probability tending to one. If , the triangle variance in a binomial random graph divided by the squared mean is . The second moment method then gives at least one triangle in a graph with probability tending to one. At the intermediate scale , a nontrivial Poisson limit for triangles in a binomial random graph describes the count.