How to calcultate a probability that a graph with $6$ vertices and $5$ edges has a triangle?
So we have ${15\choose 5}=3003$ (labeled) graphs and ${6\choose 3} =20$ possible triangles.
Let $m_i$ be a number of graphs with $i$-th triangle. Then $m_i= {12\choose 2}= 66$ and $m_{i,j} = 1$ if $\Delta _i$ and $\Delta _j$ have one common side, else it is $0$. Notice that $m_{i,j} = 1$ is $9$ times for each $i$. So $$m= 20\cdot 66 - {20\cdot 9\over 2} = 1230$$
So $$P = {1230\over 3003} \approx 0.41 $$
Is this correct and how to calculate this probability in general if we have $n$ vertices and $\varepsilon$ edges?


For integers $n,e$ with $n \ge 1$ and $e\ge 0$, let $S=S(n,e)$ be the set of simple graphs on the labeled vertices $1,...,n$ having exactly $e$ edges.
Then we get $$E(n,e)={\large{\frac { \binom{n}{3}\binom{m-3}{e-3} } { \binom{m}{e} }}} $$ where $m=\large{\binom{n}{2}}$.
A few partial results: $$ T(n,3)= \frac { n(n-1)(n-2) } {6} \\[16pt] T(n,4)= \frac{ n(n-1)(n-2)(n-3)(n+2) } {12} \\[16pt] T(n,5)= \frac { n(n-1)(n-2)(n-3)(n^3+n^2-10n-28) } {48} \\[16pt] T(n,6)= \frac { n(n-1)(n-2)(n-3)(n^5-21n^3-56n^2+152n+620) } {288} \\[12pt] $$ More generally, fixing $e\ge 3$, it's not hard to show that $$T(n,e)=\sum_{k=j}^{2e-3}a_k{\small{\binom{n}{k}}}$$ where
- $j$ is the least positive integer such that ${\large{\binom{j}{2}}} \ge e$.$\\[4pt]$
- Each $a_k$ is the number of simple graphs on the labeled vertices $1,...,k$ having exactly $e$ edges, at least one triangle, and no isolated vertices.$\\[14pt]$
Noting that each $a_k$ is a positive integer constant (depending on $e$ and $k$, but independent of $n$), it follows that for all $e\ge 3$, we have $T(n,e)=\Theta(n^{2e-3})$.