Alias method: Difference between revisions

Content deleted Content added
m Implementations: typo fix
Line 44:
 
Another case arises when the probabilities are strongly unbalanced, so many {{math|''U<sub>i</sub>'' ≈ 0}}. For example if {{math|1=''p''<sub>1</sub> = 0.999}} and {{math|1=''p''<sub>2</sub> = 0.001}}, then the great majority of the time, only a few random bits are required to determine that case 1 applies.
In such cases, the table method described by Marsaglia et al.<ref name=marsaglia/>{{Rp|1–4}} is more efficient. If we make many choices with the same probability we can on average require much less than one unbiased random bit. Using [[Arithmeticarithmetic coding]] techniques arithmetic we can approach the limit given by the [[Binarybinary entropy function]].
 
==Literature==