Erdős–Rényi model related problem Several weeks ago random value $X$ (Variance - Var($X$) and Expectation - $\mathbb{E}(X)$) were introduced in terms of our probability course. A week ago we were given problems to think about, one of them is the following: for a given graph $G(n, p)$ is constructed by removing randomly and independently edges in a complete graph with $n$ vertices, every edge is left untouched with probability $p$. Let $T_n$ be a random value characterizing number of 'triangles' in $G(n, p)$. Task is to find $\mathbb{E}(T_n)$ and Var$(T_n)$.
I've found that this is related to Erdős–Rényi model, however haven't solved it in 3 day in row already. Do you have any ideas? Especially interested in Var($X$)
 A: Hints:
Use the linearity of expectations.  There are $\ {n\choose3}\ $ triangles in the original complete graph. For $\ t=1,2,\dots,{n\choose3}\ $ define an indicator function
$$
I_t=\cases{0& if one of the edges of the $\ t^\text{th}\ $triangle gets deleted\\
1& otherwise}\ .
$$
Then $\ \displaystyle T_n=\sum_{t=1}^{n\choose3}I_t\ $.  Can you calculate $\ \mathbb{E}\big(I_t\big)\ $?
To get $\ \text{Var}\big(T_n\big)\ $, use the formula
\begin{align}
\text{Var}\big(T_n\big)&=\mathbb{E}\big(T_n^2\big)~-\mathbb{E}\big(T_n\big)^2\\
&=\mathbb{E}\left(\sum_{s=1}^{n\choose3}\sum_{t=1}^{n\choose3} I_sI_t\right) -\mathbb{E}\big(T_n\big)^2\\
&=\mathbb{E}\big(T_n\big)+2 \mathbb{E}\left(\sum_{s=1}^{{n\choose3}-1} \sum_{t=s+1}^{n\choose3} I_sI_t\right)- \mathbb{E}\big(T_n\big)^2\ .
\end{align}
To evaluate this formula you'll need to calculate $\ \mathbb{E}\big(I_sI_t\big)\ $ for $\ 1\le s<t\le{n\choose3}\ $.  If the $\ s^\text{th}\ $ and $\ t^\text{th}\ $ triangles have no edges in common, then $\ I_s\ $ and $\ I_t\ $ are independent, so $\ \mathbb{E}\big(I_sI_t\big)=$$\mathbb{E}\big(I_s\big)\mathbb{E}\big(I_t\big)\ $. To complete the calculation you will need to:

*

*Calculate $\ \mathbb{E}\big(I_sI_t\big)\ $ for the case when $\ s^\text{th}\ $ and $\ t^\text{th}\ $ triangles have exactly one edge in common and calculate how many such triangles there were in the original complete graph, and

*do the same for the case when $\ s^\text{th}\ $ and $\ t^\text{th}\ $ triangles have exactly two edges in common.

