鱼C论坛

 找回密码
 立即注册
查看: 2154|回复: 0

题目186:网络连通性

[复制链接]
发表于 2016-10-4 02:11:31 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
Connectedness of a network

Here are the records from a busy telephone system with one million users:

QQ20161004-1@2x.png


The telephone number of the caller and the called number in record n are Caller(n) = S2n-1 and Called(n) = S2n where S1,2,3,... come from the "Lagged Fibonacci Generator":

For 1 ≤ k ≤ 55, Sk = [100003 - 200003k + 300007k3] (modulo 1000000)
For 56 ≤ k, Sk = [Sk-24 + Sk-55] (modulo 1000000)

If Caller(n) = Called(n) then the user is assumed to have misdialled and the call fails; otherwise the call is successful.

From the start of the records, we say that any pair of users X and Y are friends if X calls Y or vice-versa. Similarly, X is a friend of a friend of Z if X is a friend of Y and Y is a friend of Z; and so on for longer chains.

The Prime Minister's phone number is 524287. After how many successful calls, not counting misdials, will 99% of the users (including the PM) be a friend, or a friend of a friend etc., of the Prime Minister?


题目:

下面是一个有着 100 万用户的繁忙电话系统的记录:

QQ20161004-2@2x.png


在第 n 条记录中,拨号者和接听者的电话号码分别是 Caller(n) = S2n-1 和 Called(n) = S2n ,其中 S1,2,3,... 都是从如下的“Fibonacci 数产生器”中获得的:

如果 1 ≤ k ≤ 55,那么 Sk = [100003 - 200003k + 300007k3] (modulo 1000000)

否则,如果 56 ≤ k, Sk = [Sk-24 + Sk-55] (modulo 1000000)

如果 Caller(n) = Called(n),用户无疑是拨错号了,这次拨号自然也就失败了,否则拨号就会成功。

从上面记录的开始,我们定义,如果 X 打给 Y,或 Y 打给 X,那么 X 和 Y 就是朋友。相似的,如果 X 是 Y 的朋友,而 Y 又是 Z 的朋友,则 X 就是 Z 的朋友的朋友,以此类推,我们可以得到一条很长的关系链。

假设首相的号码是 524287。那么,在多少次成功的拨号后,不计算失败的拨号,99% 的用户(包括首相在内)会处在首相的朋友关系链中?

想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-7-2 22:57

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表