计算机工程与应用 ›› 2009, Vol. 45 ›› Issue (29): 82-83.DOI: 10.3778/j.issn.1002-8331.2009.29.023

• 研发、设计、测试 • 上一篇    下一篇

基于前缀码的随机数发生器

戴祖旭,陈 静   

  1. 武汉工程大学 理学院,武汉 430074
  • 收稿日期:2008-08-25 修回日期:2008-10-20 出版日期:2009-10-11 发布日期:2009-10-11
  • 通讯作者: 戴祖旭

Prefix code based random number generator

DAI Zu-xu,CHEN Jing   

  1. School of Science,Wuhan Institute of Technology,Wuhan 430074,China
  • Received:2008-08-25 Revised:2008-10-20 Online:2009-10-11 Published:2009-10-11
  • Contact: DAI Zu-xu

摘要: 设计并实现了生成任意给定分布随机变量的随机数发生器。根据指定精度将随机变量的概率分布用幂级数扩展,构造前缀码,利用前缀码对均匀分布的随机序列编码得到结果。数值实验证实了该算法的有效性。

关键词: 随机数发生器, 前缀码, 概率分布扩展, 幂级数

Abstract: A random number generator which generates a variable assuming any given probability distribution is designed based on prefix code and programed.The probability space is firstly expanded by decomposing each value to several temporary symbols.Each symbol is allotted a probability of power of a given integer,and the summation of these powers approximate the probability of corresponding value in original space repectively.Then a prefix code is constructed in the new space and used to code a uniform sequence.The effect of the generator is validated by experimental result.

Key words: random number generator, prefix code, probability distribution expand, series of power

中图分类号: