This is going to be ­awkward, but someone has to tell you, so it may as well be me: you're kind of a loser. You know that feeling you sometimes have that your friends have more friends than you? You're right. They do. And you know how almost everyone at the gym seems in better shape than you, and how everyone at your book club seems better read? Well, they are. If you're single, it's probably a while since you dated – what with you being such a loser – but when you did, do you recall thinking the other person was more romantically experienced than you? I'm afraid it was probably true.

The only consolation in all this is that it's nothing personal: it's a ­bizarre statistical fact that almost all of us have fewer friends than our friends, more flab than our ­fellow gym-goers, and so on. In other words, you're a loser, but it's not your fault: it's just maths. (I mean, it's probably just maths. You might be a catastrophic failure as a human being, for all I know. But let's focus on the maths.)

To anyone not steeped in ­statistics, this seems crazy. ­Friendship is a two-way street, so you'd assume things would average out: any given person would be as likely to be more popular than their friends as less. But as the sociologist Scott Feld showed, in a 1991 paper bluntly entitled Why Your Friends Have More Friends Than You Do, this isn't true. If you list all your friends, and then ask them all how many friends they have, their ­average is very likely to be higher than your friend count.

The reason is bewilderingly ­simple: "You are more likely to be friends with someone who has more friends than with someone who has fewer friends," as the ­psychologist Satoshi Kanazawa puts it. You're more likely to know more popular people, and less likely to know less popular ones. Some people may be completely friendless, but you're not friends with any of them.

The implications of this seeming paradox cascade through daily life. People at your gym tend to be fitter than you because you tend not to encounter the ones who rarely go; any given romantic partner is likely to have had more partners than you because you're more likely to be part of a larger group than a small one. ("If your lover only had one lover," Kanazawa writes, "you are probably not him.") This is also why people think of certain beaches or museums or airports as usually ­busier than they actually are: by ­definition, most people aren't there when they're less crowded.

This takes some mental ­gymnastics to appreciate, but it's deeply reassuring. We're often told that comparing yourself with others is a fast track to misery – "The grass is always greener" – but the usual explanation is that we choose to compare ourselves with the wrong people: we pick the happiest, wealthiest, most talented people, and ignore how much better off we are than most.

Feld's work, though, suggests that this is only half of the problem. When it comes to those people we know well, the field from which we're choosing our comparisons is statistically skewed against us to begin with.

So next time you catch yourself feeling self-pityingly inferior to ­almost everyone you know, take heart: you're right, but then, it's the same for them, too.

oliver.burkeman@theguardian.com