http://www.perlmonks.org?node_id=158827


in reply to Re: Re: Rolling a biased die
in thread Rolling a biased die

My bad ... you're totally right.

I don't know what i was thinking when i did that calculation. Even if every bucket is a transition point, resolving the transtion only requires that you pick between the two possible (weighted) values for that bucket.

O(1 + k) = O(1)