News for hackers. Stuff that matters.
Re:Show HN: Learn When to Quit by fourthark on Saturday December 07, 2019 @04:29PM (#21732678)
Consider a two digit number. With this algorithm, half of the numbers generated will be less than 10, and half will be 11-99.

Likewise with the full 100 digits this algorithm has a 1% chance of generating a number less than 10, while the correct proportion would be 1e-100.

The algorithm also does not generate numbers with zero in them (presumably to avoid leading zeroes, but this will skew results somewhat).

I think the correct algorithm would be to generate 100 digits and then remove the leading zeroes.

There are no comments on this comment yet.