Expected Number of Friend Triangles in a Random Social Graph

Last updated: November 29, 2026

Quick Overview

In a random graph of 1,000 users where each pair is friends independently with probability 0.01, find the expected number of friend triangles and the expected local clustering coefficient. Explain why the real Facebook graph has far more triangles than this model predicts.

Meta
Statistics & Math
Data Scientist
Meta
November 29, 2026
Data Scientist
Onsite
Statistics & Math
Medium

0

0

0 solved


In a random graph of 1,000 users where each pair is friends independently with probability 0.01, find the expected number of friend triangles and the expected local clustering coefficient. Explain why the real Facebook graph has far more triangles than this model predicts.

People You May Know and many graph metrics at Meta rely on triadic closure, so data scientists should know what a null model predicts for triangles. The interviewer tests linearity of expectation over triples and an understanding of why random graphs are a poor model of social networks.

What the Interviewer Expects
  • Counts candidate triples with C(n,3)
  • Uses linearity of expectation with p cubed per triple
  • Computes expected degree and clustering for comparison
  • Explains triadic closure and homophily in real graphs
  • Notes the variance or distribution is harder than the mean
Key Topics to Cover
Linearity of expectation
Erdos-Renyi graphs
Clustering coefficient
Triadic closure
Null models
How to Approach This
  1. Define your hypotheses (H0 and H1) clearly before performing any test.
  2. Calculate required sample size BEFORE running an experiment, using power analysis.
  3. Remember the Central Limit Theorem: sample means become approximately normal with large n.
  4. Watch for Simpson's paradox. Always segment data by key dimensions.
  5. Distinguish between statistical significance and practical significance.
Possible Follow-up Questions
  • What is the expected number of open wedges (paths of length two)?
  • How would you use the triangle count to test whether a subgraph is unusually tight?
  • What p makes the expected triangle count equal to 1 in a graph of n nodes?
  • How would you estimate the triangle count on a graph with billions of edges?
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Browse Statistics Questions
Sample Answer
Clarify

Model: G(n,p)G(n,p) with n=1000n=1000, p=0.01p=0.01; each of the (n2)\binom{n}{2} pairs is an edge independently. A triangle is an unordered triple with all three edges present. I will give expectations, not distri...

Approach

Write the triangle count as a sum of indicators, one per triple, and apply linearity of expectation, which needs no independence between indicators....


Submit Your Answer
Markdown supported