android 揭示动画_如何模拟社交网络揭示了为什么我没有朋友,也没有空闲时间...

android 揭示动画

The friendship paradox is an observed social phenomenon that most people have fewer friends than their friends have, on average. Sometimes it is stated more strongly that most people have fewer friends than most of their friends. It’s not clear from the popular articles about the topic whether the latter statement is generally true. Let’s investigate!

友谊悖论是一种观察到的社会现象,即大多数人平均拥有的朋友少于其朋友。 有时更有说服力的是, 大多数人的朋友少于大多数朋友。 从有关该主题的热门文章尚不清楚,后一种说法通常是否正确。 让我们调查一下!

I would have thought this would be difficult to determine, and perhaps this is why it took until 1991 for someone to discover it. In Scott Feld’s original paper, Why your friends have more friends than you do, he suggested that this might be a source of feelings of inadequacy. But, I mean, it’s not like people keep tallies of each of their friend’s friends, let alone a list of their own friends, do they? This was probably true in 1991, but now in the age of Facebook we can do this with ease — and probably a lot of people do.

我以为这很难确定,也许这就是为什么直到1991年才有人发现它的原因。 在斯科特·费尔德(Scott Feld)的原始论文中,“ 为什么您的朋友比您有更多的朋友” ,他建议这可能是不适当的感觉的根源。 但是,我的意思是,这并不像人们记下每个朋友的朋友,更不用说列出自己朋友的列表了,对吗? 1991年可能是这样,但是在Facebook时代,我们可以轻松地做到这一点-也许很多人都可以做到。

我的书里有多少张脸 (How many faces are in my book)

In fact, why not, I’ll have a go. I have 374 friends on Facebook. I’m not sure why. Anyway, let’s take 10 random friends and count the number of friends that they have. Here’s the tally:

实际上,为什么不呢,我去吧。 我在Facebook上有374个朋友。 我不知道为什么。 无论如何,让我们随机抽取10个朋友并计算他们拥有的朋友数量。 这是理货单:

Friend 1 - 522
Friend 2 - 451
Friend 3 - 735
Friend 4 - 397
Friend 5 - 2074
Friend 6 - 534
Friend 7 - 3607
Friend 8 - 237
Friend 9 - 1171
Friend 10 - 690

The average number of friends these friends have is 1042. So I have fewer friends than my friends have, on average. Also, of these 10, I have fewer friends than all but one of them — poor friend number 8.

这些朋友平均拥有的朋友数量为1042 。 因此,平均而言,我的朋友少于朋友。 另外,在这10个朋友中,除了几个朋友之外,我的朋友比其他几个都少-可怜的朋友8。

Okay, but this is not a paradox — especially if you know me. How about we look at someone else in my network, say Friend 2. Friend 2 has 451 friends, and because Facebook is such a secure website that naturally preserves the privacy of its users, we can click on profiles of the friends of Friend 2 to find out how many friends they have. The numbers of friends that 10 random friends of Friend 2 have are: 790, 928, 383, 73, 827, 1633, 202, 457, 860, and 121. On average, Friend 2’s friends have 627 friends, which is more than 451. Also, six of these friends have more than 451 friends and so Friend 2 has fewer friends than most of their friends as well. If we repeated this exercise for all of my friends, we would still find that most of them have fewer friends than their friends even though most already have more friends than me!

好的,但这不是一个悖论-尤其是如果您认识我。 朋友2说,我们如何看待我网络中的其他人。朋友2有451个朋友,并且由于Facebook是这样一个安全的网站,自然可以保留其用户的隐私,因此我们可以单击朋友2的朋友的个人资料来找出他们有多少朋友。 朋友的数字,朋友2的10周随机的朋友拥有有:790,928,383,73,827,1633 ,202,457,860,121。 朋友2的朋友平均有627个朋友,超过451个。此外,这些朋友中有六个有451个朋友,因此,朋友2的朋友也少于大多数朋友。 如果我们对我所有的朋友重复此练习,我们仍然会发现,即使大多数朋友已经比我多,他们的朋友也比他们的朋友少!

You probably have a gut feeling that this is paradoxical. My intuition for why it feels paradoxical comes from the following analogy. Consider your height. Perhaps you are shorter than average. Maybe you have some friends that are also shorter than average. But, you expect to find at least half the people out that are actually taller than average. That’s kind of the intuition of “average” after all. Why isn’t the same true for friends, then? That is, even though myself and Friend 2 have fewer friends than our friends, surely those people out there with lots of friends have more friends than their friends. This is true, but these popular people are extremely rare, and that is the difference between friend numbers and height, for example.

您可能有一种直觉,认为这很矛盾。 我之所以感到自相矛盾的直觉来自以下类推。 考虑你的身高。 也许您比平均水平短。 也许您有一些比平均水平短的朋友。 但是,您希望至少找到一半的人实际上比平均水平更高。 毕竟,这是“平均”的直觉。 那么,为什么朋友不一样呢? 也就是说,即使我和朋友2比我们的朋友的朋友少,想必那些人在那里有很多朋友比朋友更多的朋友。 的确如此,但是这些受欢迎的人非常罕见,例如,这就是朋友人数和身高之间的区别。

In a typical social network, there are lots of people with few friends and few people with lots of friends. The very popular people are counted in many people’s friend circles. And, the unpopular people are not counted in many friend circles. Take my Facebook friendship as an example again. I have, apparently, few Facebook friends. So, it would seem that many people have more friends than me. But — and here is the most important point — those people are unlikely to count me and my low number of friends in their friend circles. This is evidenced by the fact that Friend 2 and I only have 2 friends in common. So all of those friends of Friend 2, when they go to count the number of friends their own friends have, aren’t going to have me and my low friend count skewing the distribution in their favor.

在典型的社交网络中,有很多人很少有朋友,也很少有人有很多朋友。 在很多人的朋友圈中都非常受欢迎。 而且,不受欢迎的人在很多朋友圈中都不算在内。 再以我的Facebook友谊为例。 显然,我的Facebook朋友很少。 因此,似乎很多人比我拥有更多的朋友。 但是-这是最重要的一点-这些人不太可能算我以及我在朋友圈中的朋友数量很少。 事实证明,我和朋友2只有两个共同的朋友。 因此,所有“朋友2”的朋友去计算自己朋友的朋友数时,都不会让我和我的低朋友数偏向他们的分配。

这就是为什么“空手道小子”这么孤独吗? (Is this why the “karate kid” was such a loner?)

Let’s look at some smaller examples where we can count everyone and their friends in the network. The most famous social network (at least to network theorists) is Zachary’s karate club. It looks like this.

让我们看一些较小的示例,在这些示例中,我们可以计算网络中的每个人及其朋友。 最著名的社交网络(至少对于网络理论家而言)是Zachary的空手道俱乐部 。 看起来像这样。

Image for post
Zachary’s karate club. Node colors guide the eye and are marked based on the number of friends each person has. Image by author| source.
扎卡里的空手道俱乐部。 节点颜色引导眼睛,并根据每个人拥有的朋友数量进行标记。 图片作者 来源

This shows 34 people in a karate club (circa 1970) and who they interacted with outside class. Colors simply guide the eye to how many friends each member has. You can see one person only has 1 friend and another has a whopping 17! Already this graph is too big to count things by hand, but a computer can step through each node in the network and count the friends and the friends of friends. In Zachary’s karate club, then, we have,

这显示了空手道俱乐部中的34个人(1970年左右),以及他们与外部课堂互动的人。 颜色只是引导每个成员拥有多少朋友。 您会看到一个人只有1个朋友,而另一个人却高达17! 此图已经太大了,无法手工计算,但计算机可以遍历网络中的每个节点并计算朋友和朋友的朋友。 在扎卡里的空手道俱乐部里,

The fraction of people with fewer friends than their friends have on average is 85.29%.The fraction of people with fewer friends than most of their friends is 70.59%.
Image for post
Histogram of friends and friends of friends in Zachary’s karate club. The data is collected by looking at the friends of each friend for every person in the network. The distribution of those friends can be summarized by the mean and median. For each friend of each person, those numbers are tabulated and plotted in the lower row. Image by author| source.
扎卡里空手道俱乐部的朋友和朋友的朋友的直方图。 通过查看网络中每个人的每个朋友的朋友来收集数据。 这些朋友的分布可以用均值和中位数来概括。 对于每个人的每个朋友,这些数字都被制成表格并绘制在下面的行中。 图片作者 来源

The above histograms show the data in detail. You can see the key feature again of a few people with lots of friends. Obviously those few people are going to have more friends than their friends have. But that’s the point — there are only a few such people! Once we look at the full distribution of “friends of friends” we find it flattens out significantly, and it is more likely to find a large number of friends. The lower two histograms show the mean and median number of friends of each person in the network. Note that in either case, each person has friends with roughly 9 friends. This much more than the vast majority of people in the network! Indeed, only 4 people out of 34 have more than 9 friends.

上面的直方图详细显示了数据。 您会再次看到几个有很多朋友的人的主要功能。 显然,很少有人会比他们的朋友拥有更多的朋友。 但这就是重点-只有少数这样的人! 查看“朋友之友”的完整分布后,我们发现它会明显缩小,并且更有可能找到大量朋友。 下方的两个直方图显示了网络中每个人的朋友的平均数和中位数。 请注意,无论哪种情况,每个人都有大约9个朋友的朋友。 这远远超过了网络中的绝大多数人! 实际上,在34个人中,只有4个人拥有超过9个朋友。

变大还是变大...实际上,走多大并不重要 (Go big or go… actually it doesn’t seem to matter how big we go)

Now let’s go back to Facebook. This time we’ll use data collected from ten individuals, anonymized and made public. It includes roughly 4000 people connected to these 10 individuals in various social circles. The social network looks like this.

现在让我们回到Facebook。 这次,我们将使用从十个人收集的数据,将其匿名化并公开 。 它包括大约4000个人,与各个社交圈中的这10个人相关。 社交网络看起来像这样。

Image for post
The Facebook Ego Graph, showing community structure and clustering around popular individuals. Image by Author| Facebook自我图,显示社区结构和受欢迎人群的聚集。 图片作者 source. 来源

We can do the counting of friends and friends of friends for this network as well. The details look like this.

我们也可以为该网络计算朋友和朋友的朋友。 细节看起来像这样。

Image for post
Histogram of friends and friends of friends in the Facebook Ego Graph. The data is collected by looking at the friends of each friend for every person in the network. The distribution of those friends can be summarized by the mean and median. For each friend of each person, those numbers are tabulated and plotted in the lower row. Image by author| source.
Facebook自我图中的朋友和朋友的朋友的直方图。 通过查看网络中每个人的每个朋友的朋友来收集数据。 这些朋友的分布可以用均值和中位数来概括。 对于每个人的每个朋友,这些数字都被制成表格并绘制在下面的行中。 图片作者 来源

In summary, we find,

总而言之,我们发现,

The fraction of people with fewer friends than their friends have on average is 87.47%.The fraction of people with fewer friends than most of their friends is 71.92%.

Very similar! But perhaps this is just a coincidence. It’s only two data points after all. How do we test the idea for any social network? Simulation!

非常相似! 但这也许只是一个巧合。 毕竟只是两个数据点。 我们如何测试任何社交网络的想法? 模拟!

伪造直到成功 (Fake it ’til you make it)

Simulation is a tool to understand something by way of studying scale models of it. A model airplane wing in a wind tunnel is a classic example. Today, many simulations are done entirely on computers. In the context of social networks there are many models, but out of sheer laziness we will choose the so-called Barabási–Albert model because it is already implement in NetworkX, the computer package I’m using. If we create a mock social network of 34 people (same number as the karate club), it will look something like this.

仿真是一种通过研究模型来了解事物的工具。 风洞中的飞机机翼模型就是一个典型的例子。 今天,许多模拟完全在计算机上完成。 在社交网络中,有许多模型,但是出于懒惰的考虑,我们将选择所谓的Barabási-Albert模型,因为它已经在NetworkX (我正在使用的计算机软件包)中实现。 如果我们创建一个由34个人组成的模拟社交网络(与空手道俱乐部人数相同),它将看起来像这样。

Image for post
An instance of the Barabási–Albert model on 34 nodes. It is constructed node by node, connecting each new node to two previous nodes, with a preference for highly connected nodes. This is a example social network. Image by Author| source.
Barabási-Albert模型 在34个节点上的 一个实例 它是逐节点构造的,将每个新节点连接到两个先前的节点,并且优先选择高度连接的节点。 这是一个示例社交网络。 图片作者 来源

It doesn’t look all that much different from the karate club, does it? The numerical data are similar as well.

与空手道俱乐部看起来并没有太大不同,是吗? 数值数据也相似。

Image for post
Histogram of friends and friends of friends in the example Barabási–Albert model graph above. The data is collected by looking at the friends of each friend for every person in the network. The distribution of those friends can be summarized by the mean and median. For each friend of each person, those numbers are tabulated and plotted in the lower row. Image by Author| source.
上面的示例Barabási–Albert模型图中的朋友和朋友的朋友的直方图。 通过查看网络中每个人的每个朋友的朋友来收集数据。 这些朋友的分布可以用均值和中位数来概括。 对于每个人的每个朋友,这些数字都被制成表格并绘制在下面的行中。 图片作者 来源

In this example, the numbers of interest are,

在此示例中,感兴趣的数字是

The fraction of people with fewer friends than their friends have on average is 79.41%.The fraction of people with fewer friends than most of their friends is 70.59%.

This is nice, but the real beauty of simulation is the ability to rapidly test multiple examples. The above is just one mock social network. To get full confidence in our conclusion (relative to the assumptions of the model of course), we need to perform many simulations over randomly generated social networks.

这很好,但是模拟的真正优点在于能够快速测试多个示例。 以上只是一个模拟社交网络。 为了完全相信我们的结论(相对于该模型的假设),我们需要对随机生成的社交网络执行许多模拟。

模拟所有图形! (Simulate all the graphs!)

If we repeat the above exercise over 10,000 random social networks with 34 individuals, we find,

如果我们在34个人的10,000个随机社交网络上重复上述练习,我们会发现,

The fraction of people with fewer friends than their friends have on average is 79.31%.The fraction of people with fewer friends than most of their friends is 65.31%.

So now we can say with some confidence that the friend paradox persists in any social network — at least one that has the same characteristics as the Barabási–Albert model with 34 people. Another thing we can easily do though is change the number of people in the network to see if the trend continues for large networks. Indeed, things get much worse if we increase the number of people. As the number of people in the social network increases, the fraction of people with fewer friends than their friends (in majority or on average) also increases.

因此,现在我们可以放心地说,朋友悖论存在于任何社交网络中-至少一个具有与Barabási-Albert模型相同的特征(有34人)。 但是,我们可以轻松完成的另一件事是更改网络中的人数,以查看大型网络的趋势是否继续。 确实,如果我们增加人数,情况将变得更加糟糕。 随着社交网络中人数的增加,朋友少于朋友(大部分或平均)的人所占的比例也会增加。

Image for post
The friendship paradox demonstrated over 100 randomly chosen social networks created with the Barabási–Albert model , for increasing network size. Image by Author| source.
友谊悖论说明了使用 Barabási-Albert模型 创建的100多个随机选择的社交网络 ,用于增加网络规模。 图片作者 来源

太酷了 有什么更令人沮丧的告诉我们的吗? (Cool, cool. Anything less depressing to tell us?)

It’s been shown that this paradox goes beyond friends as well. You are also probably deficient, when comparing yourself to your friends, in income, Twitter followers, and how happy you are — and this fact is probably not helping. But, okay, enough of this crap — we all feel terrible now! Surely there is something positive we can glean from all this, right? Yes!

事实证明 ,这种悖论也超越了朋友。 与朋友比较自己时,您的收入,Twitter追踪者和您的幸福感也可能很不足,而这一事实可能无济于事。 但是,好吧,这些废话够多了-我们现在都感到可怕! 当然,我们可以从中汲取一些积极的东西,对吗? 是!

Since your friends have more contacts than you, they will probably contract a virus — or anything else transmitted through communities — before you. Indeed, researchers showed that instead of tracking randomly chosen people to gauge the spread of a disease, it was much more efficient to ask those random people to name a friend, and track that friend instead! In the study, the group of friends got sick an average 2 weeks before the originally chosen people. There are probably lots of other applications out there waiting to be found for the friendship paradox.

由于您的朋友比您拥有更多的联系人,因此他们可能会在您之前感染病毒或通过社区传播的任何其他信息。 确实,研究人员表明,与其追踪随机选择的人来衡量疾病的传播,不如让那些随机的人命名一个朋友,然后追踪那个朋友,效率更高! 在这项研究中 ,这群朋友平均比最初选择的人生病了2周。 可能存在许多其他应用程序正在等待友谊悖论的发现。

Before we end, though, I want to ask one last question: does the friendship paradox have to happen in any social network? The answer to this is yes and no. For the statement of the paradox that uses averages the answer is yes and this can be proven mathematically. That is, the statement on average, people have less than or equal to the average number of friends of their friends is true for any social network you can conceive of. For the statement which uses majority (most of your friends have strictly more friends than you), the answer is no. The key ingredient is the existence — or non-existence — of popular individuals. We can even create completely random social networks for which the paradox does not hold. Consider the following network, again over 34 people.

不过,在结束之前,我想问最后一个问题:在任何社交网络中都必须发生友谊悖论吗? 答案是否定的。 对于使用平均值的悖论的陈述,答案是肯定的,并且可以通过数学证明 。 也就是说,对于您可以构想的任何社交网络,平均而言,人们的朋友人数少于或等于其朋友的平均人数。 对于使用多数的陈述(您的大多数朋友严格来说比您有更多的朋友),答案是否定的。 关键因素是受欢迎的个人的存在或不存在。 我们甚至可以创建悖论不成立的完全随机的社交网络。 考虑下面的网络,同样有34人。

Image for post
This network (coming from the 该网络(来自 Erdős–Rényi modelErdős-Rényi模型 ) is constructed by considering every person is a friend of every other person with some fixed probability (in this case 75%). Image by Author| )是通过考虑每个人都是每个其他人的朋友(具有75%的固定概率)而构造的。 图片作者 source. 来源

For this social network we have,

对于这个社交网络,

The fraction of people with fewer friends than their friends have on average is 44.12%.The fraction of people with fewer friends than most of their friends is 44.12%.

You can see from the detailed distribution of friends the difference more clearly. The number of friends is evenly spread around the average. This is similar to looking at the height of people. So, roughly half the people have fewer friends than their friends, another rough half has more friends than their friends, and the rest have exactly the same number as the average of their friends.

您可以从朋友的详细分布中更清楚地看到差异。 朋友的数量平均分布在平均数附近。 这类似于看人的身高。 因此,大约一半的人的朋友少于他们的朋友,另一半的人的朋友比他们的朋友多,其余的人与他们的朋友的平均数完全相同。

Image for post
Histogram of friends and friends of friends in the example Erdős–Rényi model graph above. The data is collected by looking at the friends of each friend for every person in the network. The distribution of those friends can be summarized by the mean and median. For each friend of each person, those numbers are tabulated and plotted in the lower row. Image by Author| source.
上面的示例Erdős–Rényi模型图中的朋友和朋友的朋友的直方图。 通过查看网络中每个人的每个朋友的朋友来收集数据。 这些朋友的分布可以用均值和中位数来概括。 对于每个人的每个朋友,这些数字都被制成表格并绘制在下面的行中。 图片作者 来源

结论 (Conclusion)

Of course, it should be somewhat obvious that if everyone had exactly the same number of friends, then they would have the same number of friends as their friends! But this is also true when the distribution of friends is more evenly spread. What does this suggest? I guess it lends credence to claims of favorability of egalitarian communities. But it seems to be the case that more hierarchical networks (be they in friendships, corporations, Twitter followers, etc.) grow naturally as a way to accommodate the complexity arising from maintaining large numbers of connections. But that is the topic for another blog post. In the meantime,

当然,应该显而易见的是,如果每个人的朋友数完全相同,那么他们的朋友数将与他们的朋友数相同! 但是,当朋友的分布更加均匀时,也是如此。 这表明什么? 我猜这使人们对平等社区的偏爱有了可信度。 但是,似乎存在这样的情况,更多的分层网络(例如,在友谊,公司,Twitter追随者中的人)以自然的方式增长,以适应维持大量连接所带来的复杂性。 但这是另一篇博客文章的主题。 同时,

Please don’t share this. Instead, tell a friend to share it.

请不要分享。 相反,告诉朋友分享。

(All simulations and data for this article are available on GitHub below.)

(本文的所有模拟和数据都可以在下面的GitHub上找到。)

翻译自: https://towardsdatascience.com/how-simulating-social-networks-revealed-why-i-have-no-friends-and-also-no-free-time-a61dec4d677a

android 揭示动画

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值