å æ¥@niamããã¨@tsubosakaããã®ã¤ã¶ãããè¦ã¦ã¦ï¼ç¢ºç{pi}ã§å¾©å æ½åºããWalker's alias methodã¨ãããã®ãç¥ãã¾ããï¼ãã¾ãã¾ï¼ä»æ¥ï¼å¾©å æ½åºããç¨äºããã£ãã®ã§ï¼æãåºãã¦èª¿ã¹ã次第ï¼ç§ãæåããã¨ããããã¨ãã¦ï¼O(log n)ã§ãããããã¾ããããã¨æã£ã¦ããã®ã§ããï¼ãã®ã¢ã«ã´ãªãºã ã ã¨O(1)ã§ããã¾ãï¼ è§£èª¬ã¯ãã®ãããã®ããã°ãåç §ï¼ æ¯è¼çé«éãªå¾©å æ½åºã¢ã«ã´ãªãºã é«éã«é復å æ½åºãããã¢ã«ã´ãªãºã ã¯ãªãã ãããï¼(2)ãã¦ï¼ç§ã¯ç解åã足ããªãã¦ãã®ãããã®èª¬æãèªãã§ããªãã§ããã§ããã®ããã£ã±ãããããªãã£ãã®ã§ï¼çµµã«æãã¦ç解ãã¾ããï¼ç¢ºç{pi}ã§å¾©å æ½åºããããã«ã¯ï¼piã«æ¯ä¾ããé¢ç©ã®å³å½¢ãå£ã«è²¼ã£ã¦ãã¼ããããã°ããã®ã§ãï¼{0.1, 0.05, 0.3, 0.1, 0.45}ã ã£ãã¨ãã¾ãï¼ããã¨ãããªã®ï¼ ã¾ããæ¯å
{{#tags}}- {{label}}
{{/tags}}