Probability of at least one triangle in Erdos-Renyi graph This is a well-known problem in random graph theory, where we show that if $X$ is the number of triangles in $G(V,E,p)$ with $p=o(\frac{1}{n})$, we can show that 
$$
P(X \geq 1) \geq 1-o(\frac{1}{n}) \to_n 1
$$
using Chebyshev inequality and asymptotic expansion of binomial coefficients, $\binom{n}{k} \sim \frac{n^k}{k!}$.
What I don't understand is the part where the second moment is used for indicator variables: 
$$
\mathbf{E}X^2 = \mathbf{E} (\sum_{k=1}^{\binom{n}{3}} X_k)^2 = \sum_{k=1}^{\binom{n}{3}} \mathbf{E}X^2_k +\sum_{k \neq j}\mathbf{E}X_k X_j
$$
Specifically, I don't understand the absence of 2 in front of the second sum. The explanation is that triangles are ordered. This means that selecting triangle $X_j$ and then $X_k$ is different to $X_k$ and then $X_j$. Could someone explain why? 
 A: The issue seems to be just about understanding the notation in the summation index, that is, nothing to do with the specifics of the graph problem.
$\sum_{k\neq j}$ refers to summing over all $(k,j)$ with $k,j \in \{1,\ldots,n\}$ such that $k\neq j$. So, both $(i,l)$ and $(l,i)$ for any $i\neq l$. Since $\mathbb{E}X_k\,X_j = \mathbb{E}X_j\,X_k$, we have
\begin{equation}
\sum_{k\neq j} \mathbb{E}(X_k\,X_j) = 2\,\sum_{k<j} \mathbb{E}(X_k\,X_j),
\end{equation}
where $\sum_{k<j}$ refers to all pairs of indices where $1\leq k < j \leq n$. You are probably thinking about this latter summation.
For example, when $n=2$, $\mathbb{E}((X_1+X_2)^2)$  can be expressed either as 
\begin{equation}
\mathbb{E}(X_1^2+X_1\,X_2+X_2\,X_1+X_2^2) = \mathbb{E}(X_1^2)+\mathbb{E}(X_2^2)+\mathbb{E}(X_1\,X_2)+\mathbb{E}(X_2\,X_1)
\end{equation}
which is the notation appearing in the question unfolded. Or, since $X_1\,X_2=X_2\,X_1$, this is equal to
\begin{equation}
=\mathbb{E}(X_1^2) + \mathbb{E}(X_2^2) + 2\,\mathbb{E}(X_1\,X_2)
\end{equation}
which is the $\sum_{k<j}$ notation unfolded.
