V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
Livid
V2EX  ›  Python

对 random.randrange 的一个试验

  •  
  •   Livid · 2013-12-06 19:08:37 +08:00 · 3751 次点击
    这是一个创建于 3799 天前的主题,其中的信息可能已经有所发展或是发生改变。

    运行结果:

    1: 9.99375%
    2: 10.00486%
    3: 10.01411%
    4: 9.99314%
    5: 9.98705%
    6: 10.00872%
    7: 9.99246%
    8: 10.00895%
    9: 9.99675%
    10: 10.00021%
    4 条回复    1970-01-01 08:00:00 +08:00
    sethverlo
        1
    sethverlo  
       2013-12-06 19:11:41 +08:00
    1000w 样本不算大啊……
    tioover
        2
    tioover  
       2013-12-06 21:12:31 +08:00
    主要看分布,记得有文章将随即函数分布弄成图片,可以很明显看出真随即和伪随机
    allenforrest
        3
    allenforrest  
       2013-12-06 21:51:14 +08:00
    相当相当的不错了。
    RTNelo
        4
    RTNelo  
       2013-12-07 19:14:12 +08:00
    为何不用 collections.Counter ?
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   771 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 20:55 · PVG 04:55 · LAX 13:55 · JFK 16:55
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.