Alias method: Difference between revisions

Content deleted Content added
BeeOnRope (talk | contribs)
update ransampl list
Operation: y is clearly between 0 and 1 not 1 and 2
Line 7:
 
# Generate a [[Uniform distribution (continuous)|uniform]] random variate {{math|0 ≤ ''x'' < 1}}.
# Let {{math|1=''i'' = ⌊''nx''⌋ + 1}} and {{math|1=''y'' = ''nx'' + 1 − ''i''}}. (This makes {{math|''i''}} uniformly distributed on {{math|{1, 2, ..., ''n''} }} and {{math|''y''}} uniformly distributed on {{math|[10, 21)}}.)
# If {{math|''y'' &lt; ''U<sub>i</sub>''}}, return {{mvar|i}}. This is the biased coin flip.
# Otherwise, return {{mvar|K<sub>i</sub>}}.