|
|
Line 1: |
Line 1: |
| In [[computing]], the '''alias method''' is a family of efficient [[algorithm]]s for [[pseudo-random number sampling|sampling from a discrete probability distribution]], due to A. J. Walker.<ref>A. J. Walker, Electronics Letters 10, 127 (1974); ACM TOMS 3, 253 (1977)</ref> The algorithms typically use <math>O(n \log n)</math> or <math>O(n)</math> preprocessing time, after which random values can be drawn from the distribution in <math>O(1)</math> time.<ref>Vose, Michael. [http://web.eecs.utk.edu/~vose/Publications/random.pdf A Linear Algorithm For Generating Random Numbers with a Given Distribution]</ref>
| | They call me Janel Joiner. My friends say it's not good for me but what I love doing is researching fashion but I don't have the time lately. [http://Www.Bing.com/search?q=Curing+people&form=MSNNWS&mkt=en-us&pq=Curing+people Curing people] is how I make a living and I don't think I'll change it anytime soon. My husband and I live in Virginia. Go to my website to find out more: http://test-nccm.kilu.de/index.php?mod=users&action=view&id=33948<br><br> |
|
| |
|
| Internally, the algorithm builds two tables, a ''[[probability]] [[Table (information)|table]]'' and an ''alias table''. To generate a random outcome, a fair [[dice|die]] is rolled to determine an index into the probability table. Based on the probability stored at that index, a [[biased coin]] is then flipped, and the outcome of the flip is used to determine which result to output.<ref>[http://www.keithschwarz.com/darts-dice-coins/ Darts, Dice, and Coins: Sampling from a Discrete Distribution]. KeithSchwarz.com. Retrieved on 2011-12-27.</ref>
| | Look at my homepage; calzoncillos Calvin Klein 2014 ([http://test-nccm.kilu.de/index.php?mod=users&action=view&id=33948 http://test-nccm.kilu.de/index.php?mod=users&action=view&id=33948]) |
| | |
| There are cases in which the alias method is not optimal in rolls of the die. Consider the case where there are two choices with equal probability, and we have a die with 256 sides. The alias method could be performed with one throw of the die. However, the roll of the die could be used to make 8 independent selections between two choices using the binary representation of the numbers from 0 to 255. Another case is when there are a million different choices, but one of the choices has a probability of 99.99%. The alias method would require several rolls of the 256 side die. The table method described by Marsaglia et al. is more efficient.<ref>{{Citation |author1=George Marsaglia |author2=Wai Wan Tsang |author3=Jingbo Wang |title=Fast Generation of Discrete Random Variables |url=http://www.jstatsoft.org/v11/i03 |journal=Journal of Statistical Software |date=2004-07-12 |volume=11 |issue=3 |pages=1–11|accessdate=2012-07-14}}</ref>
| |
| | |
| ==Literature==
| |
| | |
| Knuth, Art of Computer Programming, Vol 2: Seminumerical Algorithms: Sect. 3.4.1.
| |
| | |
| ==Implementations==
| |
| * http://www.keithschwarz.com/darts-dice-coins/ Keith Schwarz: Detailed explanation, numerically stable version of Vose's algorithm, and link to Java implementation
| |
| * http://apps.jcns.fz-juelich.de/ransampl Joachim Wuttke: Implementation as a small C library.
| |
| | |
| ==References==
| |
| {{reflist}}
| |
| | |
| [[Category:Pseudorandom number generators]]
| |
| | |
| | |
| {{statistics-stub}}
| |
| {{comp-sci-stub}}
| |
They call me Janel Joiner. My friends say it's not good for me but what I love doing is researching fashion but I don't have the time lately. Curing people is how I make a living and I don't think I'll change it anytime soon. My husband and I live in Virginia. Go to my website to find out more: http://test-nccm.kilu.de/index.php?mod=users&action=view&id=33948
Look at my homepage; calzoncillos Calvin Klein 2014 (http://test-nccm.kilu.de/index.php?mod=users&action=view&id=33948)