[英]Generating uniformly distributed random numbers in distributed environment
I have to generate a "unique Random Number" in a Wireless sensor network which works on the principle of Gossiping. 我必须在按照闲聊原理工作的无线传感器网络中生成一个“唯一随机数”。
The requirements are: 要求是:
The limitations are: 限制是:
I also have the provision of using a unique seed for random number generation. 我还提供了使用唯一种子进行随机数生成的规定。 the seed could be any number in the range 0-2^15 .
种子可以是0-2 ^ 15范围内的任何数字。
If there is no way of generating such numbers, then it would be helpful if there is any method by which I can meet some of the above requirements. 如果没有办法生成这样的数字,那么如果有任何一种方法可以满足上述一些要求,那将是有帮助的。
If you can suggest me some way to achieve this result it would be really helpful. 如果您可以建议我一些实现此结果的方法,那将非常有帮助。
for this solution to work you must know the total number of nodes in the generation network. 为了使该解决方案有效,您必须知道世代网络中的节点总数。 let this number be
n
. 将此数字设为
n
。
the basic idea is to generate uniformly distributed random numbers on each participating node inside a given interval. 基本思想是在给定间隔内在每个参与节点上生成均匀分布的随机数。 the
n
intervals of the participating nodes must not overlap. 参与节点的
n
间隔不得重叠。 a shared seed does not complicate matters if the total number of nodes does not change and each node can be assigned statically some integer i
<= n
such that each number is issued exactly once. 如果节点总数不变,并且每个节点可以静态分配一些整数
i
<= n
,使得每个节点仅发出一次,则共享种子不会使问题变得复杂。 instead of generating a single random number on each turn, n
numbers are generated, and node i
takes the i
-th number from this series. 不是在每个回合上生成一个随机数,而是生成
n
个数,并且节点i
从该序列中获取第i
个数。
however, the overall distribution of random numbers generated will not be uniform unless ...: 但是,除非...,否则生成的随机数的总体分布将不一致。
for information on random number generation on individual nodes see here . 有关在各个节点上生成随机数的信息, 请参见此处 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.