Probability Four Users With Random Friendships Form One Connected Group

Last updated: November 29, 2026

Quick Overview

Among 4 users, each of the 6 possible friendships exists independently with probability one half. What is the probability the friendship graph is connected, and how does the answer generalize to any p using a recursion?

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

0

0

0 solved


Among 4 users, each of the 6 possible friendships exists independently with probability one half. What is the probability the friendship graph is connected, and how does the answer generalize to any p using a recursion?

Connectivity of small groups matters for features like Messenger group suggestions, and this question tests careful counting of labeled graphs rather than guessing. The interviewer wants a correct count (38 of 64), a principled method such as conditioning on the component containing one vertex, and a code check.

What the Interviewer Expects
  • Counts 2^6 = 64 equally likely graphs
  • Counts disconnected graphs by the component containing a fixed user
  • Gets 38 connected graphs and probability 0.594
  • States the recursion for general n and p
  • Verifies by enumerating all edge subsets
Key Topics to Cover
Labeled graphs
Connectivity
Recursion on components
Random graphs
Exhaustive enumeration
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
  • Compute the probability for p = 0.3.
  • What is the expected number of isolated users?
  • Why does the probability of connectivity jump sharply around p of about ln(n)/n for large n?
  • How would you estimate this for n = 50 without enumeration?
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

Four labeled users, 6 possible edges, each present independently with p=1/2p=1/2, so all 26=642^6=64 graphs are equally likely. Connected means a path exists between every pair....

Approach

Condition on the size kk of the component containing user 1. That component is a connected graph on user 1 plus k−1k-1 chosen others, with no edges from it to the remaining n−kn-k users. Let CnC_n be t...


Submit Your Answer
Markdown supported