Consider an undirected graph G = (V, E) representing the social network of friendship/trust between employees. We partition the set of node triples into four sets T0, T1, T2, and T3. A node triple v1, v2, v3 belongs to T0 iff no edge exists between the nodes v1, v2, and v3, – T1 iff exactly one of the edges (v1, v2), (v2, v3), and (v3; v1) exists, T2 iff exactly two of the edges (v1, v2), (v2, v3), and (v3, v1) exist, T3 iff all of the edges (v1, v2), (v2, v3), and (v3; v1) exist. T3 denotes the number of connected triples in the graph that is the quantity we need to estimate. if i apply the following algorithm:

Sample an edge e = (a, b) uniformly chosen from E

Choose a node v uniformly from V \ {a, b}

if (a, v) ∈ E and (b, v) ∈ E then x = 1, else x = 0
How can I show that T1 + 2T2 + 3T3 = E(V  − 2)?