Ruby の標準乱数生成器とその改善案

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite & 2 Events

    Ruby の標準乱数生成器とその改善案 - Presentation Transcript

    1. Ruby The standard random number generator of Ruby and the proposal to improve it Kenta Murata mrkn 1 2009 7 18
    2. Ruby The standard random number generator of Ruby and the proposal to improve it Kenta Murata mrkn 2 2009 7 18
    3. ‣ Ph.D (Hokkaido University) ‣ Department of Information Science. ‣ Born on July 20th COMING SOON ‣ Membership ‣ Ruby Sapporo (ruby-sapporo.org) ‣ KaigiFreaks ‣ Nihon Ruby-no kai ‣ Kosen Conference (kosenconf.jp) 3 2009 7 18
    4. Photo by snoozer05 in Flickr http://www.flickr.com/photos/snoozer/2605952121/ 4 2009 7 18
    5. Photo by darashi in Flickr http://www.flickr.com/photos/darashi/2598246980/ 5 2009 7 18
    6. Photo by snoozer05 in Flickr http://www.flickr.com/photos/snoozer/2605971795/ 6 2009 7 18
    7. Photo by snoozer05 in Flickr http://www.flickr.com/photos/snoozer/2605971795/ 2009 7 18
    8. Ruby Programmer's Programmer's Recipe Recipe Programmer's Ruby Recipe Ruby Visual Basic 2008 Ruby Programmer's Recipe Programmer's Recipe Visual Basic 2008 [ Windows ] 26 267 CONTENTS 1 2 SQL 3 R y Ruby Programmer's Recipe SQL 4 232 160 5 6 PHP 7 Programmer's Recipe 8 PHP 9 P P PHP 261 10 11 Windows/Mac PHP5.3 12 13 232 14 8 2009 7 18
    9. Ruby Programmer's Programmer's Recipe Recipe Programmer's Ruby Recipe ‣ Ruby Visual Basic 2008 Programmer's Recipe Programmer's Recipe Ruby Ruby Visual Basic 2008 [ Windows ] 26 267 CONTENTS 1 2 SQL 3 R y Ruby Programmer's Recipe SQL 4 232 160 5 6 PHP 7 Programmer's Recipe 8 PHP 9 P P PHP 261 10 11 Windows/Mac PHP5.3 12 13 232 14 8 2009 7 18
    10. Ruby Programmer's Programmer's Recipe Recipe Programmer's Ruby Recipe ‣ Ruby Visual Basic 2008 Programmer's Recipe Programmer's Recipe Ruby Ruby Visual Basic 2008 [ Windows ] 26 267 CONTENTS 1 2 SQL 3 R y Ruby Programmer's Recipe SQL 4 232 160 5 6 PHP 7 Programmer's Recipe 8 PHP 9 P P PHP 261 10 11 Windows/Mac PHP5.3 12 13 232 14 8 2009 7 18
    11. Ruby Programmer's Programmer's Recipe Recipe Programmer's Ruby Recipe ‣ Ruby Visual Basic 2008 Programmer's Recipe Programmer's Recipe Ruby Ruby Visual Basic 2008 [ Windows ] 26 267 CONTENTS 1 2 SQL 3 R y Ruby Programmer's Recipe SQL 4 232 160 5 6 ‣ PHP 7 Programmer's Recipe 8 PHP 9 P P PHP 261 10 11 Windows/Mac PHP5.3 12 13 232 14 8 2009 7 18
    12. 9 2009 7 18
    13. From Sapporo, with Love for Ruby 10 2009 7 18
    14. 11 2009 7 18
    15. Ruby The standard random number generator of Ruby and the proposal to improve it Kenta Murata 12 2009 7 18
    16. ‣ Kernel#rand ‣ Math/Random ‣ Random 13 2009 7 18
    17. 14 2009 7 18
    18. ‣ ‣ ‣ ‣ ‣ ‣ 15 2009 7 18
    19. 3 ‣ ‣2 ‣ Monte Carlo ‣ 16 2009 7 18
    20. Monte Carlo ‣ ‣ ‣ ‣ ‣ ‣ ‣ 17 2009 7 18
    21. ‣ ‣ ‣ ‣ ‣ ‣ ‣ 18 2009 7 18
    22. ‣ srand 13 ‣ 1000.times.map { 1 + rand 6 } ‣ => [3, 1, 3, 1, 3, 5, 2, 5, 3, 4, 3, 5, 3, 6, 6, 3, 2, 4, 5, 3, 1, 4, 6, 4, 4, 6, 4, 2, 3, 1, 5, 4, 1, 5, 3, 3, 5, 6, 4, 6, 1, 4, 3, 1, 6, 2, 1, 2, 6, 6, 3, 4, 3, 4, 4, 4, 1, 3, 1, 3, 6, 6, 5, 4, 6, 1, 6, 2, 6, 2, 5, 4, 3, 2, 5, 4, 1, 6, 6, 6, 4, 2, 2, 2, 1, 3, 4, 5, 3, 6, 2, 5, 4, 2, 4, 2, 3, 2, 4, 5, 1, 5, 5, 4, 5, 4, 6, 6, 1, 4, 4, 4, 2, 1, 5, 6, 2, 2, 3, 1, 3, 3, 3, 2, 3, 5, 1, 3, 2, 5, 2, 1, 1, 2, 4, 5, 1, 4, 5, 1, ...] 19 2009 7 18
    23. ✓srand 13 ‣ => [3, 1, 3, 1, 3, 5, 2, 5, ✓a = Thread.start do 3, 4, 3, 5, 3, 6, 6, 3, 2, 4, 1000.times.map{ 5, 3, 1, 4, 6, 4, 4, 6, 4, 2, 1 + rand(6) } 3, 1, 5, 4, 1, 5, 3, 3, 5, 6, end 4, 6, 1, 4, 3, 1, 6, 2, 1, 2, ✓b = Thread.start do 6, 6, 3, 4, 3, 4, 4, 4, 1, 3, 1000.times.map{ 1, 3, 6, 6, 5, 4, 6, 1, 6, 2, 1 + rand(6) 6, 2, 5, 4, 3, 2, 5, 4, 1, 6, } end 6, 6, 4, 2, 2, 2, 1, 3, 4, 5, 3, 6, 2, 5, 4, 2, 4, 2, ...] 20 2009 7 18
    24. ✓srand 13 ‣ => [3, 1, 3, 1, 3, 5, 2, 5, ✓a = Thread.start do 3, 4, 3, 5, 3, 6, 6, 3, 2, 4, 1000.times.map{ 5, 3, 1, 4, 6, 4, 4, 6, 4, 2, 1 + rand(6) } 3, 1, 5, 4, 1, 5, 3, 3, 5, 6, end 4, 6, 1, 4, 3, 1, 6, 2, 1, 2, ✓b = Thread.start do 6, 6, 3, 4, 3, 4, 4, 4, 1, 3, 1000.times.map{ 1, 3, 6, 6, 5, 4, 6, 1, 6, 2, 1 + rand(6) 6, 2, 5, 4, 3, 2, 5, 4, 1, 6, } end 6, 6, 4, 2, 2, 2, 1, 3, 4, 5, 3, 6, 2, 5, 4, 2, 4, 2, ...] 21 2009 7 18
    25. ✓srand 13 ‣ => [3, 1, 3, 1, 3, 5, 2, 5, ✓a = Thread.start do 3, 4, 3, 5, 3, 6, 6, 3, 2, 4, 1000.times.map{ 5, 3, 1, 4, 6, 4, 4, 6, 4, 2, 1 + rand(6) } 3, 1, 5, 4, 1, 5, 3, 3, 5, 6, end 4, 6, 1, 4, 3, 1, 6, 2, 1, 2, ✓b = Thread.start do 6, 6, 3, 4, 3, 4, 4, 4, 1, 3, 1000.times.map{ 1, 3, 6, 6, 5, 4, 6, 1, 6, 2, 1 + rand(6) 6, 2, 5, 4, 3, 2, 5, 4, 1, 6, } end 6, 6, 4, 2, 2, 2, 1, 3, 4, 5, 3, 6, 2, 5, 4, 2, 4, 2, ...] 22 2009 7 18
    26. ‣ >< ‣ ‣ srand orz 23 2009 7 18
    27. Ruby 24 2009 7 18
    28. Ruby 25 2009 7 18
    29. Ruby ‣ Kernel#rand ‣ 25 2009 7 18
    30. Ruby ‣ Kernel#rand ‣ ‣ Kernel#srand ‣ 25 2009 7 18
    31. Ruby ‣ Kernel#rand ‣ ‣ Kernel#srand ‣ ‣ 25 2009 7 18
    32. 26 2009 7 18
    33. ‣ ‣ ‣ ‣ ‣ 27 2009 7 18
    34. Ruby 28 2009 7 18
    35. ‣ ‣ ‣ Ruby 29 2009 7 18
    36. ‣ ‣ ‣ Random 30 2009 7 18
    37. 31 2009 7 18
    38. ‣ 2007 ruby-dev ‣ [ruby-dev:31206] trunk patch ‣ Kernel#srand ‣ Matz 31 2009 7 18
    39. ‣ 2007 ruby-dev ‣ [ruby-dev:31206] trunk patch ‣ Kernel#srand ‣ Matz ‣ 31 2009 7 18
    40. 32 2009 7 18
    41. ‣ 32 2009 7 18
    42. ‣ ‣ 15 Random trunk 32 2009 7 18
    43. ‣ ‣ 15 Random trunk ‣ 16 Random 32 2009 7 18
    44. ‣ ‣ ‣ ‣ ‣ 33 2009 7 18
    45. ‣ ‣ Array#shuffle Kernel#rand ‣ Array#sample ‣ ‣ 34 2009 7 18
    46. Math/Random 35 2009 7 18
    47. Math/Random ‣ https://github.com/mrkn/ruby-math- random/tree/master ‣ >< ‣ ‣ ASAP 36 2009 7 18
    48. Math/Random ‣ ‣2 ‣ Mersenne Twister (MT19937AR) ‣ SFMT (SFMT19937) ‣2 ‣ ‣ 37 2009 7 18
    49. Math/Random ‣ ‣ ‣ Lagged Fibonacci Blum-Blum-Shub ‣ ‣ Erlang ‣ ‣ Kernel#rand 38 2009 7 18
    50. ‣ Random ‣ ‣ ‣ 39 2009 7 18
    51. ‣ Kernel#rand ‣ 15 ‣ Math/Random ‣ Random ! ‣ 15 ‣ EXPERIMENTAL 40 2009 7 18
    SlideShare Zeitgeist 2009

    + Kenta MurataKenta Murata Nominate

    custom

    747 views, 1 favs, 1 embeds more stats

    Ruby の標準乱数生成器の特徴と問題点 more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 747
      • 694 on SlideShare
      • 53 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 3
    Most viewed embeds
    • 53 views on http://d.hatena.ne.jp

    more

    All embeds
    • 53 views on http://d.hatena.ne.jp

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories

    Groups / Events