How to generate geometric random numbers?

Paul Rubin http
Mon Jul 24 03:06:38 EDT 2006


Robert Kern <robert.kern at gmail.com> writes:
> > I usually owuld write that as int(ceil(log(U, 1.0 - p))).
> Knock yourself out. I was cribbing from my C implementation in numpy.

Oh cool, I thought you were pasting from a Python implementation. No prob. 



More information about the Python-list mailing list