[Python-ideas] Re: Better (?) PRNG - follow up

2022-12-06 Thread Steven D'Aprano
On Tue, Dec 06, 2022 at 07:58:09PM -0500, David Mertz, Ph.D. wrote: > You have an error in the code you posted. You never use R2 after one > call to SystemRandom. Ah so I do, thanks for picking that up! James, see how *easy* it is for experts to notice bugs, at least some of them, in a short

[Python-ideas] Re: Better (?) PRNG - follow up

2022-12-06 Thread Steven D'Aprano
Thanks for posting your code, but at 178 lines (most of which are either commented out or irrelevent to your question) its a hard slog to work out what you're doing. And as for the seemingly endless sequence of "Random number ... Value entered", what did information did you think we would get

[Python-ideas] Re: Better (?) PRNG - follow up

2022-12-06 Thread Alex Prengère
-ideas@python.org > Subject: [Python-ideas] Re: Better (?) PRNG - follow up > > > I used a brute force method to check the probability. Counted the number > > of triples in 600 random numbers 0-9, repeated that 1 times and took > > the mean: 5.99 > > So it loo

[Python-ideas] Re: Better (?) PRNG - follow up

2022-12-06 Thread Chris Angelico
On Tue, 6 Dec 2022 at 21:39, Benedict Verhegghe wrote: > > I used a brute force method to check the probability. Counted the number > of triples in 600 random numbers 0-9, repeated that 1 times and took > the mean: 5.99 > So it looks like Chris's number is more accurate. Calling my number

[Python-ideas] Re: Better (?) PRNG - follow up

2022-12-06 Thread Benedict Verhegghe
] Re: Better (?) PRNG - follow up I used a brute force method to check the probability. Counted the number of triples in 600 random numbers 0-9, repeated that 1 times and took the mean: 5.99 So it looks like Chris's number is more accurate. Benedict Op 6/12/2022 om 09:25 schreef Alex

[Python-ideas] Re: Better (?) PRNG - follow up

2022-12-06 Thread Benedict Verhegghe
I used a brute force method to check the probability. Counted the number of triples in 600 random numbers 0-9, repeated that 1 times and took the mean: 5.99 So it looks like Chris's number is more accurate. Benedict Op 6/12/2022 om 09:25 schreef Alex Prengère: @Chris Indeed the true

[Python-ideas] Re: Better (?) PRNG - follow up

2022-12-06 Thread Alex Prengère
@Chris Indeed the true figure, if my math is correct, is a bit under 5.98 because of the "non-independence" of triplets. I computed it and found 5.382, so finding 6 is entirely normal. For the details: calling L = 600 and n = 3 * number of possible sequence of L digits: 10^L * if a specific digit

[Python-ideas] Re: Better (?) PRNG - follow up

2022-12-05 Thread Greg Ewing
On 6/12/22 3:58 pm, James Johnson wrote: I came back to this thread looking for the list of randomness tests, and I keep missing them somehow. If you're interested in testing a PRNG really thoroughly, check out TestU01: http://simul.iro.umontreal.ca/testu01/tu01.html -- Greg

[Python-ideas] Re: Better (?) PRNG - follow up

2022-12-05 Thread Chris Angelico
On Tue, 6 Dec 2022 at 14:00, James Johnson wrote: > > I came back to this thread looking for the list of randomness tests, and I > keep missing them somehow. > > The reason for my follow up is this: The random number function in Python has > important uses far beyond my personal concerns, and

[Python-ideas] Re: Better (?) PRNG - follow up

2022-12-05 Thread James Johnson
I came back to this thread looking for the list of randomness tests, and I keep missing them somehow. The reason for my follow up is this: The random number function in Python has important uses far beyond my personal concerns, and random.randint(0,9) is supposed to be the Mersenne Twister. I