Consider the set $V=\{1,2,…,n\}$ and let $p$ be a real number with $0<p<1$. We construct a graph $G=(V,E)$ with vertex set $V$, whose edge set $E$ is determined by the following random process: Each unordered pair $\{i,j\}$ of vertices, where $i≠j$, occurs as an edge in E with probability $p$, independently of the other unordered pairs.
A triangle in G is an unordered triple $\{i,j,k\}$ of distinct vertices, such that $\{i,j\}$, $\{j,k\}$, and $\{k,i\}$ are edges in $G$.
Define the random variable $X$ to be the total number of triangles in the graph $G$. Determine $var(X)$.
I need help because I can't think of a random variable without making it independent.
Thanks to BGM's hint, I came up with
$Var(X)=nC3$$(p^3-p^6)+4*nC4(p^5-p^6)$
This is because the only way that the triangles be dependent is if they share 1 edge, and that happens when we choose 4 points. This is multiplied by 4, since there are 4 ways to draw the 2 triangles that share an edge. Furthermore, $E(X)=p^3$, and the covariance of the edge-sharing triangles is $p^5-p^6$.
Am I missing anything?