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
November 29, 20260
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
How to Approach This
- Define your hypotheses (H0 and H1) clearly before performing any test.
- Calculate required sample size BEFORE running an experiment, using power analysis.
- Remember the Central Limit Theorem: sample means become approximately normal with large n.
- Watch for Simpson's paradox. Always segment data by key dimensions.
- 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 QuestionsSample Answer
Clarify
Four labeled users, 6 possible edges, each present independently with , so all graphs are equally likely. Connected means a path exists between every pair....
Approach
Condition on the size of the component containing user 1. That component is a connected graph on user 1 plus chosen others, with no edges from it to the remaining users. Let be t...