tag:blogger.com,1999:blog-5888658295182480819.post4629996255890833816..comments2022-04-05T09:43:19.308-03:00Comments on Alaska Ataca a Kamtchatka: Vose's Alias MethodMatías Giovanninihttp://www.blogger.com/profile/17772004856076119446noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5888658295182480819.post-33189681201937601192012-01-12T00:20:02.732-03:002012-01-12T00:20:02.732-03:00Thanks to both of you for your work on this. I was...Thanks to both of you for your work on this. I was really inspired. I wrote an object-oriented version of the algorithm in Smalltalk here: http://on.fb.me/zkzq0I. I'd appreciate any comments you have on the style.Poker Workouthttps://www.blogger.com/profile/05323466430032995382noreply@blogger.comtag:blogger.com,1999:blog-5888658295182480819.post-28071892733801137782011-12-29T18:04:35.468-03:002011-12-29T18:04:35.468-03:00@Keith,
in your language of choice, follow the ex...@Keith,<br /><br />in your language of choice, follow the execution of your algorithm with [0.7, 0.3]. As I wrote on reddit, even if neither number can be represented exactly in floating point, the sum 0.7 + 0.3 is exactly 1.0, provided the language uses correct decimal to binary conversion. When computing p_g - (1 - p_l) the errors combine, making the result less than 1. Computing (p_g + p_l) - Matías Giovanninihttps://www.blogger.com/profile/17772004856076119446noreply@blogger.comtag:blogger.com,1999:blog-5888658295182480819.post-81153477651928419252011-12-29T17:58:28.506-03:002011-12-29T17:58:28.506-03:00Hello Matias - this is Keith Schwarz. Thanks for ...Hello Matias - this is Keith Schwarz. Thanks for spotting these errors! In my writeup I had been ignoring issues of floating-point errors, but these are extremely valid points. I'll be sure to update the article with additional information about implementing the algorithm in practice.<br /><br />Out of curiosity, can you elaborate on the reason why it's preferable to use (p_g + p_l) - Anonymousnoreply@blogger.com