Probability

Why a friend has more friends

Most people have fewer friends than their friends have, on average, and nothing about popularity or bad luck is needed to explain it. Choosing a friend is choosing the end of a friendship, and the well-connected are at the end of many. The gap between a friend's friends and a person's is exactly the variance of the counts divided by their mean: one extra friend when friendships form independently, ten or more when the popular attract the rest. And the same bias that makes the comparison unflattering makes a random friend a good person to vaccinate.

Worth reading first: The moment a giant appears · Two-thirds of a step past the line.

In 1991 the sociologist Scott Feld published a paper asking why a person’s friends have more friends than the person does. The observation in it had been made informally before, and it has been confirmed in nearly every social network measured since: in a school, in a company, on a social networking site with hundreds of millions of members, the average number of friends that a person’s friends have is larger than the average number of friends that a person has. On the largest site studied, more than nine in ten members had fewer friends than their friends did on average.

It sounds like a statement about popularity, or about how people choose friends, or about the self-esteem of the less popular. It is none of those. It is a statement about sampling, and it holds in every network in which people do not all have the same number of friends, for a reason that can be stated in one line. A person with ten friends is the friend of ten people. Choosing a friend — any friend, of anyone — counts that person ten times as often as a person with one friend, and an average taken over friends is an average weighted by the number of friends. That weighted average is always at least the unweighted one, and the gap between them has an exact formula.

The essay computes the paradox on a small group and on three networks of 3,000 people, finds the formula in the computations, and ends with the one practical use the paradox has: a way of finding the well-connected without knowing who they are.

Twelve people

Twelve people and their friends' friends. 12 people: mean 2.667, friend mean 3.125, 8 with fewer
Fig. 1 Twelve people and their friendships. Each circle shows how many friends that person has and the small number beside it the average among their friends; 8 of the 12 have fewer friends than their friends average.

The figure draws twelve people. One of them has six friends; most have two or three. Beside each person is the average number of friends among that person’s friends, and the eight people shaded have fewer friends than that average. Three have more, and one is level.

Two averages are worth distinguishing. The average number of friends per person is 2.672.67: add up everybody’s count and divide by twelve. The average number of friends per friend is 3.133.13: list every friendship from both ends, so that each friendship appears twice, and average the friend counts of the people at the far end of each. The second is larger because the hub, with six friends, appears six times in the second list and once in the first. The people with two friends appear twice each, and nobody with fewer friends than average can appear as often as the hub does.

The second average is the one a person experiences. Asked to look round at their friends and report how many friends those friends have, a person is sampling from the second list, not the first, and so is everybody else. The hub’s friends see the hub. Almost nobody sees the people with two friends except the two people who are their friends. Nothing in the figure depends on anybody’s choices; it depends on the arithmetic of counting each friendship from both ends.

The formula behind the gap

Write dd for a person’s number of friends, chosen at random from the population, so that its mean is E[d]\mathbb{E}[d] and its spread is the variance Var⁡(d)\operatorname{Var}(d). Choosing a friendship at random and looking at one of its ends selects each person with probability proportional to dd. The average number of friends of the person reached that way is

E[d2]E[d]=E[d]+Var⁡(d)E[d].\frac{\mathbb{E}[d^2]}{\mathbb{E}[d]} = \mathbb{E}[d] + \frac{\operatorname{Var}(d)}{\mathbb{E}[d]}.

The identity is just the definition of variance rearranged, and it says everything. The friend’s average exceeds the person’s average by the variance divided by the mean, so it exceeds it unless the variance is nought — unless everybody has exactly the same number of friends. The figures that follow check the identity on every network drawn, exactly, since both sides are computed from the same list of friendships.

A distribution reweighted in proportion to its own values is called size-biased, and the friendship paradox is one instance of a size bias that appears throughout probability. A bus passenger arriving at a random moment is more likely to arrive during a long gap between buses than a short one, which is why the step that carries a random walk past a line is longer on average than a typical step; a randomly chosen pupil is more likely to be in a large class than a small one, so pupils report larger classes than schools do. In every case the sample is taken through the objects themselves, and larger objects are hit more often.

Independent friendships: exactly one more

With independent friendships, a friend has one more. ER n=3000 mean 6.042: friend mean 7.068
Fig. 2 3,000 people with every pair friends independently, about 6 friends each. A friend’s count (orange) is a person’s count (blue) moved one place to the right: 7.07 against 6.04.

Suppose friendships form independently: every pair of 3,000 people are friends with the same small chance, chosen so that each person has about six friends. This is the random graph whose giant component appears once the average passes one. The figure draws two histograms from one seeded instance: the number of friends of a random person (blue) and of a random friend (orange). The first is close to a Poisson distribution with mean six. The second is the same shape moved one place to the right.

That shift is exact in the limit. For a Poisson count with mean λ\lambda, the variance is also λ\lambda, so the friend’s average is λ+λ/λ=λ+1\lambda + \lambda/\lambda = \lambda + 1; and more than the averages agree, because the size-biased version of a Poisson distribution is exactly one plus an independent Poisson count — the same law, with mean one, as the number of neighbours of a point in a uniformly random tree. In words: in a random network with independent friendships, a friend has exactly one more friend than a typical person, on average, and the extra friend is the person doing the counting. The friend was found through a friendship with the counter, and apart from that friendship, the friend’s other friendships are just like anybody’s.

The measured averages are 7.07 against 6.04, a gap of 1.03, the difference from 1 being the fluctuation of one finite seeded network. Here the paradox is as mild as it can be in a network where counts vary at all, and it has a completely deflationary explanation: friends have one extra friend each, namely the person asking.

When the popular attract more, friends have far more. BA n=3000 m=3: mean 5.996, friend mean 15.319
Fig. 3 3,000 people added one at a time, each befriending 3 existing people chosen in proportion to how many friends they already have. People mostly have 3 to 5 friends; a friend has 15.3 on average against 6.0.

Real social networks are not like that. Their counts are far more spread out, with a few people who have very many friends and most people who have few, and one simple model of how that happens is preferential attachment: people join one at a time, and each newcomer befriends existing people with probability proportional to how many friends they already have. Albert-László Barabási and Réka Albert proposed it in 1999 as a model of networks with hubs, and it produces counts whose distribution falls off like a power, so that the very well-connected are rare but not negligibly rare.

The figure grows such a network of 3,000 people, each newcomer making three friendships. Both histograms are drawn again. The blue one piles up at three to five friends; the orange one is spread out across the whole range, with a large bar for people with more than forty friends, because those people are everybody’s friend. The average number of friends of a person is exactly six — three made, three received on average — and the average for a friend is 15.3.

The formula says why. The variance of the counts is large, dominated by the handful of hubs, and divided by the mean it gives a gap of more than nine. In a network grown this way the variance keeps increasing as the network grows, because the hubs keep growing, so the gap is not a fixed property of the model; it is a property of a network of this size. That is the sense in which preferential attachment makes the paradox severe: the friend reached at random is drawn from the hubs, and the hubs grow with the network.

Most people, one by one

How many people are outnumbered by their friends. ring: fewer 0.000 more 0.000; er: fewer 0.642 more 0.334; ba: fewer 0.897 more 0.101
Fig. 4 Three networks of 3,000 people, person by person. In a ring where everybody knows 6, nobody is outnumbered; with independent friendships 64.2% have fewer friends than their friends average; with hubs, 89.7%.

The paradox so far is a statement about averages over the whole network. A sharper version asks about individuals: what share of people have fewer friends than their own friends have on average? That is not implied by the first statement, since an average can exceed another average while most individuals go the other way. The figure computes it for three networks of 3,000 people.

In a ring in which everybody knows the three nearest people on each side, everybody has six friends and so does everybody’s friend: nobody is outnumbered and nobody outnumbers, and the paradox vanishes completely, as the formula says it must when the variance is nought. With independent friendships, 64.2% of people have fewer friends than their friends average and 33.4% have more. With preferential attachment, 89.7% have fewer and 10.1% more.

The individual version is the one people notice, and its size depends on the shape of the network rather than on a formula as clean as the averaged one. In networks with hubs, almost everybody is connected to at least one person much better connected than themselves, and one such friend is enough to drag their friends’ average above their own. The reported figure of more than nine in ten on a large real social network sits close to the preferential-attachment value, which is one reason that model is taken seriously as a caricature of how such networks form.

The gap is the variance over the mean

The gap is the variance over the mean. independent2: 2.05→+1.00 independent4: 3.99→+1.02 independent8: 8.03→+0.97 independent16: 16.07→+1.06 popular1: 2.00→+4.93 popular2: 4.00→+6.39 popular3: 5.99→+10.18 popular5: 9.98→+12.23
Fig. 5 The gap between a friend’s average number of friends and a person’s, for networks of 2,000 people: about 1 for independent friendships at every average, and 5 to 12 for preferential attachment.

The formula makes a prediction that can be tested across many networks at once: the gap depends on the variance-to-mean ratio of the counts and on nothing else. The figure draws networks of 2,000 people with independent friendships at averages 2, 4, 8 and 16, and networks grown by preferential attachment with 1, 2, 3 and 5 friendships per newcomer. For every independent network the gap is close to 1 — 1.00, 1.02, 0.97, 1.06 — whatever the average, as the Poisson calculation says. For the networks with hubs it is between about 5 and 12, growing with the number of links.

The two families are separated not by how many friends people have but by how unequal the counts are. A network in which everybody had exactly twenty friends would show no paradox at all, and a network in which most people had two friends and a few had a thousand would show an enormous one, whatever its average. That is also why the paradox shows up in so many places that are not about friendship: wherever objects are reached through a process that hits them in proportion to their size — a gap between buses hit by an arriving passenger, a class hit by a pupil, a long stretch of kerb hit by a car parking at random — the reported average is the size-biased one.

The ratio Var⁡(d)/E[d]\operatorname{Var}(d)/\mathbb{E}[d] is sometimes called the index of dispersion. It equals 1 for Poisson counts, which arise whenever events happen independently, and it exceeds 1 when they cluster. The friendship paradox is that index in disguise.

The friend’s friends decide whether a giant forms

The size-biased average turns out to govern more than a comparison. Whether a network holds together at all — whether it has a giant connected group containing a fixed share of everybody — depends on exactly the same quantity. Start from a person and explore outwards: their friends, then their friends’ other friends, and so on. Every person reached after the first step was reached through a friendship, so the number of new people each of them leads to is their number of friends minus the one already used, and its average is E[d2]/E[d]−1\mathbb{E}[d^2]/\mathbb{E}[d] - 1. The exploration is a branching process, and a branching process survives for ever with positive probability exactly when each generation is, on average, larger than the last.

So a network with given counts of friends, otherwise random, has a giant group exactly when

E[d2]E[d]−1>1,that is,E[d2]>2 E[d].\frac{\mathbb{E}[d^2]}{\mathbb{E}[d]} - 1 > 1, \qquad\text{that is,}\qquad \mathbb{E}[d^2] > 2\,\mathbb{E}[d].

This is the criterion Michael Molloy and Bruce Reed proved in 1995, and it reads naturally only through the paradox: a giant forms when a friend has, on average, more than one other friend. For independent friendships, where a friend has exactly one more friend than average, the criterion becomes an average number of friends greater than one, which is the moment a giant appears, and the same branching picture is what makes the critical window so narrow. The second moment E[d2]\mathbb{E}[d^2] is doing the work it does whenever a threshold is located with two moments: the first moment says how much there is, the second how unevenly it is spread, and connection depends on the unevenness.

The criterion also explains the vaccination result that follows. Removing people at random lowers E[d2]\mathbb{E}[d^2] and E[d]\mathbb{E}[d] in proportion, so a network with large variance needs a great deal of random removal before the ratio falls below 2. Removing hubs attacks E[d2]\mathbb{E}[d^2] directly, where the excess lives. In a network grown by preferential attachment — a process with the same rich-get-richer rule as the urns whose drawn colour is returned with interest — the variance is so concentrated in the hubs that random removal barely touches it.

Vaccinating a friend

Vaccinating a friend instead of a person. BA n=3000: largest component at 40% removed — random 0.586, friend 0.357, hubs 0.004
Fig. 6 The 3,000-person network with hubs and a share of people vaccinated. At 40%, vaccinating random people leaves 59% still connected; vaccinating a random friend of a random person leaves 36%; vaccinating the known hubs shatters it by 30%.

The paradox has a use. In a network where a disease spreads along friendships, vaccinating the hubs is far more effective than vaccinating at random, because the hubs are the routes through which most transmission passes — but finding the hubs requires knowing the network, which is usually impossible. Reuven Cohen, Shlomo Havlin and Daniel ben-Avraham proposed in 2003 a way round it: pick people at random, and vaccinate one of their friends, chosen at random. A random friend is a size-biased sample, so the procedure finds the hubs without knowing who they are.

The figure tests the three strategies on the network grown by preferential attachment, measuring the largest group still connected — the group through which an infection could still spread — as the share vaccinated rises. Vaccinating random people wears the network down slowly; at 40%, 59% of people are still in one connected group. Vaccinating random friends of random people leaves 36% at the same coverage. Vaccinating the known hubs, if they could be identified, breaks the network into small pieces by 30%. The friend strategy sits between the two, recovering much of the advantage of knowing the network while needing to know nothing.

The same idea has been used to find outbreaks early. In 2009, Nicholas Christakis and James Fowler followed a group of students and a group of their nominated friends through an influenza season, and the friends showed symptoms about two weeks earlier on average — because they were better connected, and so were exposed sooner. The friends were, in the language of the formula, a size-biased sample of the student body, and their earlier infection is the friendship paradox measured in days.

What the counts leave out

The networks here are models, seeded and of fixed size, and every number in the figures belongs to the particular network drawn. The independent-friendship result — exactly one extra friend — is a theorem about the limit and is confirmed by the figures to within a few hundredths; the preferential-attachment numbers are measurements of one network of 3,000 people, and a network of 30,000 grown the same way would show a larger gap, since its hubs would be larger.

The figures also count friendships as symmetric and unweighted. Real friendships are neither: they differ in strength, some are one-sided, and a person’s experience of their friends’ popularity depends on which friends they talk to. The paradox survives most of these complications — any sampling through relationships is size-biased by the number of relationships — but its size changes, and a weighted network can show a paradox in the weights as well as in the counts.

And nothing here says why real networks are unequal. Preferential attachment is one mechanism that produces hubs, but networks with the same counts can be built many other ways, and the counts alone do not distinguish them. The paradox needs only the counts; the vaccination result needs more, because the effect of removing people depends on how the hubs are connected to each other, which the counts do not record.

Still open: how unequal real networks are

The paradox reduces to a question about the distribution of counts, and that question is not settled for real networks. Whether the counts of friends in large social networks follow a power law, as preferential attachment predicts, or a distribution with a lighter tail, such as a log-normal, has been argued since the model was proposed, and careful statistical tests have found that many networks claimed to follow power laws are fitted at least as well by other distributions. Since the gap is the variance over the mean, and the variance of a power law may grow without bound, the answer decides whether the paradox in a large network is moderate or arbitrarily severe.

Mathematically, the individual version is less understood than the averaged one. The share of people outnumbered by their friends depends on how the counts of neighbours are correlated — whether hubs befriend hubs or befriend the poorly connected — and there is no general formula for it in terms of simple statistics of the network. Bounds are known for particular models, and the share in preferential attachment networks as they grow is computed by simulation rather than derived.

And the vaccination strategy has an open optimisation problem behind it: among all strategies that use only local information — follow one link, or two, or ask each person a question about their friends — which reaches the hubs most efficiently for a given number of vaccinations? Following two links finds even better-connected people in some networks and not in others, and the answer depends on structure that the counts of friends do not reveal.

Counting each friendship from both ends

A friend is reached through a friendship, so the people reached as friends are weighted by how many friendships they have, and their average number of friends is E[d2]/E[d]=E[d]+Var⁡(d)/E[d]\mathbb{E}[d^2]/\mathbb{E}[d] = \mathbb{E}[d] + \operatorname{Var}(d)/\mathbb{E}[d] — larger than a person’s average unless everyone has the same number. In twelve people the averages are 3.13 against 2.67; with independent friendships among 3,000, a friend’s count is a person’s count shifted by exactly one, the person asking, 7.07 against 6.04; with preferential attachment it is 15.3 against 6.0. Person by person, nobody is outnumbered in a ring, 64% are with independent friendships and 90% are with hubs; across eight networks the gap tracks the variance over the mean, about 1 for every Poisson network. And because a random friend is size-biased, vaccinating random friends of random people breaks a network with hubs much sooner than vaccinating random people — at 40% coverage, 36% still connected against 59% — without knowing who the hubs are.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

DegreePercolationPoisson distributionRandom graphSize-biased samplingVariance